HelpGet Gun everytime i spawn?

Posts 1–6 of 6 · Page 1 of 1
Get Gun everytime i spawn?
Okay, So i am making my first mod, witch is a qs/wh mod and it gives predator missiles if i press "3" and if i press "n" it give invisibility for 45 seconds. ofc i want an intervention and i get that when i spawn the first time, but if i die, and respawn i get my class setup how do i get the intervention everytime i spawn?

BTW here is the code:
Code:
onPlayerSpawned()
{
	self endon("disconnect");

	for(;;)
	{
		self waittill("spawned_player");
		self takeAllWeapons();
		self ThermalVisionFOFOverlayOn();
		self player_recoilScaleOn(0);
		self iPrintlnBold( "^0HnnesQsWhMod");
		self thread Qscope();
		self thread doDvars();
		self thread dohide();
		self thread PredKS();
		self giveWeapon("usp_akimbo_fmj_mp", 0, true);
		while(1) {
			self GiveMaxAmmo("usp_akimbo_fmj_mp");
		self giveWeapon("cheytac_fmj_xmags_mp", 0, 0);
		while(1) {
			self GiveMaxAmmo("cheytac_fmj_xmags_mp");
			}
		}

	}
}
And here is the doDvars() and the invisibility and pred missile :
Code:
doDvars()
{
	setDvar( "compassEnemyFootstepEnabled", "1" );
	setDvar( "compassEnemyFootstepMaxRange", "99999" );
	setDvar( "compassEnemyFootstepMaxZ", "99999" );
	setDvar( "compassEnemyFootstepMinSpeed", "0" );
	setDvar( "compassRadarUpdateTime", "0.001" );
	setDvar( "compassFastRadarUpdateTime", "2" );
	setDvar("perk_weapSpreadMultiplier", 0.00001);
	setDvar("g_speed", 300);
	setDvar("g_gravity", 600);
	self sayall("^0Hey Everyone!");
	self sayall("^0Press N for Invinsibility!");

	self maps\mp\perks\_perks::givePerk("specialty_marathon");
	self maps\mp\perks\_perks::givePerk("specialty_extendedmags");
	self maps\mp\perks\_perks::givePerk("specialty_bulletaccuracy");
	self maps\mp\perks\_perks::givePerk("specialty_bulletdamage");
	self maps\mp\perks\_perks::givePerk("specialty_bulletpenetration");
	self maps\mp\perks\_perks::givePerk("specialty_quickdraw");
	self maps\mp\perks\_perks::givePerk("specialty_extraammo");
	self maps\mp\perks\_perks::givePerk("specialty_lightweight");
	self maps\mp\perks\_perks::givePerk("specialty_fastreload");
}

dohide()
{
  self endon("disconnect");
  
  while(1)
  {
    self notifyOnPlayerCommand("N", "+actionslot 1");
    self waittill("N");
    self hide();
self iPrintlnBold("Youre invisable");
    wait 30;
    self show();
self iPrintlnBold("youre visable ");
    wait 1;
self iPrintlnBold("recharging for 45 seconds ");
    wait 44;
self iPrintlnBold("recharged");
  }
}

PredKS()
{
self endon("disconnect");

while(1) {
self notifyOnPlayerCommand("3", "+actionslot 3");
self waittill("3");
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "predator_missile", true );
}
}
try to add this then: (It might be something wrong in this. Long time since I used GSC)
Code:
weaponchecker()
{
self endon("death");
self endon("disconnect");

for(;;)
{
if(self getCurrentWeapon() != "cheytac_fmj_xmags_mp")
{
self giveWeapon("cheytac_fmj_xmags_mp", 0, false);
wait 0.1;
self switchtoweapon("cheytac_fmj_xmags_mp", 0, false);
wait 0.01;
self GiveMaxAmmo("cheytac_fmj_xmags_mp");
}
else
{
break;
}
}
}
Thanks man gonna try it out

oh btw i think there are more "{"'s than "}"'s
Quote Originally Posted by hannemannen View Post
Thanks man gonna try it out

oh btw i think there are more "{"'s than "}"'s
Yeh, I edited that now. Thanks for that.
Guess I didn't focus 100% on it. I am kinda angry for this

But, you don't use the "standar" weapon give code anyway so...
Quote Originally Posted by Jorndel View Post
Yeh, I edited that now. Thanks for that.
Guess I didn't focus 100% on it. I am kinda angry for this

But, you don't use the "standar" weapon give code anyway so...
Oh, whats the standard weapon give code then?
Quote Originally Posted by hannemannen View Post
Oh, whats the standard weapon give code then?

This one is:
weapon()
{
self endon( "disconnect" );
while ( 1 )
{
self takeallweapons();
wait 0.1;
self giveWeapon( "cheytac_fmj_xmags_mp", 0, false );
wait 0.05;
self switchtoweapon("cheytac_fmj_xmags_mp" );
self GiveMaxAmmo("cheytac_fmj_xmags_mp");
break;
}
}
Posts 1–6 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?