Raised This Month: $ Target: $400
 0% 

Catch Nade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr. AWPster
Member
Join Date: Sep 2004
Location: basement
Old 07-13-2005 , 15:35   Catch Nade
Reply With Quote #1

I am trying to get this plugin working under AMX Mod X.

I've done...
Code:
#include <VexdUM> #include <VexdUM_stock>
to
Code:
#include <engine>

Code:
new ent = find_entity_sphere(-1, origin, 100.0)         while(ent > 0)         {             new tempent = find_entity_sphere(ent, origin, 100.0)
to
Code:
new ent = find_ent_in_sphere(-1,origin,100.0)         while(ent > 0)         {             new tempent = find_ent_in_sphere(ent,origin,100.0)

Compiles fine, but doesn't function in gameplay.

I think it is something to do with find_ent_in_sphere.

The original plugin is found at
http://djeyl.net/forum/index.php?showtopic=40632

Code:
#include <amxmod> #include <amxmisc> #include <engine> public plugin_init() {     register_plugin("Catch Nades", "0.1.2", "KRoT@L")     register_cvar("amx_catchnades", "1")     register_cvar("amx_catchnades_team", "0")     return PLUGIN_CONTINUE } public client_prethink(id) {     if(get_cvar_num("amx_catchnades") == 0)         return PLUGIN_CONTINUE     if(get_user_button(id) & IN_USE)     {           new owner         new catchnades_team = get_cvar_num("amx_catchnades_team")         new Float:origin[3]         entity_get_vector(id, EV_VEC_origin, origin)         new ent = find_ent_in_sphere(-1,origin,100.0)         while(ent > 0)         {             new tempent = find_ent_in_sphere(ent,origin,100.0)             new model[32]             entity_get_string(ent, EV_SZ_model, model, 31)             if(equal(model, "models/w_hegrenade.mdl"))             {                 owner = entity_get_edict(ent, EV_ENT_owner)                 if(owner != id && (catchnades_team == 0 || (catchnades_team == 1 && get_user_team(id) == get_user_team(owner))))                 {                     remove_entity(ent)                     give_item(id, "weapon_hegrenade")                 }             }             else if(equal(model, "models/w_flashbang.mdl"))             {                 owner = entity_get_edict(ent, EV_ENT_owner)                 if(owner != id && (catchnades_team == 0 || (catchnades_team == 1 && get_user_team(id) == get_user_team(owner))))                 {                     remove_entity(ent)                     give_item(id, "weapon_flashbang")                 }             }             else if(equal(model, "models/w_smokegrenade.mdl"))             {                 owner = entity_get_edict(ent, EV_ENT_owner)                 if(owner != id && (catchnades_team == 0 || (catchnades_team == 1 && get_user_team(id) == get_user_team(owner))))                 {                     remove_entity(ent)                     give_item(id, "weapon_smokegrenade")                 }             }             ent = tempent         }     }     return PLUGIN_CONTINUE }

Any help is appreciated...
Mr. AWPster is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 07-13-2005 , 15:50   hmm
Reply With Quote #2

give_item was in fun.inc I thought, try including <fun>
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Mr. AWPster
Member
Join Date: Sep 2004
Location: basement
Old 07-13-2005 , 16:06  
Reply With Quote #3

Nope.
Mr. AWPster is offline
WaZZeR++
Veteran Member
Join Date: Mar 2005
Location: Sweden
Old 07-13-2005 , 16:35  
Reply With Quote #4

try to change this:
#include <amxmod>
#include <amxmisc>
#include <engine>
to:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>

you didnt get any erros on give item because you included amxmod and not amxmodx, try to change to amxmodx and compile...
WaZZeR++ is offline
Send a message via MSN to WaZZeR++
Mr. AWPster
Member
Join Date: Sep 2004
Location: basement
Old 07-13-2005 , 16:49  
Reply With Quote #5

Quote:
Originally Posted by WaZZeR++
try to change this:
#include <amxmod>
#include <amxmisc>
#include <engine>
to:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>

you didnt get any erros on give item because you included amxmod and not amxmodx, try to change to amxmodx and compile...
I actually have already tried it. Compiles fine, but doesn't work.
Mr. AWPster is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 07-13-2005 , 16:59  
Reply With Quote #6

LOL public client_PreThink(id)..... P and T need to be capitalized.
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Mr. AWPster
Member
Join Date: Sep 2004
Location: basement
Old 07-13-2005 , 17:17  
Reply With Quote #7

Getting closer...

The only problem is I cannot pick up "live" grenades thrown by people. I can pickup grenades that have been pre-spawned on the map with +use.
Mr. AWPster is offline
Mr. AWPster
Member
Join Date: Sep 2004
Location: basement
Old 07-13-2005 , 17:51  
Reply With Quote #8

Can someone one continue from here?
Attached Files
File Type: sma Get Plugin or Get Source (catch_nades.sma - 841 views - 2.4 KB)
Mr. AWPster is offline
VanillA Ice
Senior Member
Join Date: Apr 2005
Old 07-14-2005 , 02:57  
Reply With Quote #9

I cant but i ahve to say asweome idea.......

but you could take a look at the dod code (how i dk) and see if (out of hours of code) you could find out how they make the players pick up gernades since they are both half life mods.....
__________________
I can no longer help here......school has started... :/ goodbye everybody :'(
VanillA Ice is offline
Send a message via MSN to VanillA Ice Send a message via Yahoo to VanillA Ice
Isobold
Veteran Member
Join Date: Mar 2004
Old 07-14-2005 , 07:56  
Reply With Quote #10

bad idea ...
Isobold is offline
Reply



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 11:30.


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