13.11.2013, 19:08
pawn Код:
COMMAND:removecash(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= LEVEL_givecash)
{
new player, amount;
if(sscanf(params, "ui", player, amount))
{
GameTextForPlayer(playerid, "~g~/removecash ~w~<id/name> <amount>", 3000, 3);
return 1;
}
if(IsPlayerConnected(player) && player != INVALID_PLAYER_ID)
{
new string[128];
format(string,sizeof(string),"%s(%d) has remove $%d of your cash", GetName(playerid), playerid, amount);
SendClientMessage(player, GREY, string);
format(string,sizeof(string),"You removed %s(%d) cash of $%d", GetName(player), player, amount);
SendClientMessage(playerid, GREY, string);
GivePlayerMoney(player, -amount);
}
else
{
GameTextForPlayer(playerid, "~r~Player is unavailable", 3000, 3);
}
}
else
{
SendClientMessage(playerid, RED, NO_PERM);
}
return 1;
}