06.07.2013, 17:30
Hi guys
i make this CMD
i make this CMD
pawn Код:
CMD:givemoney(playerid, params[])
{
new playerb, amount, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "ui", playerb, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid] [amount]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
PlayerInfo[playerb][pMoney] = PlayerInfo[playerb][pMoney]+amount;
GiveZaiatMoney(playerb, amount);
format(string, sizeof(string), " Administrator %s has given you $%d", RPN(playerid), amount);
SendClientMessage(playerb, COLOR_WHITE, string);
format(string, sizeof(string), "AdmWarn: %s has given %s $%d.", RPN(playerid), RPN(playerb), amount);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/givemoney.log", string);
OnPlayerSave(playerb);
return 1;
}
CMD:setmoney(playerid, params[])
{
new playerb, amount, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(sscanf(params, "ui", playerb, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [playerid] [amount]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
PlayerInfo[playerb][pMoney] = amount;
SetZaiatMoney(playerb, amount);
format(string, sizeof(string), " Administrator %s has set your money to $%d", RPN(playerid), amount);
SendClientMessage(playerb, COLOR_WHITE, string);
format(string, sizeof(string), "AdmWarn: %s has set %s's money to $%d.", RPN(playerid), RPN(playerb), amount);
SendAdminMessage(COLOR_DARKRED, 1, string);
Log("logs/setmoney.log", string);
OnPlayerSave(playerb);
return 1;
}