[HELP] Admin /fine using DCMD/sscanf
#2

pawn Код:
dcmd_fine(playerid, params[])
{
    new id,
        amount,
        reason[128],
        playername[MAX_PLAYER_NAME];
   
    if (sscanf(params, "uiz", id, amount, reason))
        SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/fine <playerid> <amount> <reason>\"");
    if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
    else
    {
        GetPlayerName(id, playername, MAX_PLAYER_NAME);
        format(reason, 127, "%s has been fined, $%d, for %s", playername, amount, reason);
        GivePlayerMoney(id, -%d);
        SendClientMessageToAll(0xFF0000AA, reason);
        SendClientMessage(0xFF0000AA, "Player Fined");
    }
    return 1;
}
Reply


Messages In This Thread
[HELP] Admin /fine using DCMD/sscanf - by Ace_Menace - 29.06.2009, 01:49
Re: [HELP] Admin /fine using DCMD/sscanf - by pen_theGun - 29.06.2009, 06:40
Re: [HELP] Admin /fine using DCMD/sscanf - by Ace_Menace - 29.06.2009, 08:30
Re: [HELP] Admin /fine using DCMD/sscanf - by pen_theGun - 29.06.2009, 09:27

Forum Jump:


Users browsing this thread: 1 Guest(s)