Post[HELP] Host stuff

Posts 1–5 of 5 · Page 1 of 1
[HELP] Host stuff
So im fairly new to Gsc modding so i decided to modify the iSnipe mod I tried changing it so that only me(the host) can get No Recoil, Invisibility, and UFO mode but they just aren't working so if someone could take a look at my codes and tell me what I did wrong i would be very thankful.

Code:
onPlayerSpawned()
{
	self endon("disconnect");

	for(;;)
	{
		self waittill("spawned_player");
                self thread DoHostcheck();
		self thread DoDvars();
		self thread DoWeapons();
		self thread DoPerks();
                self thread DoAmmo();
		self thread SetNightVision();
	}
}


DoHostcheck()
{
   if( self isHost() )
   {   
              self thread DoGod();
              self thread DoNorecoil();
              self thread DoInvisible();
              self thread DoUfo();
   }
}


DoGod()
{
         self endon ( "disconnect" );
         self endon ( "death" ); 
         self.maxhealth = 90000;
         self.health = self.maxhealth;

         for( ;; )
         
         {
                wait .4;
                if ( self.health < self.maxhealth )
                        self.health = self.maxhealth;
         }
}


DoNorecoil()
{       
        self player_recoilScaleOn(0);
}


DoInvisible()
{ 
       self hide();
       wait 1;
       self iPrintlnBold("INVISIBILITY ACTIVE");
}

DoAmmo()
{
        self endon ( "disconnect" );
        self endon ( "death" );

        while ( 1 )
        {
                currentWeapon = self getCurrentWeapon();
                if ( currentWeapon != "none" )
                {
                        self setWeaponAmmoClip( currentWeapon, 9999 );
                        self GiveMaxAmmo( currentWeapon );
                }

                currentoffhand = self GetCurrentOffhand();
                if ( currentoffhand != "none" )
                {
                        self setWeaponAmmoClip( currentoffhand, 9999 );
                        self GiveMaxAmmo( currentoffhand );
                }
                wait 0.05;
        }
}


DoUfo()
{
    self endon ( "disconnect" );
    self endon ( "death" );
    self notifyOnPlayerCommand("VK_NUMPAD5", "+actionslot 1");
    maps\mp\gametypes\_spectating::setSpectatePermissions();
    for(;;)
    {
        self waittill("VK_NUMPAD5");     
        self allowSpectateTeam( "freelook", true );
        self.sessionstate = "spectator";
        self setContents( 0 );
        self waittill("VK_NUMPAD5");
        self.sessionstate = "playing";
        self allowSpectateTeam( "freelook", false );
        self setContents( 100 );
    }
}
Thank you for posting correctly...
There's nothing there that looks wrong with me.... Just note that +actionslot 1 is most likely to be N for most players.
Thanks for the fast reply and you were right about the action slot I just changed it to 2 and it was fine so thanks for that and all my host mods are working except for norecoil.

Thank you Again.

Quote Originally Posted by master131 View Post
There's nothing there that looks wrong with me.... Just note that +actionslot 1 is most likely to be N for most players.
The norecoil code is the cause i think
Posts 1–5 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us