Raised This Month: $ Target: $400
 0% 

A Few Questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 10-09-2004 , 01:38   A Few Questions
Reply With Quote #1

1) Is this correct to get a players weapons and check if they are all correct? (wep_ok does the checking)
Code:
public check_wep(id) {     new weapons[32]     new numWeapons,i,weapon,j     get_user_weapons(id,weapons,numWeapons)     for(i=0;i<numWeapons;i++)     {         new alright         alright = wep_ok(id,weapons[i],i)         if(alright != -1)         {             strip_user_weapons(id)             for(j=0;j<numWeapons;j++)             {                 if(alright != j)                     give_coitem(id,weapon[j])             }             check_wep(id)         }                         } }

2) Is there an event I can register which happens when a player picks up a defuse kit or nightvision?

3) How do I give a C4?

Thanks in advance.
__________________
twistedeuphoria is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 10-09-2004 , 06:14  
Reply With Quote #2

1) it looks right but i would rather suggest this:
Code:
public check_wep(id){     new weapons[32], alright[32]     new numWeapons,i     get_user_weapons(id,weapons,numWeapons)     for( i = 0; i < numWeapons; i++ ){         alright[i] = wep_ok(id,weapons[i],i)     }     strip_user_weapons(id)     for( i = 0; i < numWeapons; i++ ){         if(alright[i] != -1){             give_coitem(id,weapons[i])  // should not this be weapons[i] ?         }     } }
eg: if u have 15 weaps and 5 are not allowed
yours does
- gets weaps, first not allowed, stripp all weaps, give 14 weaps, call func again
- gets weaps, next is allowed
- next not allowed, stripp all weaps, give 13 weaps, call func again ...

the above does:
- gets weaps, check which are allowed, stripp all weaps, give only allowed weaps

with give_coitem(id,weapid) i think u pass the id of the weapon to this function check which weap it is and then use give_item(id,<weap name>) , right?
__________________
alias White Panther
karlos is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 10-09-2004 , 10:04  
Reply With Quote #3

Oh yeah that's great, thanks. Yeah, give_coitem is just give_item with a few other little things.

Well #1 & #2 are taken care of but anyone know how to give the C4 with give_item? Also how do you give a knife?

One more, if I were to register Death event could I strip_user_weapons the dead one to prevent them from dropping weapons?
__________________
twistedeuphoria is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 10-09-2004 , 11:52  
Reply With Quote #4

well, not to sure about the strip weapons of a dead guy.... testing would be a good option... anyways isn't C4 considered a weapon?
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-09-2004 , 12:43  
Reply With Quote #5

weapon_knife is a knife
weapon_c4 is the C4
item_thighpack is a defusal kit
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 10-09-2004 , 13:28  
Reply With Quote #6

Thanks avalanche. Registering strip_user_weapons to Deathmsg doesn't seem to work.
__________________
twistedeuphoria is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode