29.08.2010, 18:26
can any on turn this in to a warn script and after 5 warnings it bans them
Код:
if(strcmp(cmd, "/setadmin", true) == 0 || strcmp(cmd, "/makeadmin", true) == 0) { new player[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][Admin] < 7) return SendClientMessage(playerid, RED, "You Have To Be A Level 7 Admin To Use This!"); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadmin or /makeadmin [playerid] [AdminLevel]"); giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); new level = strval(tmp); if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID."); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, player, sizeof(player)); PlayerInfo[giveplayerid][Admin] = level; printf("Admin %s made %s a level %d admin.", player, giveplayer, level); format(string, sizeof(string), "Admin \"%s\" has set your Admin Level to %d.",player, level); SendClientMessage(giveplayerid, COLOR_GREEN, string); format(string, sizeof(string), "You have given \"%s\" level %d admin.", giveplayer, PlayerInfo[giveplayerid][Admin]); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); return 1; }