Raised This Month: $51 Target: $400
 12% 

[core] Player's cur. weap. info update meth. should be impr.


  
 
 
Thread Tools Display Modes
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 06-27-2006 , 11:32   Re: [core] Player's cur. weap. info update meth. should be impr.
#21

Concerning to the topic tittle - there is also something to do when You are using the "give_item" function.
If I got correctly how the HLSDK messages work about current weapons etc - once the player fire a bullet the message is sent he has some new amount of ammo and what the weapon he just keeps in his hand. So when You use give_item and You are spawning the weapon in the hand of the player (for example he_arena plugin) there is really no message sent to say the player is using. So - for normal weapons - after one bullet firing You get the message about the weapon and ammo the player has, but if it's some of grenades - You don't have any info (I mean if it's used the way he_arena plugin works). So that's why the bots fail a lot with nades when this plugin works (I've debugged and traced podbot mm code and my bots still were believing they have some primary weapons in their hand instead nades). As always - I'm expecting someone says it's my code which is wrong...
BTW - nice desing of the new forum, Bail.
__________________
The Fullpack of podbot mm V3B22 - 24 apr 2012!!! is available here.
The All-In-One 3.2a package - 02 jun 2013 (AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available here.
KWo is offline
BAILOPAN
Join Date: Jan 2004
Old 06-28-2006 , 05:49   Re: [core] Player's cur. weap. info update meth. should be impr.
#22

I decided to add this as a "hidden native." I.e., it's available, but it's not documented.

The syntax is:
Code:
native amxx_setpl_curweap(player, curweaponId);

Paste that into the top of your code to use the native. I prefer something like this not become mainstream. It probably won't work in 1.75, however. It was too late an addition to make it into the final builds.
__________________
egg

Last edited by BAILOPAN; 06-28-2006 at 06:56.
BAILOPAN is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-28-2006 , 22:11   Re: [core] Player's cur. weap. info update meth. should be impr.
#23

Wanted to report I am also having issues with "strip_user_weapons"

If I use it and then try to give someone a pistol then a shield the shield wont work fomr some reason and I cannot pick one up from the ground either. Oh well I will just go back to my code of forcing people to drop thier weapons.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 06-29-2006 , 00:30   Re: [core] Player's cur. weap. info update meth. should be impr.
#24

jtp I actually had the issue with the not able to pick up weapons too And I've also had the issue of picking up 2 weapons :/
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
OneEyed
AMX Mod X Beta Tester
Join Date: Jun 2005
Old 06-29-2006 , 01:12   Re: [core] Player's cur. weap. info update meth. should be impr.
#25

I played around with this, cause it was haunting me before, and I just worked around it (I was lazy). So I decided to rework it and see whats going on..

VEN is right about player->current not getting set correctly. It's mostly the mod's fault, but for instance....

I forced a game_player_equip entity to give nothing to players. So you spawn with no weapons or knife.

Then I give the knife manually; I check if I don't have it with get_user_weapon and if I don't have it I give the knife using give_item(id, "weapon_knife"). Next, I killed myself and respawned with no weapons. Checked get_user_weapon and it returns CSW_KNIFE when I do not have a weapon_knife.

My current fix for this is just using strip_user_weapons after the player dies and I respawn them. It resets the player->current value.

Just my 2 cents.
__________________

Last edited by OneEyed; 06-29-2006 at 01:27.
OneEyed is offline
BAILOPAN
Join Date: Jan 2004
Old 06-29-2006 , 02:02   Re: [core] Player's cur. weap. info update meth. should be impr.
#26

(geesu, jtp) CPlayer::current really has nothing to do with the problems you're describing. it's just an internal marker for AMX Mod X, and its results are only meaningful wrt get_user_weapon(). strip_user_weapons() makes sure this value is 0, however.
__________________
egg

Last edited by BAILOPAN; 06-29-2006 at 02:31.
BAILOPAN is offline
 



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:45.


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