SA-MP Forums Archive
Command Messed Up - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Command Messed Up (/showthread.php?tid=198728)



Command Messed Up - Rokzlive - 13.12.2010

Ok, i have a /stopwork command, but when i enter it, it works fine but says SERVER: Invalid Command. Here it is.
pawn Код:
if(!strcmp("/stopwork", cmdtext, true))
    {
        CancelPlayersCurrentMission(playerid);
        new string[100];
        format(string, sizeof(string),"To start a mission type /work");
        TextDrawShowForPlayer ( playerid, mission [ playerid ] );
        TextDrawSetString(mission [ playerid ],string);
    }



Re: Command Messed Up - Lynn - 13.12.2010

pawn Код:
if(!strcmp("/stopwork", cmdtext, true))
{
    if(IsPlayerConnected(playerid))
    {
        CancelPlayersCurrentMission(playerid);
        new string[100];
        format(string, sizeof(string),"To start a mission type /work");
        TextDrawShowForPlayer ( playerid, mission [ playerid ] );
        TextDrawSetString(mission [ playerid ],string);
    }
    return 1;
}
Try that


Re: Command Messed Up - Rokzlive - 13.12.2010

=D Thankyou so much it worked perfectly!


Re: Command Messed Up - Hal - 13.12.2010

Quote:
Originally Posted by Rokzlive
Посмотреть сообщение
=D Thankyou so much it worked perfectly!
If you don't return 1; it(script) thinks that nothing (no command) was found, so it sends that message. Just so you know why that showed.