Код:
CMD:fine(playerid, params[])
{
new
finedid,
amount,
reason;
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if (!sscanf(params, "ii", finedid, amount, reason))
{
if (finedid != INVALID_PLAYER_ID)
{
new
message[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new finedname[MAX_PLAYER_NAME];
GetPlayerName(finedid, finedname, sizeof(name));
new tempcash;
GetPlayerMoney(finedid);
GivePlayerMoney(finedid, tempcash-amount);
format(message, sizeof(message), "%s was fined $%d. Reason: %s ", finedname, amount, reason);
SendClientMessageToAll(COLOR_ANNOUNCE, message);
}
else SendClientMessage(playerid, COLOR_SYSTEM, "[SYSTEM] That player is not connected");
}
else SendClientMessage(playerid, COLOR_SYSTEM, "[SYSTEM] /fine [id] [amount] [reason]");
}
else SendClientMessage(playerid, COLOR_SYSTEM, "[SYSTEM] Your not authorized to use this command! ");
return 1;
}
It fines the correct amount and displays the message as: