26.07.2016, 16:12
PHP код:
CMD:givemoney(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
return 1;
}
new string[128], giveplayerid, money;
if(sscanf(params, "ud", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid/partofname] [money]");
if(IsPlayerConnected(giveplayerid))
{
GivePlayerCash(giveplayerid, money);
format(string, sizeof(string), "You have given %s $%d!",GetPlayerNameEx(giveplayerid),money);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "%s has given %s $%d (via /givemoney)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid),money);
Log("logs/adminmoney.log", string);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
}
return 1;
}

