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

[Solved] Get user current weapon in Module.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 11-16-2013 , 07:06   [Solved] Get user current weapon in Module.
Reply With Quote #1

Hi, how to convert this amxx code into c++?
PHP Code:
    static buttonflagweapon
    button 
pev(idpev_button)
    
flag pev(idpev_flags)
    
weapon get_user_weapon(id)
    
    if((
weapon == CSW_KNIFE) && (button IN_DUCK) && (button IN_JUMP) && !(flag FL_ONGROUND) && (fJetpackFuel[id] > 0.0)) 
I mean the get_user_weapon() native.

I tried this, but give error on compile:
PHP Code:
if( (pPlayer->current == 29 ) && pPlayer -> v.button IN_DUCK && pPlayer  -> v.button IN_JUMP && !( pPlayer -> v.flags &  FL_ONGROUND ) && fJetpackFuel[id] > 
Visual Studio error:
Code:
	1	IntelliSense: class "edict_s" has no member "current"
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 11-16-2013 at 08:09. Reason: Solved.
yokomo is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 11-16-2013 , 07:13   Re: [Help] Get user current weapon in Module.
Reply With Quote #2

Try to see the main AMXx Source codes, search the native and look how it's done, and by the way, the structure "editct_s" doesn't have any member (variable inside it) called "current"
TheDS1337 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-16-2013 , 07:45   Re: [Help] Get user current weapon in Module.
Reply With Quote #3

Don't forget to check AMXX API. You have some functions which retrieves player's informations.
__________________
Arkshine is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 11-16-2013 , 08:08   Re: [Solved] Get user current weapon in Module.
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
Don't forget to check AMXX API. You have some functions which retrieves player's informations.
Yes you are right, finally found it:
PHP Code:
if( (MF_GetPlayerCurweapon(id) == 29) && pPlayer -> v.button IN_DUCK && pPlayer  -> v.button IN_JUMP && !( pPlayer -> v.flags &  FL_ONGROUND ) && fJetpackFuel[id] > 
Thanks.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo 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 19:27.


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