ItsMods

Full Version: stopping certain people spawning in rounds
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
any sort of dvar or something i can prevent certain players spawning in sd for a round or so?
Not sure about how you could stop them spawning, but the very frame that they spawn, you could send them to spectator/different team/kill them.

Code:
init()
{
    level thread spawndvar();
}

spawndvar()
{
    if(getdvarint("scr_nospawn") == "")
    {
        setdvar("scr_nospawn", 0);
    }
}

onPlayerSpawned()
{
    self waittill("spawned_player");
    
    if(getdvarint("scr_nospawn") == 1)
        self suicide();   //   (or change team/put to spectate/whatever)
}

You'd have to edit it a little bit to make it work with certain players, just set the dvar to the players entity number, and when it checks the dvar check it against their entity number.
ya i thought about doing it this way, was just hoping there was some dvar to stop people spawning in sd..


guess it will do for now, thanks anyways.
(07-27-2011, 15:39)koil Wrote: [ -> ]any sort of dvar or something i can prevent certain players spawning in sd for a round or so?

this spawn a player:
Code:
self thread    [[level.spawnPlayer]]();

find this code on _globallogic_spawn.gsc and modify like this:
Code:
if(self.canspawn == 1)
{
self thread    [[level.spawnPlayer]]();
} else
{
level waittill("notify"); //or self waittill
self thread    [[level.spawnPlayer]]();
}
(07-28-2011, 00:47)Puffiamo Wrote: [ -> ]
(07-27-2011, 15:39)koil Wrote: [ -> ]any sort of dvar or something i can prevent certain players spawning in sd for a round or so?

this spawn a player:
Code:
self thread    [[level.spawnPlayer]]();

find this code on _globallogic_spawn.gsc and modify like this:
Code:
if(self.canspawn == 1)
{
self thread    [[level.spawnPlayer]]();
} else
{
self waittill("notify");
self thread    [[level.spawnPlayer]]();
}

Change self.canspawn to self.pers["canspawn"] , because otherwise it will be lost after 1 round.
if(self.pers["mod_ts"] != 1) {
self thread [[level.spawnPlayer]]();
}
else {
self thread respawn_asSpectator( self.origin + (0, 0, 60), self.angles );
spawnedAsSpectator = true;
}


worked well, thanks man.. I already had my own variable set from another thread, this worked great.