Raised This Month: $ Target: $400
 0% 

Help With Event problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fender
Junior Member
Join Date: May 2006
Location: de 305
Old 05-05-2006 , 00:58   Help With Event problem
Reply With Quote #1

I need help

Code:
 
register_event("Damage" , "event_damage" , "b" , "2>0")
I inserted that into my plugin, but when i tried to compile it, it didnt work. Is this my problem im using AMXX-Studio and it says Invalid Function Call.

Help Please
__________________
Quote:
Originally Posted by SubStream
wait a day and if it doesn't work take two gaben's and call the doctor in the morning.
Fender is offline
Send a message via AIM to Fender Send a message via MSN to Fender
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-05-2006 , 01:04  
Reply With Quote #2

Whole code, please. Thanks.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Fender
Junior Member
Join Date: May 2006
Location: de 305
Old 05-05-2006 , 01:08  
Reply With Quote #3

Here it is, its a edited version of one of your plugins.
Attached Files
File Type: sma Get Plugin or Get Source (sniperpush.sma - 469 views - 2.0 KB)
__________________
Quote:
Originally Posted by SubStream
wait a day and if it doesn't work take two gaben's and call the doctor in the morning.
Fender is offline
Send a message via AIM to Fender Send a message via MSN to Fender
commonbullet
Veteran Member
Join Date: Oct 2005
Old 05-05-2006 , 02:05  
Reply With Quote #4

The message name in register event is "Damage" and not "Dmg"; use quotes in register_plugin function parameters - they're strings. Remove unused 'defines' (PLUGIN, VERSION, AUTHOR).
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Fender
Junior Member
Join Date: May 2006
Location: de 305
Old 05-05-2006 , 02:14  
Reply With Quote #5

hmm cant you use defines to make the plugin look cleaner? and when i put the quotes on the register_plugin it says invalid function call.


EDIT: Lol, i think its the whole plugin, but ill find it out little by little.
__________________
Quote:
Originally Posted by SubStream
wait a day and if it doesn't work take two gaben's and call the doctor in the morning.
Fender is offline
Send a message via AIM to Fender Send a message via MSN to Fender
FatalisDK
Senior Member
Join Date: Mar 2006
Location: bacon
Old 05-05-2006 , 11:35  
Reply With Quote #6

Fixed a few things for you.

Code:
#include <amxmodx> #include <engine> #include <fun> #define PLUGIN  "Sniper Push" #define VERSION "1.0" #define AUTHOR  "Fender (Original Plugin by V3X, and GHW" /*V3X, and GHW Chronics Pump Back Plugin , Just got the main code, and edited it. Plugin Created by AMXX Studio Gaben is Queen Of America*/ new cvar_sniper_knockback new cvar_sniper_force new cvar_sniper_active public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_event("Damage" , "event_dmg" , "b" , "2>0");         cvar_sniper_active = register_cvar("sniper_active", "1")     cvar_sniper_knockback = register_cvar("sniper_knockback" , "1");     cvar_sniper_force = register_cvar("sniper_force"     , "10"); } public event_dmg(id) {     if(!get_pcvar_num(cvar_sniper_active))         return PLUGIN_CONTINUE;         if(!is_user_alive(id))         return PLUGIN_CONTINUE;         new weapon , attacker = get_user_attacker(id , weapon);         if(!is_user_alive(attacker))         return PLUGIN_CONTINUE;     /*you can change this if you want and add more weapon choices.*/     switch(weapon)     {         case CSW_AWP, CSW_SCOUT, CSW_SG550, CSW_G3SG1:         {             new Float:vec[3];             new Float:oldvelo[3];             get_user_velocity(id, oldvelo);             //create_velocity_vector(id , attacker , vec);             vec[0] += oldvelo[0];             vec[1] += oldvelo[1];             set_user_velocity(id , vec); //oldvelo == vec         }     }         return PLUGIN_CONTINUE; } /* This function is too messed up for me to fix stock create_velocity_vector(victim,attacker,Float:velocity[3]) {     if(!is_user_alive(attacker))         return PLUGIN_CONTINUE;         new Float:attorigin[3];     entity_get_vector(attacker , EV_VEC_origin , attorigin)         new Float:origin2[3]     origin2[0] = vicorigin[0] - attorigin[0];//vicorigin doesnt even exist     origin2[1] = vicorigin[1] - attorigin[1];         new Float:largestnum = 0.0;         if(floatabs(origin2[0])>largestnum) largestnum = floatabs(origin2[0]);     if(floatabs(origin2[1])>largestnum) largestnum = floatabs(origin2[1]);         origin2[0] /= largestnum;     origin2[1] /= largestnum;         velocity[0] = ( origin2[0] * (get_pcvar_float(cvar_sniper_force) * 3000) ) / get_entity_distance(attacker);     if(velocity[0] <= 20.0 || velocity[1] <= 20.0)         velocity[2] = random_float(200.0 , 275.0);         return PLUGIN_HANDLED; }*/
__________________
FatalisDK is offline
Fender
Junior Member
Join Date: May 2006
Location: de 305
Old 05-05-2006 , 16:13  
Reply With Quote #7

haha thank you. Im watching so more army movie, to see if i finish updating it. Looking for weapons that push you back when you shoot.
__________________
Quote:
Originally Posted by SubStream
wait a day and if it doesn't work take two gaben's and call the doctor in the morning.
Fender is offline
Send a message via AIM to Fender Send a message via MSN to Fender
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 05:10.


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