help to Create things
#10

Код:
if(strcmp("/givecash",true,9) == 0)
{
  new tmp[256], idx;
  tmp = strtok(params,idx);
  if(!strlen(tmp))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
    return true;
  }
  new pid = strval(tmp);
  if(!IsPlayerConnected(pid))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Incorrect playerid.");
    return true;
  }
  tmp = strtok(params,idx);
  if(!strlen(tmp))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
    return true;
  }

  if(GetPlayerMoney(playerid) < strval(tmp))
  {
    SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
    return true;
  }
  new amount = strval(tmp), string[256], string1[256], pname2[MAX_PLAYER_NAME];
  GetPlayerName(playerid, pname2, sizeof(pname2));
  if(amount <= 0) return SendClientMessage(playerid, 0xFF3333AA, "Invalid amount to send.");
  format(string, sizeof(string), "%s sent you $%d", pname2, amount);
  format(string1, sizeof(string1), "You sent %s, $%d", pname2, amount);
  SendClientMessage(pid,0x33AA33AA, string);
  SendClientMessage(playerid,0x33AA33AA, string1);
  GivePlayerMoney(pid, amount);
  GivePlayerMoney(playerid, -amount);
  return true;
}
Reply


Messages In This Thread
help to Create things - by rong13 - 25.09.2009, 19:54
Re: help to Create things - by Desert - 25.09.2009, 20:05
Re: help to Create things - by rong13 - 25.09.2009, 20:49
Re: help to Create things - by MenaceX^ - 25.09.2009, 20:54
Re: help to Create things - by Desert - 25.09.2009, 20:56
Re: help to Create things - by rong13 - 25.09.2009, 22:23
Re: help to Create things - by rong13 - 26.09.2009, 04:48
Re: help to Create things - by Desert - 26.09.2009, 09:14
Re: help to Create things - by rong13 - 26.09.2009, 10:13
Re: help to Create things - by Desert - 26.09.2009, 11:21

Forum Jump:


Users browsing this thread: 1 Guest(s)