ItsMods

Full Version: New to Modding and need help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
so i've started modding some pretty basic stuff and i'm a bit stuck. I want to limit the attacking team to 3 - 4 players. Also when a person joins a certin team they get a certin weapon. If you could post the code i would be so grateful

I've looked at some tutorials on here but there was nothing about these kind of stuff
Not sure but i think it is
(Used in console)
Code:
maxclients 3

then restart the game
Code:
Map_restart
or just put it in the mod
Code:
maxclients 3


doesnt that make max players in the game 3? What i ment was like one team max of 3 players the other 9 or 10
Yer that would set the max players to only 3 xD
forgot about that
im a believe of not just spoon feeding you but pointing you in the right direction.

Check when they join team, check how many are on that team, if over the limit, force to other team. Check when they spawn, check team, take all weapons and give certain weapons. Wala
Quote:im a believe of not just spoon feeding you but pointing you in the right direction.

well thanks Killingdyl but im stuck and i do not know where to start so could u mabye give a little bit of code?


Edit: Is this correct?
Code:
if ( self.pers["team"] == game["axis_teamset"] ) {
               self takeAllWeapons();
               self giveWeapon( "M14_mp", 0, false );
Should be put under onPlayerSpawned:
Code:
doPlayerCount()
{
    attack = 0;
    defend = 0;
    for(i = 0; i < level.players.size; i++) {
        if(level.players[i].pers["team"] == game["defenders"])
            defend++;
        if(level.players[i].pers["team"] == game["attackers"])
            attack++;
    }
}

That should guide you a little, figure out the rest.