/GIVECASH PROBLEM
#3

PHP код:
ReturnName(playeridunderscore=1// by Emmet_
{
    static
        
name[MAX_PLAYER_NAME 1];
    
GetPlayerName(playeridnamesizeof(name));
    if (!
underscore) {
        for (new 
0len strlen(name); len++) {
            if (
name[i] == '_'name[i] = ' ';
        }
    }
    return 
name;
}
CMD:givecash(playeridparams[])
{
    new 
useridamountstr[128];
    if (!
sscanf(params"ui"useridarmount))
        return 
SendClientMessage(playerid, -1"usage: /givecash [playerid/name] [amount]");
        
    if (
userid == playerid || !IsPlayerConnected(userid) || !IsPlayerConnected(playerid))
        return 
SendClientMessage(playerid, -1"error: You have entered an invalid playerid/name!");
        
    if (
amount || amount GetPlayerMoney(playerid))
        return 
SendClientMessage(playerid, -1"error: You have entered an invalid amount!");
        
    
GivePlayerMoney(playerid, -amount);
    
GivePlayerMoney(useridamount);
    
    
format(strsizeof(str), "info: You have received $%i from %s."amountReturnName(playerid0));
    
SendClientMessage(userid, -1str);
    
    
format(strsizeof(str), "info: You have given $%i from %s."amountReturnName(userid0));
    
SendClientMessage(playerid, -1str);
    
retrun 1;

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)