29.06.2009, 09:27
pawn Код:
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) ) 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;
}