/kill? But not the suicide one...
#5

Quote:
Originally Posted by JeNkStAX
pawn Код:
// Top of OnPlayerCommandText
new idx;
new tmp[128];
new cmd[128];
cmd = strtok(cmdtext, idx);

// Command
if(strcmp(cmd, "/kill2", true) == 0)
{
  tmp = strtok(cmdtext,idx);
  if(!strlen(tmp))
  {
    SendClientMessage(playerid, color, "Usage: /kill2 [playerid/name]");
    return 1;
  }
  new player = ReturnUser(tmp);
  SetPlayerHealth(player, 0);
  return 1;
}
I'd like to make it, that's why I asked if he has strtok.
Also same about ReturnUser. (which could be done with strval instead.)
But I don't get it, JeNkStAX.
Why do you use the usage like that?
pawn Код:
if(!strlen(tmp))
  {
    SendClientMessage(playerid, color, "Usage: /kill2 [playerid/name]");
    return 1;
  }

Reply


Messages In This Thread
/kill? But not the suicide one... - by FrazZ - 03.04.2009, 22:16
Re: /kill? But not the suicide one... - by MenaceX^ - 03.04.2009, 22:18
Re: /kill? But not the suicide one... - by FrazZ - 03.04.2009, 22:23
Re: /kill? But not the suicide one... - by ICECOLDKILLAK8 - 03.04.2009, 22:24
Re: /kill? But not the suicide one... - by MenaceX^ - 03.04.2009, 22:25
Re: /kill? But not the suicide one... - by ICECOLDKILLAK8 - 03.04.2009, 22:28
Re: /kill? But not the suicide one... - by LarzI - 03.04.2009, 22:44
Re: /kill? But not the suicide one... - by MenaceX^ - 03.04.2009, 22:57
Re: /kill? But not the suicide one... - by ICECOLDKILLAK8 - 03.04.2009, 23:09
Re: /kill? But not the suicide one... - by Donvalley - 03.04.2009, 23:37

Forum Jump:


Users browsing this thread: 1 Guest(s)