Jump to content
  • 0

Problema compilare


Question

Posted (edited)
Spoiler

    if(!strcmp(cmd, "/agivemats", true) || !strcmp(cmd, "/agm", true))
    {
        if (PlayerInfo[playerid][pAdmin] >= 5)
        {
            if(IsPlayerConnected(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendUsage(playerid,"/agivemats [playerid/PartOfName] [amount]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendUsage(playerid,"/agivemats [playerid/PartOfName] [amount]");
                    return 1;
                }
                moneys = strval(tmp);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                PlayerInfo[giveplayerid][pMats] = moneys;
                format(string, 256, "{C8D4D4}Adm{DB8E12}Warning:{FFFFFF} Admin [%d]%s i-a setat lui [%d]%s, %s materiale.",playerid,sendername,giveplayerid,giveplayer,moneys);
                ABroadCast(COLOR_LIGHTRED,string,1);
                Update(giveplayerid, pMatsx);
            }
        }
        return false;
    }
    if(!strcmp(cmdtext, "/stillupta", true))
    {
        ShowPlayerDialog(playerid,222,DIALOG_STYLE_LIST,"FightStyle","1. Normal\r\n2. Boxing\r\n3. Kungfu\r\n4. Kneehead\r\n5. Grabkick\r\n6. Elbow","Select", "Cancel");
        return false;
    }
    if(!strcmp(cmdtext, "/skills", true))
    {
        new gpsss[3024], count = 1;
        for(new i = 1; i <= sizeof(JobSalary); i++)
        {
    if(strlen(JobSalary[1]) != 0 )
            {
                format(gpsss,sizeof(gpsss),"%d. %s - %d ture efectuate / Skill %d/7\n",count,JobSalary[JOB_NAME],PlayerInfo[playerid][pSkill],CalculateSkill(playerid,i));
            }
        }
        ShowPlayerDialog(playerid,999,DIALOG_STYLE_MSGBOX," Competentele tale:",gpsss,"Inchidere", "");
    }
    if(!strcmp(cmdtext, "/jobs", true))
    {
        new gpsss[1024];
        format(gpsss, sizeof(gpsss), "1. Avocat\r\n2. Detectiv \r\n3. Ziarist\r\n4. Boxer\r\n5. Tractorist\r\n6. Barcagiu\r\n7. Taietor de iarba\r\n8. Sofer de tren\r\n9. Camionagiu\r\n10.Spargator de masini\r\n11. Prostituata\r\n12. Dealer de arme\r\n13. Dealer de droguri\r\n14. BodyGuard\r\n15. Gunoier\r\n16. Mechanic\r\n17. Miner\r\n18. Padurar\r\n19. Distribuitor de baloti");
        ShowPlayerDialog(playerid,153,DIALOG_STYLE_LIST," Locatie Joburi",gpsss,"Select", "Cancel");
        return false;
    }

x14kHnz.png

d8mq6Ey.png

Edited by a!eX

9 answers to this question

Recommended Posts

  • 0
Posted (edited)

Din cate vad incerci sa foloseste strlen pe o variabila de tip integer. Pune in loc de if(strlen(JobSalary[1]  != 0) )cu  if (JobSalary[1] [ i ] > 0)

Cu toate ca functiile de stringuri ar trebui sa mearga si pe matrici(array) dar nu tot timpu mai ales ca e un array 2D

Edited by Banditul
  • Upvote 1
  • 0
Posted (edited)

Salut! tot nu merge sa il compilez imi poti da un id sa te pot contacta ? Daca vrei...

------------------------------------------------------------------------------------------------------------------------------------------------------------wNNOFLZ.png

Edited by a!eX
  • 0
Posted
Acum 1 oră, a!eX a spus:

Salut! tot nu merge sa il compilez imi poti da un id sa te pot contacta ? Daca vrei...

------------------------------------------------------------------------------------------------------------------------------------------------------------wNNOFLZ.png

Cum este definita acea variabila?

  • Sad 1
  • 0
Posted

pune comanda  aia aici nu arata imagine

  • Upvote 1

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

  • 0
Posted (edited)

enum JOB_MAIN {
    JOB_NAME[28],
    JOB_SALARY

};

static const JobSalary[][JOB_MAIN] = {
    {"Detectiv",5000},
    {"Prostituata",5000},
    {"Dealer de droguri",5000},
    {"Spargator de masini",5000},
    {"Ziarist",5000},
    {"Mecanic",5000},
    {"Bodyguard",5000},
    {"Dealer de arme",5000},
    {"",5000},
    {"Boxer",5000},
    {"",5000},
    {"",5000},
    {"Vanzator de ziare",5000},
    {"Camionagiu",5000},
    {"Tractorist",5000},
    {"Gunoier",5000},
    {"",5000},
    {"Maturator",5000},
    {"Maturator de strada",5000},
    {"Barcagiu",5000},
    {"Taietor de iarba",5000},
    {"Sofer de tren",5000},
    {"Miner",5000},
    {"Padurar",5000},
    {"Distribuitor de baloti",5000}
};

 

//-----------------------------------------Comanda-----------------------------------------//
    if(!strcmp(cmd, "/agivemats", true) || !strcmp(cmd, "/agm", true))
    {
        if (PlayerInfo[playerid][pAdmin] >= 5)
        {
            if(IsPlayerConnected(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendUsage(playerid,"/agivemats [playerid/PartOfName] [amount]");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendUsage(playerid,"/agivemats [playerid/PartOfName] [amount]");
                    return 1;
                }
                moneys = strval(tmp);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                PlayerInfo[giveplayerid][pMats] = moneys;
                format(string, 256, "{C8D4D4}Adm{DB8E12}Warning:{FFFFFF} Admin [%d]%s i-a setat lui [%d]%s, %s materiale.",playerid,sendername,giveplayerid,giveplayer,moneys);
                ABroadCast(COLOR_LIGHTRED,string,1);
                Update(giveplayerid, pMatsx);
            }
        }
        return false;
    }
    if(!strcmp(cmdtext, "/stillupta", true))
    {
        ShowPlayerDialog(playerid,222,DIALOG_STYLE_LIST,"FightStyle","1. Normal\r\n2. Boxing\r\n3. Kungfu\r\n4. Kneehead\r\n5. Grabkick\r\n6. Elbow","Select", "Cancel");
        return false;
    }
    if(!strcmp(cmdtext, "/skills", true))
    {
        new gpsss[3024], count = 1;
        for(new i = 1; i <= sizeof(JobSalary); i++)
        {
          if (JobSalary[1] [ i ] > 0)
            {
                format(gpsss,sizeof(gpsss),"%d. %s - %d ture efectuate / Skill %d/7\n",count,JobSalary[JOB_NAME],PlayerInfo[playerid][pSkill],CalculateSkill(playerid,i));
            }
        }
        ShowPlayerDialog(playerid,999,DIALOG_STYLE_MSGBOX," Competentele tale:",gpsss,"Inchidere", "");
    }
    if(!strcmp(cmdtext, "/jobs", true))
    {
        new gpsss[1024];
        format(gpsss, sizeof(gpsss), "1. Avocat\r\n2. Detectiv \r\n3. Ziarist\r\n4. Boxer\r\n5. Tractorist\r\n6. Barcagiu\r\n7. Taietor de iarba\r\n8. Sofer de tren\r\n9. Camionagiu\r\n10.Spargator de masini\r\n11. Prostituata\r\n12. Dealer de arme\r\n13. Dealer de droguri\r\n14. BodyGuard\r\n15. Gunoier\r\n16. Mechanic\r\n17. Miner\r\n18. Padurar\r\n19. Distribuitor de baloti");
        ShowPlayerDialog(playerid,153,DIALOG_STYLE_LIST," Locatie Joburi",gpsss,"Select", "Cancel");
        return false;
    }
//-----------------------------------------Comanda-----------------------------------------//

Edited by a!eX
  • 0
Posted
10 hours ago, Banditul said:

if (JobSalary[ i ] [ JOB_SALARY ] > 0) 

incearca asa. Din cate vad a doua dimensiune este definitia job_main

Compilare  succes full  " @Banditul   poti lucra pentru mine la un gamemode de rpg ?  Tot ce faci pentru mine se plateste..  "

  • 0
Posted

Nu am timp. Facultatea imi ocupa tot timpul + ca mai ajut la un server facut de niste prieteni(nu rpg)

Si sincer sa fiu cu tine nu prea imi place rpg

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.