Solved.
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(fine, 4, cmdtext);
    return 0;
}

dcmd_fine(playerid, params[])
{
    new id,
    amount,
    reason[128],
    playername[MAX_PLAYER_NAME];
    if (sscanf(params, "idz", id, amount, reason)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/fine <playerid> <amount> <reason>\""), 1;
    if ( ! IsPlayerConnected(id) ) return 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, -amount);
        SendClientMessageToAll(0xFF0000AA, reason);
        SendClientMessage(playerid, 0xFF0000AA, "Player Fined");
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Solved. - by Ace_Menace - 29.06.2009, 20:47
Re: [Help] Need Help with my Indentation! - by James_Alex - 29.06.2009, 20:50
Re: [Help] Need Help with my Indentation! - by dice7 - 29.06.2009, 20:52
Re: [Help] Need Help with my Indentation! - by Ace_Menace - 29.06.2009, 21:03
Re: [Help] Need Help with my Indentation! - by dice7 - 29.06.2009, 21:03
Solved - by Ace_Menace - 30.06.2009, 02:57

Forum Jump:


Users browsing this thread: 2 Guest(s)