ItsMods

Full Version: no weapon on spawn
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
My mod sometimes give players no weapons at spawn and they are invisible as well. They can knife though. I think notify("spawned_player") isn't send either because nothing from what is in onplayerspawned in _rank.gsc happens.
So what are the reasons for which this could happen and how do you fix it?
Use a new/unmodified _rank.gsc.
(08-06-2011, 16:50)Lemon Wrote: [ -> ]Use a new/unmodified _rank.gsc.
So the old unmodified _rank.gsc had the bug in it?
this is probably happening because you have wait commands in ur actual on spawned thread, you need to make new threads to have wait commands in them..


so if it looks like
Code:
onPlayerSpawned()
{
    self setclientdvar("whoami", "^2Caster:^7 " + self.name + "");
    self setclientDvar( "scr_disable_cac", 1 );
    self setclientdvar("shoutlol", "1" );
    self thread waitnosd();
    self endon( "disconnect" );
    while( true )
    {
        self waittill( "spawned_player" );
        
            
        self setclientDvar( "scr_disable_cac", 0 );
        self setclientdvar("shoutlol", "0" );

//here is the problem
                wait 15;
//here is the problem

        self.pers["mod_menuallow"] = true;


change to this


Code:
onPlayerSpawned()
{
    self setclientdvar("whoami", "^2Caster:^7 " + self.name + "");
    self setclientDvar( "scr_disable_cac", 1 );
    self setclientdvar("shoutlol", "1" );
    self thread waitnosd();
    self endon( "disconnect" );
    while( true )
    {
        self waittill( "spawned_player" );
        
            
        self setclientDvar( "scr_disable_cac", 0 );
        self setclientdvar("shoutlol", "0" );

                ///change to something like this

               self thread timedthread1();
Code:
timedthread1()
{
//here is the OLD problem
                wait 15;
//here is the OLD problem

        self.pers["mod_menuallow"] = true;
}


and that should fix it
jep. always use functions at on palyer spawned.
Thanks I'll try it out. Smile
I think the issue was not because of the wait things(though it's nice to know) but because players spawned when they haven't selected a class yet. To fix it put:
Code:
if (maps\mp\gametypes\_globallogic_utils::isValidClass( self.class ))
before the function that spawns the player.
When players havent choosen a class they'll get the default weapons. So M16, ASP,...
^ that... its definitely timers.. unless you have modified CAC
_class::giveLoadout(item); is modifed?
Pages: 1 2