strtok?
#8

Well, strtok is mostly used when youґve got more params, like /ban ID REASON.

Your command would work aswell, BUT a lot of easier and nicer method would be this:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{  
  if(strcmp(cmd, "/ban", true) == 0 )
  {
   new pid = strval(cmdtext);
   if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You need to be Admin to use /ban");
   if(!IsPlayerConnected(pid)) return SendClientmessage(playerid, 0xFFFFFFFF, "Player offline");
   Ban(pid);
   return 1;
     
  }
  return 0;
}
And please, once again - using DCMD is much easier, because you dont need any strtok at all there.
Reply


Messages In This Thread
strtok? - by waza75 - 06.01.2010, 16:20
Re: strtok? - by ¤Adas¤ - 06.01.2010, 16:25
Re: strtok? - by ClanDBZVegeta - 06.01.2010, 16:33
Re: strtok? - by waza75 - 06.01.2010, 16:34
Re: strtok? - by waza75 - 06.01.2010, 17:06
Re: strtok? - by Striker_Moe - 06.01.2010, 17:08
Re: strtok? - by waza75 - 06.01.2010, 17:24
Re: strtok? - by Striker_Moe - 06.01.2010, 17:27
Re: strtok? - by waza75 - 06.01.2010, 17:31
Re: strtok? - by Sergei - 06.01.2010, 17:38

Forum Jump:


Users browsing this thread: 1 Guest(s)