Raised This Month: $ Target: $400
 0% 

[SOLVED] NS_GET_WEAPON - Useless? Bug? Alternative?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 05-25-2010 , 02:40   [SOLVED] NS_GET_WEAPON - Useless? Bug? Alternative?
Reply With Quote #1

Trying to figure out which weapon the user has selected currently. As in, are they using their pistol? Are they using fade swipe? Are they using parasite? Are they using spit?

This returns some random number only when I kill someone using the gorge/fade.
http://www.amxmodx.org/funcwiki.php?go=func&id=1162
Code:
new spit = ns_get_weapon(iAttacker,WEAPON_SPIT);//gorge weapon new swipe = ns_get_weapon(iAttacker,WEAPON_SWIPE);//fade weapon

also tried

This doesn't return anything.
Code:
new weaponid = 0; ns_get_weapon(iAttacker,weaponid);

also tried

This will always return 1 if I have the weapon available. Even though I kill someone with heal spray, it will say Spit?: 1 if I am the gorge since I do have the wepaon.
http://www.amxmodx.org/doc/index.htm...has_weapon.htm
Code:
new spit = ns_has_weapon(iAttacker,WEAPON_SPIT); new swipe = ns_has_weapon(iAttacker,WEAPON_SWIPE);

-------------
Update:
also tried

Only returns 0.
Code:
register_event("DeathMsg", "client_killed_2", "a") public client_killed_2() {     new Killer = read_data(1) //get the first message parameter     new Victim = read_data(2) //get the second message parameter     new headshot = read_data(3) //was this a headshot?     new weapon[32]     read_data(4, weapon, 31)  //get the weapon name     server_print("Weapon: %d",weapon); }
--------------------
Update #2
......couple hours later and some time away from the computer, I went back to the basics. This is for all those cannot figure out how to compare the users selected weapon with the NS_CONST.inc definitions.

Use this line.
Code:
new weaponid = get_user_weapon(iAttacker);

/feelslikeanewb
__________________


Last edited by mysticssjgoku4; 05-25-2010 at 04:07.
mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
 



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 05:25.


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