Raised This Month: $ Target: $400
 0% 

How do I call a registered event?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-11-2017 , 09:39   Re: How do I call a registered event?
Reply With Quote #1

write_byte was correct. I'm talking about the 1 from message_begin.

Are you sure you are actually compiling and changing the plugin? Since you removed the last write_byte the server should crash.
__________________

Last edited by HamletEagle; 11-11-2017 at 09:40.
HamletEagle is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-11-2017 , 09:43   Re: How do I call a registered event?
Reply With Quote #2

Quote:
Originally Posted by HamletEagle View Post
write_byte was correct. I'm talking about the 1 from message_begin.

Are you sure you are actually compiling and changing the plugin? Since you removed the last write_byte the server should crash.
Yes I compile and restart the server completely every time.
Right now the clock is still there and nothing on radar:

Code:
public delete_clock(id) { new c4origin[3]; get_user_origin( id, c4origin ); message_begin(MSG_ALL, get_user_msgid("BombDrop"), {0,0,0}) write_byte (c4origin[0]); write_byte (c4origin[1]); write_byte (c4origin[2]); write_byte (1); message_end(); }
suhdude is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-11-2017 , 09:47   Re: How do I call a registered event?
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
write_byte was correct. I'm talking about the 1 from message_begin.

Are you sure you are actually compiling and changing the plugin? Since you removed the last write_byte the server should crash.
Actually this is not important, I have a way bigger problem of the players getting stuck in the bomb on forceplant.
If I only could set mp_roundtime below 1 minute, it would at least match the c4 timer.

Thanks HamletEagle for wanting to help, and sorry if I'm a slow learner.

Last edited by suhdude; 11-11-2017 at 09:53.
suhdude is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-11-2017 , 10:03   Re: How do I call a registered event?
Reply With Quote #4

What is delete_clock? How is it called?
__________________
HamletEagle is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-11-2017 , 10:18   Re: How do I call a registered event?
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
What is delete_clock? How is it called?
Code:
#include <amxmodx> #include <fakemeta> #include <cstrike> #define PLUGIN "Spawnplant" #define VERSION "1.0" #define AUTHOR "NyburgarN" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_event("HLTV", "new_round", "a", "1=0", "2=0"); } stock is_user_in_plant_zone( id ) {     return (cs_get_user_mapzones(id) & CS_MAPZONE_BOMBTARGET) } public new_round() {     new players[32];     new playercount, i;     get_players(players, playercount);     for (i=0; i<playercount; i++)         set_task(0.5,"plant_bomb",players[i]);         set_task(0.5,"delete_clock"); //<-------------------------------------------------------------------------------- Called here     return PLUGIN_CONTINUE; } public plant_bomb(id) {     if ( is_user_in_plant_zone( id ) )     {         client_cmd (id,"say /plant"); //This activates another plugin         client_print( 0, print_center, "#Cstrike_TitlesTXT_Bomb_Planted" );     } }   public delete_clock(id) { new c4origin[3]; get_user_origin( id, c4origin ); message_begin(MSG_ALL, get_user_msgid("BombDrop")) write_byte (c4origin[0]); write_byte (c4origin[1]); write_byte (c4origin[2]); write_byte (1); message_end(); }

Last edited by suhdude; 11-11-2017 at 10:19.
suhdude is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-11-2017 , 12:32   Re: How do I call a registered event?
Reply With Quote #6

delete_clock is not passing any player index.
set_task(0.5,"delete_clock"); -> set_task(0.5,"delete_clock", players[i]);
__________________
HamletEagle is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-11-2017 , 13:05   Re: How do I call a registered event?
Reply With Quote #7

Edit: I got it working with:

Code:
new g_c4timer new mp_c4timer public plugin_init() {     register_event("HLTV", "new_round", "a", "1=0", "2=0");     mp_c4timer  = get_cvar_pointer("mp_c4timer") } public event_hltv()     g_c4timer = get_pcvar_num(mp_c4timer) public change_clock(id) {     message_begin(MSG_ALL, get_user_msgid("RoundTime"))     write_short (g_c4timer);     message_end(); }

Thanks for helping me out HamletEagle!

Last edited by suhdude; 11-11-2017 at 23:21.
suhdude 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 17:19.


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