Raised This Month: $ Target: $400
 0% 

dod_set_user_ammo current clip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
meiao
New Member
Join Date: Jan 2007
Old 01-26-2007 , 14:56   dod_set_user_ammo current clip
Reply With Quote #1

I was trying to use this function dod_set_user_ammo. Does affects only stock clip ammo really or do I have to something special.

What I tried to do was:
dod_set_user_ammo(id, DODW_xxx, 0)
but this left the current clip with all its remaining bullets.

Is there a way so I can take out all the bullets, including this current clip?
meiao is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 01-26-2007 , 15:10   Re: dod_set_user_ammo current clip
Reply With Quote #2

Was pulled from http://forums.alliedmods.net/showthread.php?t=44403 plugin. Since this is a offset patch. Then this will be OS specific. I'm not too sure which OS this offset was found on but it was probably windows. IIRC I don't think Wilson [29th ID] had access to a linux server to verify the offset for linux server.

Code:
// Set current clip (not backpack ammo) stock set_clip(id,const weapon[],clip) {     new currentent = -1, gunid = 0     // get origin     new Float:origin[3];     entity_get_vector(id,EV_VEC_origin,origin);         while((currentent = find_ent_in_sphere(currentent,origin,Float:1.0)) != 0) {         new classname[32];         entity_get_string(currentent,EV_SZ_classname,classname,31);             if(equal(classname,weapon))             gunid = currentent         }         set_pdata_int(gunid,108,clip); // set their ammo         return PLUGIN_CONTINUE }

Ps. http://www.dodplugins.net are all the DoD specific forums for DoD plugins etc.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
meiao
New Member
Join Date: Jan 2007
Old 01-26-2007 , 20:00   Re: dod_set_user_ammo current clip
Reply With Quote #3

Thanks for the response.

From what I see on the documentation, there is a fourth parameter to set_pdata_int which deals about the offset.
I think it'll work on Linux allright.
meiao is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 01-26-2007 , 20:10   Re: dod_set_user_ammo current clip
Reply With Quote #4

The fourth parameter of set_pdata_int deals with the linux offset but it deals with the difference. So you need to try to use a find offset plugin or something to verify the offset on linux. Then you can use the difference in the 4 parameter of set_pdata_int
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
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 22:26.


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