Need Cmd Uninviteall - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need Cmd Uninviteall (
/showthread.php?tid=625390)
Need Cmd Uninviteall -
DandyCorleone - 01.01.2017
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;
}
Re: Need Cmd Uninviteall - iLearner - 01.01.2017
You sure the command you posted above to uninvite 1 player works? You probably tested it with 1 players.... Otherwise it wouldn't.
Re: Need Cmd Uninviteall -
DandyCorleone - 01.01.2017
its work bro, but i want reset all factions
or this commands for all faction kick
PHP код:
CMD:fackick(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pFactionModerator] >= 1)
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /fackick [playerid]");
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[giveplayerid][pMember] >= 1 || PlayerInfo[giveplayerid][pLeader] >= 1)
{
format(string, sizeof(string), "You have been faction-kicked, by %s.", GetPlayerNameEx( playerid ));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pTeam] = TEAM_GREEN;
gTeam[giveplayerid] = PlayerInfo[giveplayerid][pTeam];
PlayerInfo[giveplayerid][pMember] = 0;
PlayerInfo[giveplayerid][pRank] = 0;
PlayerInfo[giveplayerid][pChar] = 0;
PlayerInfo[giveplayerid][pDuty] = 0;
PlayerInfo[giveplayerid][pLeader] = 0;
PlayerInfo[giveplayerid][pDivision] = 0;
if(!IsValidSkin(GetPlayerSkin(giveplayerid)))
{
new rand = random(sizeof(CIV));
SetPlayerSkin(giveplayerid,CIV[rand]);
PlayerInfo[giveplayerid][pModel] = CIV[rand];
}
player_remove_vip_toys(giveplayerid);
pTazer[giveplayerid] = 0;
SetPlayerToTeamColor(giveplayerid);
format(string, sizeof(string), "You have faction-kicked %s.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_WHITE, string);
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "You can't kick someone from a faction if they're not a member.");
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified..");
}
}
return 1;
}