Jump to content
  • 0

Problema compilare


a!eX

Question

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
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

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
Link to comment
Share on other sites

  • 0

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

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

Edited by a!eX
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0
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..  "

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.