AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need a fix for dod_drop_grenades (https://forums.alliedmods.net/showthread.php?t=54111)

JUSTSMOKIN 04-17-2007 09:57

Need a fix for dod_drop_grenades
 
1 Attachment(s)
Hello all

I have attached a file called dropnades and i wondered if anyone could fix this to work on Linux so that the nades do actually drop on the ground and you can pick them up can anyone help.

Regards


JS

JUSTSMOKIN 04-17-2007 15:37

Re: Need a fix for dod_drop_grenades
 
I just thought i would try to move this topic to scripting help but i cant but when i click the plugin to dl it says this;-
Plugin failed to compile! Please try contacting the author.Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/compiler3/include//amxmod_compat/VexdUM_stock.inc(19) : error 017: undefined symbol "pev_valid"
/home/groups/amxmodx/compiler3/include//amxmod_compat/VexdUM_stock.inc(20) : warning 203: symbol is never used: "ent"
/home/groups/alliedmodders/forums/files/2/5/6/1/4/15526.attach(241) : error 017: undefined symbol "remove_entities"
/home/groups/alliedmodders/forums/files/2/5/6/1/4/15526.attach(242) : error 017: undefined symbol "remove_entities"
/home/groups/alliedmodders/forums/files/2/5/6/1/4/15526.attach(243) : error 017: undefined symbol "remove_entities"

4 Errors.
Could not locate output file /home/groups/amxmodx/public_html/compiled3/15526.amx (compile failed).

Brad 04-17-2007 21:39

Re: Need a fix for dod_drop_grenades
 
Moved.

Drak 04-17-2007 22:22

Re: Need a fix for dod_drop_grenades
 
Code:
  // Grenade Drops on Death (a.k.a. NadeDrops) 0.14 by Avalanche   //   // When a player dies they will drop the grenades that they had   // with them onto the ground for other players to pick up. The   // grenades play a grenade-bouncing sound when they hit the ground   // and they look just like the real grenades.   //   // mp_nadedrops <0|1> - default 1   // mp_nadedropsounds <0|1> - default 1   #include <amxmodx>   #include <engine>   #include <fun>   #define VOL_LOW 0.2 // volume used to play nade bouncing sound   #define NADE_OFFSET 10 // distance (vaguely) between death origin and nade origin   // DeathMSG   public event_damage(id) {     // if player is still alive or plugin is disabled     if(get_user_health(id) > 0 || get_cvar_num("mp_nadedrops") < 1) {       return PLUGIN_CONTINUE;     }     // if player had HE grenade     if(hasweapon(id,"weapon_hegrenade") > 0) {       new grenade = create_entity("info_target"); // create grenade entity       entity_set_string(grenade,EV_SZ_classname,"fake_hegrenade"); // change name       entity_set_int(grenade,EV_ENT_owner,id); // set owner       entity_set_int(grenade,EV_INT_iuser1,0); // hasn't bounced yet       // set grenade entity's size       new Float:minbox[3] = { -2.5, -2.5, -2.5 }       new Float:maxbox[3] = { 2.5, 2.5, 2.5 };       entity_set_vector(grenade,EV_VEC_mins,minbox);       entity_set_vector(grenade,EV_VEC_maxs,maxbox);       // set grenade's overall being of a whole       entity_set_int(grenade,EV_INT_solid,SOLID_TRIGGER);       entity_set_int(grenade,EV_INT_movetype,MOVETYPE_TOSS);       // set a random angle       new Float:angles[3] = { 0.0, 0.0, 0.0 };       angles[1] = float(random_num(0,180));       entity_set_vector(grenade,EV_VEC_angles,angles);       // get player's origin       new Float:origin[3];       entity_get_vector(id,EV_VEC_origin,origin);       origin[0] += NADE_OFFSET; // offset       // set modle and origin       entity_set_model(grenade,"models/w_hegrenade.mdl");       entity_set_vector(grenade,EV_VEC_origin,origin);     }     // if player had smoke grenade     if(hasweapon(id,"weapon_smokegrenade") > 0) {       new grenade = create_entity("info_target"); // create grenade entity       entity_set_string(grenade,EV_SZ_classname,"fake_smokegrenade"); // change name       entity_set_int(grenade,EV_ENT_owner,id); // set owner       entity_set_int(grenade,EV_INT_iuser1,0); // hasn't bounced yet       // set grenade entity's size       new Float:minbox[3] = { -2.5, -2.5, -2.5 }       new Float:maxbox[3] = { 2.5, 2.5, 2.5 };       entity_set_vector(grenade,EV_VEC_mins,minbox);       entity_set_vector(grenade,EV_VEC_maxs,maxbox);       // set grenade's overall being of a whole       entity_set_int(grenade,EV_INT_solid,SOLID_TRIGGER);       entity_set_int(grenade,EV_INT_movetype,MOVETYPE_TOSS);       // set a random angle       new Float:angles[3] = { 0.0, 0.0, 0.0 };       angles[1] = float(random_num(0,180));       entity_set_vector(grenade,EV_VEC_angles,angles);       // get player's origin       new Float:origin[3];       entity_get_vector(id,EV_VEC_origin,origin);       origin[0] -= NADE_OFFSET; // offset       // set modle and origin       entity_set_model(grenade,"models/w_smokegrenade.mdl");       entity_set_vector(grenade,EV_VEC_origin,origin);     }     // if player had at least one flashbang     if(hasweapon(id,"weapon_flashbang") > 0) {       new grenade = create_entity("info_target"); // create grenade entity       entity_set_string(grenade,EV_SZ_classname,"fake_flashbang"); // change name       entity_set_int(grenade,EV_ENT_owner,id); // set owner       entity_set_int(grenade,EV_INT_iuser1,0); // hasn't bounced yet       // set grenade entity's size       new Float:minbox[3] = { -2.5, -2.5, -2.5 }       new Float:maxbox[3] = { 2.5, 2.5, 2.5 };       entity_set_vector(grenade,EV_VEC_mins,minbox);       entity_set_vector(grenade,EV_VEC_maxs,maxbox);       // set grenade's overall being of a whole       entity_set_int(grenade,EV_INT_solid,SOLID_TRIGGER);       entity_set_int(grenade,EV_INT_movetype,MOVETYPE_TOSS);       // set a random angle       new Float:angles[3] = { 0.0, 0.0, 0.0 };       angles[1] = float(random_num(0,180));       entity_set_vector(grenade,EV_VEC_angles,angles);       // get player's origin       new Float:origin[3];       entity_get_vector(id,EV_VEC_origin,origin);       origin[1] += NADE_OFFSET; // offset       // set modle and origin       entity_set_model(grenade,"models/w_flashbang.mdl");       entity_set_vector(grenade,EV_VEC_origin,origin);     }     // if player had two flashbangs, drop another     if(hasweapon(id,"weapon_flashbang") > 1) {       new grenade = create_entity("info_target"); // create grenade entity       entity_set_string(grenade,EV_SZ_classname,"fake_flashbang"); // change name       entity_set_int(grenade,EV_ENT_owner,id); // set owner       entity_set_int(grenade,EV_INT_iuser1,0); // hasn't bounced yet       // set grenade entity's size       new Float:minbox[3] = { -2.5, -2.5, -2.5 }       new Float:maxbox[3] = { 2.5, 2.5, 2.5 };       entity_set_vector(grenade,EV_VEC_mins,minbox);       entity_set_vector(grenade,EV_VEC_maxs,maxbox);       // set grenade's overall being of a whole       entity_set_int(grenade,EV_INT_solid,SOLID_TRIGGER);       entity_set_int(grenade,EV_INT_movetype,MOVETYPE_TOSS);       // set a random angle       new Float:angles[3] = { 0.0, 0.0, 0.0 };       angles[1] = float(random_num(0,180));       entity_set_vector(grenade,EV_VEC_angles,angles);       // get player's origin       new Float:origin[3];       entity_get_vector(id,EV_VEC_origin,origin);       origin[1] -= NADE_OFFSET; // offset       // set modle and origin       entity_set_model(grenade,"models/w_flashbang.mdl");       entity_set_vector(grenade,EV_VEC_origin,origin);     }     return PLUGIN_CONTINUE;   }   // entity touching   public entity_touch(entity1,entity2) {     if(!is_valid_ent(entity2)) { // invalid toucher       return PLUGIN_CONTINUE;     }     new classname[32];     entity_get_string(entity2,EV_SZ_classname,classname,31); // get name of toucher     new bounced = entity_get_int(entity2,EV_INT_iuser1); // bounced yet?     // check if one of our fake grenades is colliding with world and mp_nadedropsounds is positive     if((equal(classname,"fake_hegrenade") || equal(classname,"fake_flashbang") || equal(classname,"fake_smokegrenade")) && entity1 == 0 && bounced == 0 && get_cvar_num("mp_nadedropsounds") > 0) {       emit_sound(entity2,CHAN_ITEM,"weapons/he_bounce-1.wav",VOL_LOW,ATTN_NORM,0,PITCH_LOW); // play sound       entity_set_int(entity2,EV_INT_iuser1,1); // has bounced       return PLUGIN_CONTINUE;     }     // now check for more invalid entities or players     if(!is_valid_ent(entity1) || !is_valid_ent(entity2) || !is_user_connected(entity2)) {       return PLUGIN_CONTINUE;     }     entity_get_string(entity1,EV_SZ_classname,classname,31); // get name of touched     // if player is touching hegrenade and doesn't have one     if(equal(classname,"fake_hegrenade") && hasweapon(entity2,"weapon_hegrenade") == 0) {       give_item(entity2,"weapon_hegrenade");       remove_entity(entity1);       return PLUGIN_CONTINUE;     }     // if player is touching smokegrenade and doesn't have one     if(equal(classname,"fake_smokegrenade") && hasweapon(entity2,"weapon_smokegrenade") == 0) {       give_item(entity2,"weapon_smokegrenade");       remove_entity(entity1);       return PLUGIN_CONTINUE;     }     // if player is touching flashbang and has room for another     if(equal(classname,"fake_flashbang") && hasweapon(entity2,"weapon_flashbang") < 2) {       give_item(entity2,"weapon_flashbang");       remove_entity(entity1);       return PLUGIN_CONTINUE;     }     return PLUGIN_CONTINUE;   }   // function to check if player has a specific weapon.   // returns the amount of ammo for that weapon in backpack.   // we use this so we can check for multiple flashbangs as well   public hasweapon(id,weaponname[32]) {     if(is_user_connected(id) == 0 || get_user_team(id) > 2) {       return 0;     }     new weapons[32], num;     get_user_weapons(id,weapons,num); // get weapons     new foundweapon; // if we found the weapon yet (and if we did how much ammo for it)     // loop through weapons     for(new i=0;i<num;i++) {       new checkweaponname[32];       get_weaponname(weapons[i],checkweaponname,31);       if(equal(weaponname,checkweaponname)) { // compare names         new clip, ammo; // clip and ammo         get_user_ammo(id,weapons[i],clip,ammo); // get clip and ammo         foundweapon = ammo; // return amount in clip (for multiple FBs)         break;       }     }     return foundweapon;   }   public callremove_nades() {     set_task(5.5, "remove_nades", 55487)   }     public remove_nades() {     new fake_he = find_ent(-1,"fake_hegrenade")     new fake_smoke = find_ent(-1,"fake_smokegrenade");     new fake_flash = find_ent(-1,"fake_flashband");         if(is_valid_ent(fake_he)) remove_entity(fake_he);     if(is_valid_ent(fake_smoke)) remove_entity(fake_smoke);     if(is_valid_ent(fake_flash)) remove_entity(fake_flash)   }     // plugin precache   public plugin_precache() {     precache_model("models/w_hegrenade.mdl");     precache_model("models/w_flashbang.mdl");     precache_model("models/w_smokegrenade.mdl");     precache_sound("weapons/he_bounce-1.wav");   }   // plugin initiation   public plugin_init() {     register_plugin("NadeDrops","0.14","Avalanche");     register_event("Damage","event_damage","b","2!0"); // damage event         register_event("TextMsg","callremove_nades","a","2&#Game_C","2&#Game_w")     register_event("SendAudio","callremove_nades","a","2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw")     register_cvar("mp_nadedrops","1",FCVAR_PRINTABLEONLY); // cvar to disable/enable plugin     register_cvar("mp_nadedropsounds","1",FCVAR_PRINTABLEONLY); // cvar to disable/enable nade drop sounds     // get the mod's name     new modname[32];     get_modname(modname,31);     // if this isn't Counter-Strike     if(!equal(modname,"cstrike")) {       pause("ae"); // lock the plugin     }   }

This might work, I couldn't test it since I don't have the models. Nor did I even look over the code much, but since I see it's made by Avalanche. I would try asking him, he's usually very helpful. (don't kill me D: )

JUSTSMOKIN 04-19-2007 05:24

Re: Need a fix for dod_drop_grenades
 
Ok cool but where do i find avalanche did this plugin compile when you tryed to download it as it wouldn't for me and thanks brad for moving my topic i was dumb agine and didn't post in the right place LMAO

Regards

JS

JUSTSMOKIN 04-24-2007 06:41

Re: Need a fix for dod_drop_grenades
 
can anyone fix this for me please

regards

Blobby

Vet 04-25-2007 20:55

Re: Need a fix for dod_drop_grenades
 
Try THIS ONE. It should do what you want.


All times are GMT -4. The time now is 06:33.

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