Raised This Month: $51 Target: $400
 12% 

How do I call a registered event?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-10-2017 , 12:40   How do I call a registered event?
Reply With Quote #1

[SOLVED]

Code:
register_logevent("logevent_function_p", 3, "2=Planted_The_Bomb")

I want the round timer to be removed, and the c4 timer to appear.
I think this event will do that, but I don't know how to call it. (Beginner)

I use a script that auto plants the bomb, but it does not remove the timer.

Thank you!

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

You do not call events, you hook events. This even is simply called when the bomb is planted, far from what you want to do. To change the timer you need to send a RoundTime message: https://wiki.alliedmods.net/Half-Lif...ents#RoundTime
If you want to hide the timer, then send a BombDrop https://wiki.alliedmods.net/Half-Lif...vents#BombDrop message with Flag = 1.

How to send messages? message_begin + ... + message_end.
__________________

Last edited by HamletEagle; 11-10-2017 at 13:44.
HamletEagle is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-10-2017 , 14:48   Re: How do I call a registered event?
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
You do not call events, you hook events. This even is simply called when the bomb is planted, far from what you want to do. To change the timer you need to send a RoundTime message: https://wiki.alliedmods.net/Half-Lif...ents#RoundTime
If you want to hide the timer, then send a BombDrop https://wiki.alliedmods.net/Half-Lif...vents#BombDrop message with Flag = 1.

How to send messages? message_begin + ... + message_end.
That was exactly what I was looking for!
Thanks for pointing me in the right direction again.

Its working, but on the radar the bomb is planted in a different place..
Oh well
suhdude is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-10-2017 , 14:59   Re: How do I call a registered event?
Reply With Quote #4

Send the correct bomb origin in BombDrop message to update the radar.
__________________
HamletEagle is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-10-2017 , 17:01   Re: How do I call a registered event?
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
Send the correct bomb origin in BombDrop message to update the radar.
I have to do this for every map or is there a way to set it to player location?
Whatever, it is not important in this retake scenario
suhdude is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-10-2017 , 17:22   Re: How do I call a registered event?
Reply With Quote #6

get_user_origin
__________________
HamletEagle is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-10-2017 , 17:30   Re: How do I call a registered event?
Reply With Quote #7

Quote:
Originally Posted by HamletEagle View Post
get_user_origin
Code:
{ get_user_origin(index, c4origin[3], mode = 0); message_begin(MSG_ALL, get_user_msgid("BombDrop"), {0,0,0}, 1) write_byte (c4origin); write_byte (c4origin); write_byte (c4origin); write_byte (1); write_byte (1); write_byte (1); write_byte (1); message_end(); }

This cant be right.. lol

Last edited by suhdude; 11-10-2017 at 17:31.
suhdude is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 11-10-2017 , 17:40   Re: How do I call a registered event?
Reply With Quote #8

Quote:
Originally Posted by suhdude View Post
Code:
{ get_user_origin(index, c4origin[3], mode = 0); message_begin(MSG_ALL, get_user_msgid("BombDrop"), {0,0,0}, 1) write_byte (c4origin); write_byte (c4origin); write_byte (c4origin); write_byte (1); write_byte (1); write_byte (1); write_byte (1); message_end(); }

This cant be right.. lol
Code:
message_begin(MSG_ALL, get_user_msgid("BombDrop"), {0,0,0}, 1) write_byte(c4origin[0]); write_byte(c4origin[1]); write_byte(c4origin[2]); write_byte(1); message_end();

Last edited by KiLLeR.; 11-10-2017 at 17:41.
KiLLeR. is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-10-2017 , 18:14   Re: How do I call a registered event?
Reply With Quote #9

Quote:
Originally Posted by KiLLeR. View Post
Code:
message_begin(MSG_ALL, get_user_msgid("BombDrop"), {0,0,0}, 1) write_byte(c4origin[0]); write_byte(c4origin[1]); write_byte(c4origin[2]); write_byte(1); message_end();
I get "Error: Undefined symbol "c4origin""

Code:
public delete_clock(id) { get_user_origin(id, c4origin[3], mode = 0); message_begin(MSG_ALL, get_user_msgid("BombDrop"), {0,0,0}, 1) write_byte(c4origin[0]); write_byte(c4origin[1]); write_byte(c4origin[2]); write_byte(1); message_end(); }
suhdude is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-10-2017 , 18:25   Re: How do I call a registered event?
Reply With Quote #10

You have to define it(new ...)
__________________

Last edited by HamletEagle; 11-10-2017 at 18:25.
HamletEagle 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 14:02.


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