givecash command not working
#3

pawn Код:
dcmd_givecash(playerid,params[])
{
    new
        giveplayerid,
        amount;
    if (sscanf(params, "ud", giveplayerid, amount)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /givecash [id] [amount]");
    else if (giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid ID!");
    else if (GetPlayerMoney(playerid) < amount) return SendClientMessage(playerid, COLOR_RED, "ERROR: Insufficient Funds");
    else
    {
        GivePlayerMoney(giveplayerid, amount);
        GivePlayerMoney(playerid, -amount);
        new string[100];
        format(string, sizeof(string), "%s has sent you $%d", ReturnPlayerName(playerid),amount);
        SendClientMessage(giveplayerid, COLOR_YELLOW, string);
        format(string, sizeof(string),"$%d sent to %s", amount,ReturnPlayerName(giveplayerid));
        SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    return 1;
}
Reply


Messages In This Thread
givecash command not working - by _Vortex - 08.07.2010, 00:19
Re: givecash command not working - by KJ1 - 08.07.2010, 01:04
Re: givecash command not working - by PotH3Ad - 08.07.2010, 01:17
Re: givecash command not working - by [L3th4l] - 08.07.2010, 01:23
Re: givecash command not working - by selten98 - 08.07.2010, 08:14
Re: givecash command not working - by GaGlets(R) - 08.07.2010, 13:19

Forum Jump:


Users browsing this thread: 3 Guest(s)