[DELETE] Fixed...
#1

Fixed...
Reply
#2

Use dcmd and sscanf for commands like that. It's pretty simple to use https://sampwiki.blast.hk/wiki/Dcmd
Reply
#3

i thought someone might say that, and personally i hate dcmd, that's why i don't use it. So, can anyone fix what i did wrong?
Reply
#4

anyone?
Reply
#5

If you're using strtok you won't end up with a space in your parameter's string. For exampl,e if I type '/derby 1 on' you 'strtok'ed string will be 1.

I believe a better method to get what you want in this particular case would be to use no splitting function at all.

pawn Код:
if(!strcmp(cmdtext[1],"derby",true,5))
{
  if(IsPlayerAdmin(playerid))
  {
    if(!strlen(cmdtext[7]))return SendClientMessage(playerid,0xFF0000FF,"Admin Error Message");
    if(!strcmp(cmdtext[7],"1 on",true))
    {
      //work
    }
  }else{ //Player is not admin
    if(!strlen(cmdtext[7]))return SendClientMessage(playerid,0xFF0000FF,"Player Error Message");
    if(!strcmp(cmdtext[7],"join",true))
    {
      //work
    }
  }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)