/GIVECASH PROBLEM
#5

PHP код:
CMD:givecash(playeridparams[])
{
    new 
playeramount,name1[24], name2[24], string[128];
    if(!
sscanf(params"ui",player,amount))
    {
        if(
playerid != player)
        {
            if(
GetPlayerMoney(playerid) >= amount)
            {
                
GetPlayerName(playeridname124);
                
GetPlayerName(playername224);
                
format(stringsizeof(string), "* You send $%d to %s",amount,name2);
                
SendClientMessage(playeridCOLOR_GREY2string);
                
format(stringsizeof(string), "* You have received $%d from %s"amountname1);
                
SendClientMessage(playerCOLOR_GREY2string);
                
GivePlayerMoney(playerid, -amount);
                
GivePlayerMoney(playeramount);
                                return 
1;
            }
            else {
            
format(stringsizeof(string), "* Sorry, invalid transaction... you dont have $%d!",amount);
        return 
SendClientMessage(playeridCOLOR_ERROR_YELLOWstring);}
        }
        else return 
SendClientMessage(playeridCOLOR_ERROR_YELLOW,"* Sorry, you cannot give cash to yourself!");
    }
    else {
    
SendClientMessage(playeridCOLOR_ERROR_YELLOW,"** Usage: /givecash <PlayerID/PlayerName> <MoneyAmount>");
     return 
SendClientMessage(playeridCOLOR_ERROR_YELLOW,"* Gives the specified amount of your money to the player specified.");}

Reply


Messages In This Thread
/GIVECASH PROBLEM - by AwokenNeoX - 31.10.2015, 13:54
AW: /GIVECASH PROBLEM - by AwokenNeoX - 31.10.2015, 14:10
Re: /GIVECASH PROBLEM - by thaKing - 31.10.2015, 14:10
AW: /GIVECASH PROBLEM - by AwokenNeoX - 31.10.2015, 14:19
Re: /GIVECASH PROBLEM - by Matess - 31.10.2015, 14:30
AW: /GIVECASH PROBLEM - by AwokenNeoX - 31.10.2015, 14:37

Forum Jump:


Users browsing this thread: 1 Guest(s)