AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help With Event problem (https://forums.alliedmods.net/showthread.php?t=28010)

Fender 05-05-2006 00:58

Help With Event problem
 
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 :oops:

v3x 05-05-2006 01:04

Whole code, please. Thanks.

Fender 05-05-2006 01:08

1 Attachment(s)
Here it is, its a edited version of one of your plugins.

commonbullet 05-05-2006 02:05

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).

Fender 05-05-2006 02:14

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.

FatalisDK 05-05-2006 11:35

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; }*/

Fender 05-05-2006 16:13

haha thank you. :P Im watching so more army movie, to see if i finish updating it. Looking for weapons that push you back when you shoot.


All times are GMT -4. The time now is 05:10.

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