How create gangs.
#2

Depends on how complex you wont this, if your after a gang spawn with gang weapons etc, you will need a way of:

Saving a players current gang e.g.
pawn Code:
new playerGang[MAX_PLAYERS];
Some gang functions:
pawn Code:
giveGangSkinAndWeapons(playerid) {
    switch (playerGang[playerid]) {
        case 1: {
        //Set player to grove skin.
        //Give grove weapons
        }
        case 2: {
        //Set player to another gang skin.
        //Give other gang's weapons
        }
        default: {
        //Default stuff here.
        }
    }
}
And when they type the gang command:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[]) {
        if(!strcmp(cmdtext, "/joingrove", true)) {
        SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to grove!");
        playerGang[playerid] = 1;
        giveGangSkinAndWeapons(playerid);
        return 1;
    }
    if(!strcmp(cmdtext, "/joinother", true)) {
        SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to other!");
        playerGang[playerid] = 2;
        giveGangSkinAndWeapons(playerid);
        return 1;
    }
    return 0;
}
When they disconnect:
pawn Code:
public OnPlayerDisconnect(playerid, reason) {
    playerGang[playerid]=0;
}

When they spawn:
pawn Code:
public OnPlayerSpawn(playerid) {
    giveGangSkinAndWeapons(playerid);
    switch (playerGang[playerid]) {
        case 1: {
            //set them to a spawn position for the gang.
        }
        case 2: {
            //set them to a spawn position for the gang.
        }
        default: {
            //Default stuff here i.e. they aint in any gang yet.
        }
    }
}
This is just a very simple idea/template
Reply


Messages In This Thread
How create gangs. - by Gangster-rocks - 08.06.2012, 06:55
Re: How create gangs. - by Grimrandomer - 08.06.2012, 07:19
Re: How create gangs. - by Gangster-rocks - 08.06.2012, 09:46
Re: How create gangs. - by Gangster-rocks - 08.06.2012, 09:57
Re: How create gangs. - by Niko_boy - 08.06.2012, 10:08
Re: How create gangs. - by Gangster-rocks - 08.06.2012, 10:15
Re: How create gangs. - by Grimrandomer - 08.06.2012, 12:34

Forum Jump:


Users browsing this thread: 5 Guest(s)