31.08.2009, 08:28
Quote:
Originally Posted by MenaceX^
Quote:
|
Код:
if(strcmp(cmdtext, "/makeadmin", true) == 0) { new string[128]; new tmp[256]; new player[MAX_PLAYER_NAME]; new giveplayerid; if(PlayerInfo[playerid][pAdmin] <= 5) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFF00AA, "USAGE: /makeadmin [playerid] [level]"); SendClientMessage(playerid, 0xFFFF00AA, "FUNCTION: Player will be an admin."); return 1; } giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); new level = strval(tmp); if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, player, sizeof(player)); PlayerInfo[playerid][pAdmin] = 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][pAdmin]); SendClientMessage(playerid, 0x00C2ECFF, string); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), "%i is not an active player.", giveplayerid); SendClientMessage(playerid, 0xE60000FF, string); } } else { SendClientMessage(playerid, 0xE60000FF, "You are not a lead admin!"); } return 1; }