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

How do I call a registered event?


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

Quote:
Originally Posted by HamletEagle View Post
You have to define it(new ...)
new c4origin=(player)?
new c4origin[3]?
new c4origin get_user_origin(id, c4origin[3], mode = 0);?

I don't understand, sorry.

Last edited by suhdude; 11-10-2017 at 18:59.
suhdude is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-10-2017 , 19:02   Re: How do I call a registered event?
Reply With Quote #12

PHP Code:
new c4origin[3
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-10-2017 , 19:10   Re: How do I call a registered event?
Reply With Quote #13

Quote:
Originally Posted by wickedd View Post
PHP Code:
new c4origin[3
Error: Array index out of bounds (variable "c4origin") on line 40
line 40: get_user_origin(id, c4origin[3], mode = 0);
suhdude is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-10-2017 , 19:16   Re: How do I call a registered event?
Reply With Quote #14

Post your code
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-10-2017 , 19:23   Re: How do I call a registered event?
Reply With Quote #15

Quote:
Originally Posted by wickedd View Post
Post your code
Code:
#include <amxmodx> #include <fakemeta> #include <fun> #include <cstrike> #define PLUGIN "Spawnplant" #define VERSION "1.0" #define AUTHOR "suhdude/alliedmodders" 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");     return PLUGIN_CONTINUE; } public plant_bomb(id) {     if ( is_user_in_plant_zone( id ) )     {         client_cmd (id,"say /plant"); //activates another plugin that plants the bomb.         client_print( 0, print_center, "#Cstrike_TitlesTXT_Bomb_Planted" );     } }    public delete_clock(id) { new c4origin[3]  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(); }

Thanks for helping out!

Last edited by suhdude; 11-10-2017 at 19:25.
suhdude is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-10-2017 , 19:33   Re: How do I call a registered event?
Reply With Quote #16

PHP Code:
get_user_origin(idc4origin[3], mode 0); 

PHP Code:
get_user_originidc4origin ); 
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 11-10-2017 , 19:40   Re: How do I call a registered event?
Reply With Quote #17

new Float:name[3];

Pawn is not that clever to create variable instead of you.
KiLLeR. is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-10-2017 , 19:54   Re: How do I call a registered event?
Reply With Quote #18

Quote:
Originally Posted by wickedd View Post
PHP Code:
get_user_origin(idc4origin[3], mode 0); 

PHP Code:
get_user_originidc4origin ); 
Hmm, now the dot is nowhere on the radar and the clock is not removed.
Looks like this now:

Code:
public delete_clock(id) { new Float:c4origin[3]; get_user_origin( id, c4origin ); 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()}

Thanks.

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

It should not be Float:. get_user_origin works woth integers.

Also in message_begik why do you use the 1 at the end?
__________________

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

Quote:
Originally Posted by HamletEagle View Post
It should not be Float:. get_user_origin works woth integers.

Also in message_begik why do you use the 1 at the end?
Maybe I missunderstood this:

Quote:
The first three arguments are the origin of the dropped bomb. The last argument is set to 0 if the bomb was dropped due to voluntary dropping or death/disconnect. It is set to 1 if the bomb was planted, which will trigger the round timer to hide. It also will show the dropped bomb on the Terrorist team's radar in the location specified by the first three arguments.
Timer is still there, I removed the float: and the "write_byte(1);"

Last edited by suhdude; 11-11-2017 at 09:17.
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 13:06.


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