Raised This Month: $ Target: $400
 0% 

explotion dont works ( dont appear)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Porta0123
Member
Join Date: Apr 2014
Location: Spain
Old 07-01-2014 , 12:06   explotion dont works ( dont appear)
Reply With Quote #1

hi, i was making one class for my server but when i go to test it, the cass appear but the weapons explotion no :/

code:
Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <engine> #include <fakemeta> #include <CodMod> #include <sockets> #include <CStrike> #include <ColorChat> #include <fun> #define VERSION "1.0" #define AUTHOR "Porta0123" new const nazwaH[] = "Balas explosiva[PREMIUM]"; //nombre new const opisH[] = "Tus balas explotan(1/5)"; //descripcción new const bronieH = 1<<CSW_M4A1 new const zdrowieH = 20; //vida new const kondycjaH = 10; //condición new const inteligencjaH = 10; //inteligencia new const wytrzymaloscH = 10; //fuerza new sprite_explode new bool:ma_explosive[33] = false public plugin_precache() {     sprite_explode = precache_model("sprites/zerogxplode.spr") } public plugin_init() {     register_plugin(nazwaH, VERSION, AUTHOR)     cod_register_class(nazwaH, opisH, bronieH, zdrowieH, kondycjaH, inteligencjaH, wytrzymaloscH)     RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_m4a1", "fw_primer_atake", 1) } public cod_class_enabled(id) {     if(get_user_flags(id) & ADMIN_LEVEL_H)     {         ma_explosive[id] = true         client_print_color(id, BLUE, "%s by Porta0123",nazwaH)     }     else     {         ma_explosive[id] = false         client_print_color(id,RED, "no puedes usar esta clase")     } }  public fw_primer_atake(atack)   {         if(is_user_connected(atack) && ma_explosive[atack] == true)     {                       new origin_nuevo[3]         get_user_origin(atack, origin_nuevo, 3)                                   message_begin(MSG_BROADCAST, SVC_TEMPENTITY, origin_nuevo)         write_byte(TE_EXPLOSION)                     write_coord(origin_nuevo [0])         write_coord(origin_nuevo [1])         write_coord(origin_nuevo [2])         write_short(sprite_explode)                   write_byte(90)                     write_byte(0)                     write_byte(0)         message_end()         }   }

i search in my server /logs/ but i cant found it and in server console too...

Last edited by Porta0123; 07-01-2014 at 12:07.
Porta0123 is offline
Porta0123
Member
Join Date: Apr 2014
Location: Spain
Old 07-01-2014 , 14:59   Re: explotion dont works ( dont appear)
Reply With Quote #2

fixed

the solution if you have the same problem

Code:
new id = pev(atack, pev_owner)

and then
Code:
    if(is_user_connected(id) && ma_explosive[id] == true)     {                       new origin_nuevo[3]         get_user_origin(id, origin_nuevo, 3)                                   message_begin(MSG_BROADCAST, SVC_TEMPENTITY, origin_nuevo)         write_byte(TE_EXPLOSION)                     write_coord(origin_nuevo [0])         write_coord(origin_nuevo [1])         write_coord(origin_nuevo [2])         write_short(sprite_explode)                   write_byte(90)                     write_byte(0)                     write_byte(0)         message_end()         }   }
Porta0123 is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viña del Mar, Chile
Old 07-02-2014 , 02:42   Re: explotion dont works ( dont appear)
Reply With Quote #3

The first param on any Ham forward will be the entity that you passed at the 2nd argument on the callback declaration

PHP Code:
RegisterHam(Ham_Weapon_PrimaryAttack"weapon_m4a1""fw_primer_atake"1
In this case it would be a "weapon_m4a1" entity (CM4A1 Class). This at the most times would be player, but not all.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
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 21:10.


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