AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   dod_set_user_ammo current clip (https://forums.alliedmods.net/showthread.php?t=50446)

meiao 01-26-2007 14:56

dod_set_user_ammo current clip
 
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?

teame06 01-26-2007 15:10

Re: dod_set_user_ammo current clip
 
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.

meiao 01-26-2007 20:00

Re: dod_set_user_ammo current clip
 
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.

teame06 01-26-2007 20:10

Re: dod_set_user_ammo current clip
 
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


All times are GMT -4. The time now is 22:26.

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