SA-MP Forums Archive
Why doesn't this work ? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Why doesn't this work ? (/showthread.php?tid=101558)



Why doesn't this work ? - Zeromanster - 11.10.2009

It just doesn't work, i don't know why. I want to have spaces in the name of the command.

pawn Код:
if(strcmp(cmd, "/command space", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
    //Some code over here.
   }
}
Please help, thank you.


Re: Why doesn't this work ? - [XST]O_x - 11.10.2009

Hmm,try:
pawn Код:
if (strcmp("/command space", cmdtext, true, 14) == 0)
    {
    if(IsPlayerConnected(playerid))
   {
    //Some code over here.
   }
    return 1;
    }
I Didnt test it,But this is may work.
The 14 means the number of characters.

Wow the indentation fucked.


Re: Why doesn't this work ? - Zeromanster - 11.10.2009

It's working, thanks Firefox.


Re: Why doesn't this work ? - MenaceX^ - 11.10.2009

Use strtok or sscanf.