Problem With /givemoney +rep [Please Help Me :( ]
#5

this should work

PHP код:
CMD:givemoney(playerid,params[]) {
    new 
moneys,giveplayerid,giveplayer[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME],string[128];
    if (
sscanf(params"ud",giveplayeridmoneys)) return SendClientMessage(playeridCOLOR_LIGHTBLUE"{FF9900}[USAGE]:- {FFFFFF}/givemoney {FFFF00}[playerid] [amount]");
//    if (!IsNumeric(giveplayerid)) giveplayerid = ReturnPlayerID(giveplayerid);
    
if (IsPlayerConnected(giveplayerid)) {
        
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer)); GetPlayerName(playeridsendernamesizeof(sendername));
        new 
cash[2]; cash[0] = GetPlayerMoney(playerid); cash[1] = GetPlayerMoney(giveplayerid);
        if (
moneys && cash[0] >= moneys) {
            
GivePlayerMoney(playeridcash[0]-moneys);
            
GivePlayerMoney(giveplayerid,cash[1]+moneys);
            
format(stringsizeof(string), "{FFFFFF}You Have Sent {FFFF00}%s [%d], {33CC33}$%d"giveplayer,giveplayeridmoneys);
            
SendClientMessage(playeridCOLOR_GREENstring);
            
format(stringsizeof(string), "{FFFFFF}You have received {33CC33}$%d {FFFFFF}From {FFFF00}%s [%d]"moneyssendernameplayerid);
            
SendClientMessage(giveplayeridCOLOR_GREENstring);
            
printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendernameplayeridmoneysgiveplayergiveplayerid);
        }
        else {
            
SendClientMessage(playeridCOLOR_BRIGHTRED"{FF9900}[BANK]:- {FFFFFF}Invalid transaction amount");
        }
    }
    else {
        
format(stringsizeof(string), "{FFFF00}[ID:%d] {FFFFFF}Player not connected!"giveplayerid);
        
SendClientMessage(playeridCOLOR_BRIGHTREDstring);
    }
    return 
1;

Reply


Messages In This Thread
Problem With /givemoney [SOLVED] - by TitanZ - 01.11.2015, 05:47
Re: Problem With /givemoney +rep - by iKarim - 01.11.2015, 05:51
Re: Problem With /givemoney +rep [Please Help Me :( ] - by Karan007 - 01.11.2015, 05:53
Re: Problem With /givemoney +rep [Please Help Me :( ] - by TitanZ - 01.11.2015, 05:55
Re: Problem With /givemoney +rep [Please Help Me :( ] - by jlalt - 01.11.2015, 05:55
Re: Problem With /givemoney +rep [Please Help Me :( ] - by TitanZ - 01.11.2015, 06:14
Re: Problem With /givemoney +rep [Please Help Me :( ] - by TitanZ - 01.11.2015, 06:23
Re: Problem With /givemoney +rep [Please Help Me :( ] - by TitanZ - 26.11.2015, 08:13

Forum Jump:


Users browsing this thread: 1 Guest(s)