01.01.2017, 07:20
hi... bro, can help me? i need cmd /ouninviteall, for uninvite all players from factions.
PHP код:
CMD:ouninvite(playerid, params[]) {
if (PlayerInfo[playerid][pLeader] >= 1 || PlayerInfo[playerid][pAdmin] >= 7) {
if(isnull(params)) {
return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /uninvite [name]");
}
if(!doesAccountExist(params)) {
return SendClientMessageEx(playerid, COLOR_WHITE, "That account does not exist!");
}
OnPlayerOfflineLogin(params);
if(PlayerInfo[MAX_PLAYERS][pAdmin] >= 4 || PlayerInfo[MAX_PLAYERS][pFactionModerator] == 1) {
return SendClientMessageEx(playerid, COLOR_WHITE, "You can not uninvite this person.");
}
else if ((PlayerInfo[MAX_PLAYERS][pMember] == PlayerInfo[playerid][pLeader]) && (PlayerInfo[MAX_PLAYERS][pLeader] == 0 || PlayerInfo[MAX_PLAYERS][pRank] < PlayerInfo[playerid][pRank])) {
PlayerInfo[MAX_PLAYERS][pMember] = 0;
PlayerInfo[MAX_PLAYERS][pRank] = 0;
PlayerInfo[MAX_PLAYERS][pChar] = 0;
PlayerInfo[MAX_PLAYERS][pDuty] = 0;
PlayerInfo[MAX_PLAYERS][pLeader] = 0;
if(!IsValidSkin(PlayerInfo[MAX_PLAYERS][pModel])) {
PlayerInfo[MAX_PLAYERS][pModel] = CIV[random(sizeof(CIV))];
}
if(PlayerInfo[MAX_PLAYERS][pDonateRank] < 3) for(new iToyIter; iToyIter < MAX_PLAYER_ATTACHED_OBJECTS; ++iToyIter) {
for(new LoopRapist; LoopRapist < sizeof(HoldingObjectsCop); ++LoopRapist) {
if(HoldingObjectsCop[LoopRapist][holdingmodelid] == PlayerToyInfo[MAX_PLAYERS][iToyIter][ptModelID]) {
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptModelID] = 0;
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptBone] = 0;
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosX] = 0.0;
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosY] = 0.0;
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosZ] = 0.0;
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosX] = 0.0;
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosY] = 0.0;
PlayerToyInfo[MAX_PLAYERS][iToyIter][ptPosZ] = 0.0;
}
}
}
new
szMessage[36 + MAX_PLAYER_NAME];
format(szMessage, sizeof(szMessage), "You have kicked %s from the faction.", params);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
OnPlayerOfflineSave(params);
}
else SendClientMessageEx(playerid, COLOR_WHITE, "That player can not be uninvited by you.");
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only leaders can do this.");
return 1;
}