20.12.2017, 15:59
Try now.
PHP код:
CMD:givecookie(playerid, params[]) // CMD for giving somebody a cookie
{
new str[250], id, cookies;
if(PlayerInfo[playerid][Level] >= 3)
{
if(sscanf(params, "ud", id, cookies)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /givecookie [Player ID] [COOKIES]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_YELLOW, "PlayerID is not connected.");
PlayerInfo[id][Cookies] += cookies;
format(str, sizeof(str), "**Admin %s (ID:%d) has give %d cookie to %s.(ID:%d) and %s cookie count is (%d)",PlayerName2(playerid),playerid, cookies, PlayerName2(id),playerid,PlayerName2(id),PlayerInfo[id][Cookies]);
SendClientMessageToAll(COLOR_ORANGE, str);
GameTextForPlayer(id,"~g~~h~~h~Cookie",3000,4);
format(str, sizeof(str), "**You just gave a cookie to %s.", PlayerName2(id));
SendClientMessage(playerid, COLOR_GREEN, str);
}
else SendClientMessage(playerid, COLOR_YELLOW, "**You're not authorized to use this command.");
return 1;
}