15.11.2010, 14:50
(
Последний раз редактировалось mmrk; 15.11.2010 в 17:06.
Причина: cmdtext -> params
)
Don't know if this will work..
pawn Код:
COMMAND:makeadmin(playerid,params[])
{
new
player[MAX_PLAYER_NAME],
giveplayer[MAX_PLAYER_NAME],
giveplayerid,
level,
string[128]
;
if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xE60000FF, "You are not a lead admin!");
if (sscanf(params, "ui", giveplayerid, level)) return SendClientMessage(playerid, Crvena, "USAGE: /makeadmin [playerid] [level]"), SendClientMessage(playerid, Crvena, "FUNCTION: Player will be an admin.");
if (!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "* Player is not connected.");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, player, sizeof(player));
PlayerInfo[giveplayerid][AdminLvl] = level;
printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level, player);
SendClientMessage(giveplayerid, 0x00C2ECFF, string);
format(string, sizeof(string), "You have given %s level %d admin.",giveplayer, PlayerInfo[giveplayerid][AdminLvl]);
SendClientMessage(playerid, 0x00C2ECFF, string);
return 1;
}