Givecash command bug
#10

Код:
dcmd_gc(playerid, params[])
{
    new giveplayerid, amount,name1[24], name2[24], string[128];
    if(sscanf(params, "ui",giveplayerid,amount)) return  SendClientMessage(playerid, -1,"Usage: /givecash [ID][Amount]");
    if(playerid == giveplayerid) return SendClientMessage(playerid, -1,"You can't pay to yourself.");
    if(GetPlayerMoney(playerid) < amount) return SendClientMessage(playerid, -1,"You don't have that much.");
    GetPlayerName(playerid, name1, 24);
    GetPlayerName(giveplayerid, name2, 24);
    format(string, sizeof(string), "You gave $%d to %s.",amount,name2);
    SendClientMessage(playerid, 0xFFFF00FF, string);
    format(string, sizeof(string), "%s gave you $%d!", name1, amount);
    SendClientMessage(giveplayerid, 0xFFFF00FF, string);
    GivePlayerMoney(playerid, -amount);
    GivePlayerMoney(giveplayerid, amount);
    return 1;
}
@guitarmandanny you had a good start
Reply


Messages In This Thread
Givecash command bug - by Beljulji - 30.10.2012, 22:51
Re: Givecash command bug - by Beljulji - 30.10.2012, 23:31
Re: Givecash command bug - by guitarmandanny - 30.10.2012, 23:38
***** - by Nick.D - 30.10.2012, 23:48
Re: Givecash command bug - by Beljulji - 30.10.2012, 23:57
Re: Givecash command bug - by WizBoy - 31.10.2012, 00:08
Re: Givecash command bug - by guitarmandanny - 31.10.2012, 00:15
Re: Givecash command bug - by Beljulji - 31.10.2012, 00:27
Re: Givecash command bug - by Beljulji - 31.10.2012, 00:30
Re : Re: Givecash command bug - by lelemaster - 31.10.2012, 00:48

Forum Jump:


Users browsing this thread: 2 Guest(s)