Raised This Month: $ Target: $400
 0% 

Getting pev_iuser* on FM_SetModel


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 04-19-2013 , 11:56   Getting pev_iuser* on FM_SetModel
Reply With Quote #1

On deploy of a weapon, I set this on the weapon after some conditions:

PHP Code:
new iWeapon give_item(id"weapon_deagle")

set_pev(iWeaponpev_iuser11
This gets well called and remains always on the weapon. I debugged it already, all fine till here.

But in SetModel, if I drop the weapon, I check it like this:

PHP Code:
if(pev_valid(iEnt) && equal(szModel"models/w_m249.mdl")) 
Also fine, debugged it. But after the next check, it just always returns me false.

PHP Code:
if(pev(iEntpev_iuser1)) 
Somehow, instead of using pev_iuser1, I tried to use pev_owner, and that worked just fine. Has anyone got an idea?

EDIT: btw, If I pick the weapon up, and I hooked the deploy of it, pev_iuser1 returns me 1.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.

Last edited by bibu; 04-19-2013 at 11:57.
bibu is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 04-19-2013 , 12:07   Re: Getting pev_iuser* on FM_SetModel
Reply With Quote #2

I guess weapons uses iuser integer?
__________________
Retired.
Xalus is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 04-19-2013 , 12:14   Re: Getting pev_iuser* on FM_SetModel
Reply With Quote #3

pev_fuser is float and pev_iuser int
.Dare Devil. is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 04-19-2013 , 12:33   Re: Getting pev_iuser* on FM_SetModel
Reply With Quote #4

if(pev(iEnt, pev_iuser1)) returns zero

Example:

PHP Code:
public FM_Hook_SetModelpEntity, const szModel[ ] )
{
    new 
iId CSW_DEAGLE;
    
    
iId pevpEntitypev_iuser1) )
    
    
client_print0print_chat"%d"iId );

__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
bibu
Veteran Member
Join Date: Sep 2010
Old 04-19-2013 , 12:38   Re: Getting pev_iuser* on FM_SetModel
Reply With Quote #5

And why only in SetModel it returns 0 and returns 1 in deploy?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 04-19-2013 , 12:40   Re: Getting pev_iuser* on FM_SetModel
Reply With Quote #6

deploy return weapon index
__________________

Last edited by Bos93; 04-19-2013 at 12:41.
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 04-19-2013 , 12:41   Re: Getting pev_iuser* on FM_SetModel
Reply With Quote #7

Isn't it used by something else that resets it to zero?
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-19-2013 , 16:07   Re: Getting pev_iuser* on FM_SetModel
Reply With Quote #8

SetModel is called on the weaponbox entity, not the actual weapon entity.
__________________
Arkshine is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 04-19-2013 , 16:12   Re: Getting pev_iuser* on FM_SetModel
Reply With Quote #9

Quote:
Originally Posted by Arkshine View Post
not the actual weapon entity.
So how can I get this then?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 04-19-2013 , 16:44   Re: Getting pev_iuser* on FM_SetModel
Reply With Quote #10

I'd try using these offsets:
Code:
stock const m_rgpPlayerItems_CWeaponBox[6] = { 34 , 35 , ... }
__________________
Currently busy working on a very large scale anime database project.

Last edited by Backstabnoob; 04-19-2013 at 16:44.
Backstabnoob is offline
Reply



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 07:22.


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