Sign in to follow this  
Followers 0
Jumpy

Give weapon by trigger script?

7 posts in this topic

I have this code for giving a weapon:

special()
{
trig = getEnt( "special_trig","targetname"); 
trig waittill ("trigger", player); 
		
while(1)
 {
 player GiveWeapon( "deserteagle_mp" ); 
 player giveMaxAmmo( "deserteagle_mp" );  
		
 }

}

Whenever I press USE my CoD4 freezes for 2 seconds and then I get the weapon. Can someone help me? I want so it would give me a weapon without freezing my game like in the map coyote. Thank you :D !

 

(Question off topic: I can't see my hintstrings anymore. Like the text that appears when I write in the Entity window. I remember I was messing with stuff in the console to fix lag. Is there a command or something for that?  ,aybe I turned off something?)

 
 
 
0

Share this post


Link to post
Share on other sites

Are you using trigger_use? 

 

Are there any errors?

I am suing trigger_use_touch

0

Share this post


Link to post
Share on other sites

Because of the while(1) loop

But how do I do so that I can still get the weapon if I die? Becasue if I die I can't get the weapon again...

0

Share this post


Link to post
Share on other sites

move dis "trig waittill ("trigger", player);" to the start of the loop and you're fine

0

Share this post


Link to post
Share on other sites


special()

{

trig = getEnt( "special_trig", "targetname" );

for(;;)

{

trig waittill( "trigger", player );

player giveWeapon( "deserteagle_mp" );

player giveMaxAmmo( "deserteagle_mp" );

player switchToWeapon( "deserteagle_mp" );

}

}

0

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0