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