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.
__________________