| closedHow to change Bullet of Clip |
| Started by netmad on 09-18-2009, 12:33 PM |
Threads: 5
Joined: May 2009
example: MG42 one Clip have 250 bullets, how to change 300bullets?rn Tompson 30bullets in Clip , change 100 bullets?
Threads: 103
Joined: May 2005
not something i have time to do at the moment, but for anyone else...nnclip ammo is pdata offset 108, and youd have to hook the spawning of the weapon as well as when the reload is complete (ReloadDone msg) and check to make sure they have the extra ammo available in their Backpack, then change the clip ammo value and remove the extra added ammo from the backpack..
Threads: 59
Joined: Jan 2007
Use these functions:rnrn
rn// =================================================================================================rn// Update clip function written by Wilson from dodplugins.netrn// =================================================================================================rnpublic set_clip(id,const weapon[],clip) {rnrn new currentent = -1, gunid = 0rnrn // get originrn new Float:origin[3];rn entity_get_vector(id,EV_VEC_origin,origin);rn rn while((currentent = find_ent_in_sphere(currentent,origin,Float:1.0)) != 0) {rn new classname[32];rn entity_get_string(currentent,EV_SZ_classname,classname,31);rn rn if(equal(classname,weapon))rn gunid = currententrn rn }rn rn set_pdata_int(gunid,108,clip,4); // set their ammorn rn return PLUGIN_CONTINUErn}rnrnrnAnd to set the amount for the clip use this:rnrnrngive_item(id,"weapon_webley")rn set_clip(id, "weapon_webley",999)rnrnrnMore information on how to set a clip can be found here:rnhttps://www.dodplugins.net/forums/showthread.php?t=230&highlight=pdataThreads: 5
Joined: May 2009
public dod_setmaxclip( id ) {rn switch( dod_get_user_class(id) )rn {rn case DODC_BAZOOKA:rn {rn rn }rn case DODC_PANZERJAGER:rn {rn rn }rn case DODC_PIAT:rn {rn rn }rn case DODC_GARAND:rn {rn rn }rn case DODC_CARBINE:rn {rn rn }rn case DODC_THOMPSON:rn {rn rn set_clip(id, "weapon_thompson",71);rn rn }rn case DODC_GREASE:rn {rn rn }rn case DODC_BAR:rn {rn rn }rn case DODC_SNIPER:rn {rn rn }rn case DODC_KAR:rn {rn rn }rn case DODC_K43:rn {rn rn }rn case DODC_MP40:rn {rn rn }rn case DODC_MP44:rn {rn rn }rn case DODC_SCHARFSCHUTZE:rn {rn rn }rn case DODC_FG42:rn {rn rn }rn case DODC_MG42:rn {rn set_clip(id, "weapon_mg42",500);rn }rn case DODC_30CAL:rn {rn set_clip(id, "weapon_30cal",333);rn }rn case DODC_MG34:rn {rn rn }rn case DODC_ENFIELD:rn {rn rn }rn case DODC_STEN:rn {rn rn rn rn }rn case DODC_BREN:rn {rn rn }rn rn }rn return PLUGIN_CONTINUE;rn}rnrnthis code can compile,but use it maxclip no change , why?
Threads: 75
Joined: Nov 2007
Paste it wrapped with PHP tags next time :) Iam glad your are trying to code yourself tho. Look at how other plugins are build, and dont forget the set_clip function in your code. There is alot of tutorials around, look at them, good luck.
Threads: 5
Joined: May 2009
I already add set_clip function in my code, but have nothing changed. who used set_clip?
Threads: 103
Joined: May 2005
do you have anything calling the dod_setmaxclip(id) function?
Threads: 5
Joined: May 2009
Can U tell me, how to correct calling this function ?

