08.09.2016, 21:32
Код:
if(strcmp(cmd, "/setleader", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Function: {FFFFFF}/setleader [ID or Name/Part of name] [Number(1-8)]"); return 1; } new playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); new level = strval(tmp); if(level < 1 || level > 8) { SendClientMessage(playerid, COLOR_GREY, "Function: {FFFFFF}/From [1-8]"); return 1; } if (PlayerInfo[playerid][pAdmin] >= 1337) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { if(PlayerInfo[playa][pMember] > 0) { SendClientMessage(playerid, COLOR_GREY, "That player is in a Faction"); return 1; } GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[playa][pLeader] = level; PlayerInfo[playa][pMember] = level; format(string, sizeof(string), "You Are Now A Faction Leader by Admin %s", sendername); SendClientMessage(playa, COLOR_LIGHTRED, string); format(string, sizeof(string), "You have given %s control to run Faction Number %d", giveplayer,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); if(level == 1) { PlayerInfo[playa][pChar] = 288; PlayerInfo[playa][pRank] = 8; } //Police Force else if(level == 2) { PlayerInfo[playa][pChar] = 286; PlayerInfo[playa][pRank] = 8; } //FBI/ATF else if(level == 3) { PlayerInfo[playa][pChar] = 186; PlayerInfo[playa][pRank] = 8; } //Triads else if(level == 4) { PlayerInfo[playa][pChar] = 111; PlayerInfo[playa][pRank] = 8; } //Bonanno else if(level == 5) { PlayerInfo[playa][pChar] = 113; PlayerInfo[playa][pRank] = 8; } //Salvatore else if(level == 6) { PlayerInfo[playa][pChar] = 294; PlayerInfo[playa][pRank] = 8; } //Hitmans else if(level == 7) { PlayerInfo[playa][pChar] = 61; PlayerInfo[playa][pRank] = 8; } //Taxi Cab Company else if(level == 8) { PlayerInfo[playa][pChar] = 107; PlayerInfo[playa][pRank] = 8; } //424JF Gang SetPlayerSkin(playa, PlayerInfo[playa][pChar]); UpdatePlayerInfo(playa); SetPlayerSpawn(playa); } }//not connected } } return 1; }