Givecash command errors
#8

OnPlayerCommandText()
pawn Код:
OnPlayerCommandText(playerid, cmdtext)
{
  new cmd[64], idx;
  new tmp[128];
  cmd = strtok(cmdtext, idx); // This is the command (e.g /help)
  if(strcmp(cmd, "/givecash", true) == 0)
  {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
      return SendClientMessage(playerid, COLOR_RED, "Usage: /givecash [playerid] [amount]");
   
    new player = strval(tmp);
   
    if(!IsPlayerConnected(player))
      return SendClientMessage(playerid, COLOR_RED, "Wrong id, or not connected");
   
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
      return SendClientMessage(playerid, COLOR_RED, "Usage: /givecash [playerid] [amount]");
   
    new amount = strval(tmp);
   
    GivePlayerMoney(playerid, amount);
   
    return 1;
  }
}
But i hope you learn pawn, and not requesting every time when you dont know something.
Reply


Messages In This Thread
Givecash command errors - by basker - 06.12.2009, 13:08
Re: Givecash command errors - by Jeffry - 06.12.2009, 13:13
Re: Givecash command errors - by DJDhan - 06.12.2009, 13:16
Re: Givecash command errors - by DeathOnaStick - 06.12.2009, 13:16
Re: Givecash command errors - by LarzI - 06.12.2009, 15:05
Re: Givecash command errors - by DeathOnaStick - 06.12.2009, 15:08
Re: Givecash command errors - by LarzI - 06.12.2009, 15:18
Re: Givecash command errors - by godknightx - 06.12.2009, 15:19

Forum Jump:


Users browsing this thread: 1 Guest(s)