Raised This Month: $ Target: $400
 0% 

Not Dropping


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The Specialist
BANNED
Join Date: Nov 2006
Old 11-23-2006 , 00:52   Not Dropping
Reply With Quote #1

I made this plugin to increase the velocity of a weapon the entity_owner drops . and use register touch to do damage. but this wont allow me to drop any weapons . and theres no run time errors in my logs . any ideas ?
Code:
#include <amxmodx> #include <amxmisc> #include <engine> // Global Variables new g_Throw; public plugin_init() {     register_plugin("Throw Weapons","0.1","The Specialist");     g_Throw = register_cvar("tw_switch","1");     register_clcmd("drop","throw_weapon");     register_touch("Ent","player","throw_damage"); } public throw_weapon(id) {     // if pcvar is off then end fucntion         if(get_pcvar_num(g_Throw)==0)     {         return PLUGIN_HANDLED;     }else{         new name[33];                 get_user_name(id,name,32)                 new index = get_user_index(name);                 // find the weapon thrown by owner                 new Ent = find_ent_by_owner(index ,"weapon",id);                 // set the veocit yof the userrs weapon                 entity_set_string(Ent,EV_VEC_velocity,"10000")     }     return PLUGIN_HANDLED; } public throw_damage(id) {     // if user health is larger then damage then fakedamge         if(get_user_health(id) > 25 )     {         // deal fakedamge                 fakedamage(id,"weapon_awp",float(read_data(2)),DMG_CLUB &&  DMG_BLAST )         return;     }else{         // if user has less health then he dies         user_kill(id);     }     return; }
The Specialist is offline
Send a message via AIM to The Specialist
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-23-2006 , 01:04   Re: Not Dropping
Reply With Quote #2

because you return plugin_handled, this will block that clcmd
use return;
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-23-2006 , 01:20   Re: Not Dropping
Reply With Quote #3

kool. i can drop but no velocity increase on hte weapon i drop. or any fakedamge done. Is there something wrong with the way i set the velocity ?
The Specialist is offline
Send a message via AIM to The Specialist
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-23-2006 , 01:24   Re: Not Dropping
Reply With Quote #4

new name[33];
get_user_name(id,name,32)
new index = get_user_index(name);
id = index, so three lines above is useless.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-23-2006 , 01:50   Re: Not Dropping
Reply With Quote #5

hmmm. still no increase in velocity . nay ideas why the weapon isnt speeding up on drop ? am i getting the ent index right?
Code:
#include <amxmodx> #include <amxmisc> #include <engine> // Global Variables new g_Throw; public plugin_init() {     register_plugin("Throw Weapons","0.1","The Specialist");     g_Throw = register_cvar("tw_switch","1");     register_clcmd("drop","throw_weapon");     register_touch("Ent","player","throw_damage"); } public throw_weapon(id) {     // if pcvar is off then end fucntion         if(get_pcvar_num(g_Throw)==1)     {                 // find the weapon thrown by owner                 new Ent = find_ent_by_owner(id,"weapon",id);                 // set the veocit yof the userrs weapon                 entity_set_string(Ent,EV_VEC_velocity,"1000")     }     return; } public throw_damage(id) {     // if user health is larger then damage then fakedamge         if(get_user_health(id) > 25 )     {         // deal fakedamge                 fakedamage(id,"weapon_awp",float(25),DMG_CLUB &&  DMG_BLAST )         return;     }else{         // if user has less health then he dies         user_kill(id);     }     return; }

Last edited by The Specialist; 11-23-2006 at 02:36.
The Specialist is offline
Send a message via AIM to The Specialist
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-23-2006 , 02:41   Re: Not Dropping
Reply With Quote #6

hooking command drop is a forward, maybe that time the weapon actually not dropped, so you can block it. i don't know the detail. maybe you should add a delay.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 11-23-2006 , 10:51   Re: Not Dropping
Reply With Quote #7

entity_set_string(Ent,EV_VEC_velocity,"1000")
this should be an vector not a string

this could be improved:
fakedamage(id,"weapon_awp",float(25),DMG_CLUB && DMG_BLAST )
to:
fakedamage(id, "weapon_awp", 25.0, (DMG_CLUB | DMG_BLAST))
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-23-2006 , 11:46   Re: Not Dropping
Reply With Quote #8

thanks Peanut ++karma
The Specialist is offline
Send a message via AIM to The Specialist
Reply


Thread Tools
Display Modes

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 07:01.


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