Command bug
#1

When i try to send money to other player it says you don't have enought money, and if i type number more than i have this player going to lose all his money...
Код:
CMD:givecash(playerid,params[])
{
   new
   id,
   amount,
   l_string[77],
   name[25];
   if(sscanf(params,"ui",id,amount)) return SendClientMessage(playerid,-1,"/givecash [id] [amount]");
   if(GetPlayerMoney(playerid) < amount || GetPlayerMoney(playerid) <= 0)return SendClientMessage(playerid,RED,"You don't have enought cash");
   if(id == playerid) return SendClientMessage(playerid,RED,"You can't give money to yourself.");
   GivePlayerMoney(playerid,-amount);
   GivePlayerMoney(id,amount);
   GetPlayerName(playerid,name,25);
   format(l_string,128,"%s has given to you the amount of cash: %i",name,amount);
   SendClientMessage(id,0x33CCFFAA,l_string);
   return 1;
}
Reply


Messages In This Thread
Command bug - by Mijata - 16.11.2016, 17:49
Re: Command bug - by DTV - 16.11.2016, 19:18
Re: Command bug - by Mijata - 17.11.2016, 18:06
Re: Command bug - by SickAttack - 17.11.2016, 18:17
Re: Command bug - by Yaa - 17.11.2016, 18:35
Re: Command bug - by SickAttack - 17.11.2016, 18:37
Re: Command bug - by oMa37 - 17.11.2016, 18:37
Re: Command bug - by GoldenLion - 17.11.2016, 18:39
Re: Command bug - by SickAttack - 17.11.2016, 18:41
Re: Command bug - by GoldenLion - 17.11.2016, 18:44

Forum Jump:


Users browsing this thread: 5 Guest(s)