• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
no weapon on spawn
#1
Bug 
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?
  Reply
#2
Use a new/unmodified _rank.gsc.
  Reply
#3
(08-06-2011, 16:50)Lemon Wrote: Use a new/unmodified _rank.gsc.
So the old unmodified _rank.gsc had the bug in it?
  Reply
#4
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
[-] The following 1 user says Thank You to koil for this post:
  • Cyborgking
  Reply
#5
jep. always use functions at on palyer spawned.
  Reply
#6
Thanks I'll try it out. Smile
  Reply
#7
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.
  Reply
#8
When players havent choosen a class they'll get the default weapons. So M16, ASP,...
  Reply
#9
^ that... its definitely timers.. unless you have modified CAC
  Reply
#10
_class::giveLoadout(item); is modifed?
C++/Obj-C developer. Neko engine wip
Steam: Click
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
Question Help Mw2 weapon skin question FroxIVx4 1 1,427 10-13-2013, 16:54
Last Post: hmann
Question Help Weapon Name iRoNinja 8 2,901 10-08-2013, 08:31
Last Post: iRoNinja
  Mw2 weapon porting? Cuddlyedits 3 2,006 09-15-2013, 16:43
Last Post: DidUknowiPwn
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 16,383 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
Exclamation [Request] Random Weapon At Spawn Scripts18 3 2,095 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Spawn Message Playing on Respawn? Killjoy 7 2,232 07-11-2013, 14:53
Last Post: Killjoy
  Help Mw2 weapon skin question FroxIVx4 1 1,395 07-06-2013, 19:22
Last Post: surtek
  [Release] Spawn Polygons and Pyramids Yamato 6 1,894 06-20-2013, 12:30
Last Post: Yamato
  Question on how to "Spawn" a flying rocket as a player? akillj 8 2,529 06-04-2013, 01:54
Last Post: rotceh_dnih
  [Request] List of all weapon models DidUknowiPwn 3 1,998 04-20-2013, 09:13
Last Post: Dominator56

Forum Jump:


Users browsing this thread: 1 Guest(s)