What to add?
#2

CMD:
pawn Код:
if(!(0 < playerclan[playerid] < MAX_CLANS)) // you're not in clan
else if(clanMembers[playerclan[playerid]][0] != playerid) // you're not clan leader
else if(playerclan[playerid] != playerclan[giveplayerid]) // that player is not in your clan
else{
    PlayerLeaveClan(giveplayerid,playerid);
}
+ replace old function PlayerLeaveClan to

pawn Код:
stock PlayerLeaveClan(playerid,kickerid = INVALID_PLAYER_ID)
{
    new string[256];
    new playername[MAX_PLAYER_NAME];
    new kickername[MAX_PLAYER_NAME];
    new clannum = playerclan[playerid];

    if(clannum > 0)
    {
        for(new i = 0; i < clanInfo[clannum][1]; i++)
            if(clanMembers[clannum][i] == playerid)
            {
                clanInfo[clannum][1]--;
                for(new j = i; j < clanInfo[clannum][1]; j++)
                    clanMembers[clannum][j] = clanMembers[clannum][j+1];

                if(clanInfo[clannum][1] < 1)
                    clanInfo[clannum][0] = clanInfo[clannum][1] = 0;

                for(new j = 0; j < clanInfo[clannum][1]; j++)
                {
                    GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
                    if(kickerid == INVALID_PLAYER_ID)
                        format(string, sizeof(string),"%s has quit your clan.", playername);
                    else{
                        GetPlayerName(kickerid, kickername, MAX_PLAYER_NAME);
                        format(string, sizeof(string),"%s kicks from gang %s", kickername, playername);
                    }

                    SendClientMessage(clanMembers[clannum][j], COLOR_ORANGE, string);
                }
                if(kickerid == INVALID_PLAYER_ID)
                    format(string, sizeof(string),"You have quit the clan '%s' (id: %d)", clanNames[clannum], clannum);
                else{
                    GetPlayerName(kickerid, kickername, MAX_PLAYER_NAME);
                    format(string, sizeof(string),"Clan leader %s kicks you from the gang", kickername);
                }
                SendClientMessage(playerid, COLOR_ORANGE, string);
                playerclan[playerid] = 0;
                SetPlayerColor(playerid,playerColors[playerid]);
                return;
            }

    }else SendClientMessage(playerid, COLOR_RED, "You are not in a clan.");
    return;
}
Reply


Messages In This Thread
What to add? - by RiChArD_A - 04.03.2013, 23:47
Re: What to add? - by Jefff - 05.03.2013, 01:18
Respuesta: Re: What to add? - by RiChArD_A - 05.03.2013, 10:51

Forum Jump:


Users browsing this thread: 1 Guest(s)