dcmd_givecash < sending wrong message
#1

This is my command givecash and when I sen someone $5000 it shows $2 or $0. Anyway, it's wrong and I don't know what's causing it, the money increases with 5000 but it shows the wrong message.

pawn Код:
dcmd_givecash(playerid, params[])
{
    new amount, str[128];
    if(sscanf(params, "ud", giveplayerid, amount)) return SystemMessage(playerid, "USAGE: /givecash [playername/id] [amount]");
    if(!IsPlayerConnected(giveplayerid) || giveplayerid == playerid) return SystemMessage(playerid, "This player is not active.");
    if(amount < 1 || amount > GetPlayerMoney(playerid)) return SystemMessage(playerid, "Invalid amount.");
    GetName(playerid, playername);
    GetName(giveplayerid, giveplayer);
    GivePlayerMoney(playerid, -amount);
    GivePlayerMoney(giveplayerid, amount);
    format(str, sizeof(str), "You have given $%d to %s.", amount, giveplayer, giveplayerid);
    SystemMessage(playerid, str);
    format(str, sizeof(str), "%s has given you $%d.", playername, playerid, amount);
    SystemMessage(giveplayerid, str);
    return 1;
}
Reply


Messages In This Thread
dcmd_givecash < sending wrong message - by Andy_McKinley - 27.03.2010, 08:31
Re: dcmd_givecash < sending wrong message - by Sebago[X] - 27.03.2010, 08:45
Re: dcmd_givecash < sending wrong message - by Andy_McKinley - 27.03.2010, 08:47
Re: dcmd_givecash < sending wrong message - by cessil - 27.03.2010, 08:52
Re: dcmd_givecash < sending wrong message - by Andy_McKinley - 27.03.2010, 08:58
Re: dcmd_givecash < sending wrong message - by Burridge - 27.03.2010, 09:02
Re: dcmd_givecash < sending wrong message - by jamesbond007 - 27.03.2010, 09:04
Re: dcmd_givecash < sending wrong message - by jamesbond007 - 27.03.2010, 09:07

Forum Jump:


Users browsing this thread: 2 Guest(s)