SA-MP Forums Archive
Unknown Command [Rep ++] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Unknown Command [Rep ++] (/showthread.php?tid=424861)



Unknown Command [Rep ++] - teomakedonija - 23.03.2013

Hi Scripters.I need help with my command. My command is /showlicenses but when i put the id send me a message with text: SERVER: Unknown Command

pawn Код:
if(strcmp(cmd,"/pokazilicenci",true)==0 || strcmp(cmd,"/showlicenses",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "{37F906}INFO:{FFFFFF}/showlicenses [ID/Ime na Igracot].");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if (ProxDetectorS(8.0, playerid, giveplayerid))
                    {
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        new text1[20];
                        new text2[20];
                        new text3[20];
                        new text4[20];
                        new text5[20];
                        if(PlayerInfo[playerid][pCarLic]) { text1 = "{6EF83C}Ima"; } else { text1 = "{FF4040}Nema"; }
                        if(PlayerInfo[playerid][pFlyLic]) { text4 = "{6EF83C}Ima"; } else { text4 = "{FF4040}Nema"; }
                        if(PlayerInfo[playerid][pBoatLic]) { text2 = "{6EF83C}Ima"; } else { text2 = "{FF4040}Nema"; }
                        if(PlayerInfo[playerid][pFishLic]) { text3 = "{6EF83C}Ima"; } else { text3 = "{FF4040}Nema"; }
                        if(PlayerInfo[playerid][pGunLic]) { text5 = "{6EF83C}Ima"; } else { text5 = "{FF4040}Nema"; }
                        format(text1, sizeof(text1), "Vozacka Dozvola: %s", text1);
                        format(text2, sizeof(text2), "Dozvola za Letanje: %s", text4);
                        format(text3, sizeof(text3), "Dozvola za Plovidba: %s", text2);
                        format(text4, sizeof(text4), "Dozvola za Ribolov: %s", text3);
                        format(text4, sizeof(text5), "Dozvola za Oruzje: %s", text5);
                        format(string,1234,"\n%s\n%s\n%s\n%s\n%s",text1,text2,text3,text4,text5);
                        ShowPlayerDialog(playerid, 85, DIALOG_STYLE_MSGBOX, "OK");
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "{FF0000}GRESKA:{FFFFFF}Igracot ne e do vas.");
                        return 1;
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "{FF0000}GRESKA:{FFFFFF}Nema takov igrac.");
                return 1;
            }
        }
        return 1;
    }



Re: Unknown Command [Rep ++] - FaceTutorialz - 24.03.2013

I see what you did. The line at the top where it says strcmp(cmd,"/showlicenses",true)==0) Replace that 0 with a 1, or else it won't show, this is the same with the other languaged line.


Re: Unknown Command [Rep ++] - Don_Cage - 24.03.2013

Quote:
Originally Posted by FaceTutorialz
Посмотреть сообщение
I see what you did. The line at the top where it says strcmp(cmd,"/showlicenses",true)==0) Replace that 0 with a 1, or else it won't show, this is the same with the other languaged line.
That wont do anything, All my commands is 0 at the end lol and all of them work too so I do not think that making it 1 will change anything.


Re: Unknown Command [Rep ++] - teomakedonija - 24.03.2013

Quote:
Originally Posted by FaceTutorialz
Посмотреть сообщение
I see what you did. The line at the top where it says strcmp(cmd,"/showlicenses",true)==0) Replace that 0 with a 1, or else it won't show, this is the same with the other languaged line.
Not working When i change it from 0 to 1 if(strcmp(cmd, "/showlicenses", true) == 1)
{...
...
and command not showing text for command ex. Use /showlicenses [id]


Re: Unknown Command [Rep ++] - teomakedonija - 24.03.2013

Anyone ?


Re: Unknown Command [Rep ++] - IstuntmanI - 24.03.2013

Use debugging:
https://sampwiki.blast.hk/wiki/Debugging


Re: Unknown Command [Rep ++] - teomakedonija - 24.03.2013

I don't know how to use this please give me my command with debug ?


Re: Unknown Command [Rep ++] - FaceTutorialz - 25.03.2013

I thought I added a - before the 1, Try removing the 0 and put a -1, that usually debugs it, if it don't work, something might be wrong with the inner scripting programs. Post the problems from the compiler, it will help more on how to fix this.