Raised This Month: $32 Target: $400
 8% 

Learning scripting in amx mod x but I can't find the functions of "register_event"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rabbit111
Junior Member
Join Date: Nov 2020
Old 03-12-2023 , 00:04   Learning scripting in amx mod x but I can't find the functions of "register_event"
Reply With Quote #1

Well, first of all I will try to clarify my situation and at the end of the post I will explain what am I asking.

I was looking for hours the functions of register_event but i can't find in anywhere in the wiki or in documentations of amx mod X in this 2 sites.

http://www.amxmodx.org/doc/
https://www.amxmodx.org/api/amxmodx/register_event

You can see each flag, an easy and simple explanation and the important thing: what each one of them do. (but not in events and functions. The site just explain what are both but they aren't showing all the events and functions that both have)


What I found where it show all the events and also explain what each event does is in here and it explain them what each one do clearly in a simple way what they do.
https://wiki.alliedmods.net/Half-Life_1_Game_Events

But in case of the functions I can't find them in anywhere (a list) like the most common "hooked_death" (Such as the list in the second link I shared above about the events) The problem is trying to figure out what exactly they do! Like test the plugin in the server or experimenting when i compile the source code and test it. Specifically to learn to script in this way at some extent is frustrating to me, even watching samples in tutorials thread, in simple codes it's boring to me. By now i'm learning to script in amxmodx through plugins because to me is a fun way to learn.

So I'm asking if there are in somewhere a list of the functions that register_event has?

My best Regards and sorry for my bad english

Last edited by rabbit111; 03-13-2023 at 10:18.
rabbit111 is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 03-12-2023 , 01:23   Re: Learning scripting in amx mod x but I can't find the functions of "register_event
Reply With Quote #2

Look in csx.inc, hamsandwich.inc, fun.inc, cstrike.inc and other .inc files to see what you can do. They are located in addons/amxmodx/scripting/include/

Especially look for the keyword "forward", the documentation is all there. Do NOT use the amxx api web references as they are outdated, instead use your local include files to search through what you need.

You already linked twice where all the register_event functions are at, and that page also explains the parameters you can check for the event.

"hooked_death" can be achieved with register_event MsgDeath, csx.inc's client_death and client_damage forwards, hamsandwich.inc's ham_playerkilled and ham_takedamage hooks, and im pretty sure there are other forwards you can use to detect a player's death.
__________________
deprale is offline
Old 03-12-2023, 10:23
HamletEagle
This message has been deleted by HamletEagle.
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 03-12-2023 , 17:06   Re: Learning scripting in amx mod x but I can't find the functions of "register_event
Reply With Quote #3

write "meta game" in server console with metamod running
jimaway is offline
rabbit111
Junior Member
Join Date: Nov 2020
Old 03-13-2023 , 11:54   Re: Learning scripting in amx mod x but I can't find the functions of "register_event
Reply With Quote #4

Quote:
Originally Posted by deprale View Post

You already linked twice where all the register_event functions are at, and that page also explains the parameters you can check for the event.
I think I didn't explained well myself, there was a miss understood I guess.

In the two first sites it shows the flags and what of them do. For example:

register_event ( const event[], const function[], const flags[], [ cond=[], ... ] )



You can see above that is explaining what is a "flag". It show each one of them, and what they do as the "a" , "b", "c"..... etc.




register_event ( const event[], const function[], const flags[], [ cond=[], ... ] )



above it just say:

"Name of event that should be hooked"

But the list of each one of them and what they do? ...
thanks I found them here



register_event ( const event[], const function[], const flags[], [ cond=[], ... ] )



Same thing happens here. It just say

Name of callback function

But the list of each one of them and what they do?



Quote:
Originally Posted by deprale View Post
You already linked twice where all the register_event functions are at.
I'm sorry, I only can see Name of callback function



Where are all the function that you are saying thay all at there?

Again sorry for my bad english

Last edited by rabbit111; 03-13-2023 at 12:21.
rabbit111 is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 03-13-2023 , 14:20   Re: Learning scripting in amx mod x but I can't find the functions of "register_event
Reply With Quote #5

you are supposed to name the function yourself that will be called with the event
jimaway is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 03-14-2023 , 18:27   Re: Learning scripting in amx mod x but I can't find the functions of "register_event
Reply With Quote #6

you must give the name of the callback function

https://en.wikipedia.org/wiki/Callba...er_programming)

hooking player death with hamsandwich: https://forums.alliedmods.net/showthread.php?t=113356
lexzor is offline
rabbit111
Junior Member
Join Date: Nov 2020
Old 03-16-2023 , 22:32   Re: Learning scripting in amx mod x but I can't find the functions of "register_event
Reply With Quote #7

Quote:
Originally Posted by lexzor View Post
you must give the name of the callback function

https://en.wikipedia.org/wiki/Callba...er_programming)

hooking player death with hamsandwich: https://forums.alliedmods.net/showthread.php?t=113356
Dude I will give u an example, seem no one understand me.

In simple words if I want to make a plugin in which it have a timer in a corner and which it does is show you a hud such as in a speedrunning, it logs how long time you stayed alived in a deathmatch game just after you have died. So you can keep in track how long you stayed alive in each time in the game after you died. Then at the end of the game you will see what was the max time you stayed alive.

So... How do I find the codes I need (or the functions) to make a plugin like this?, cuz there's no something such as a list such as events like this
rabbit111 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-16-2023 , 22:40   Re: Learning scripting in amx mod x but I can't find the functions of "register_event
Reply With Quote #8

This looks like an XY problem. If you want help with implementing a particular function or a plugin, simply create a thread asking about that specific functionality or plugin. Don't ask an extremely vague question like "what are all the game events".

Create a thread for your specific issue and you'll get much better, targeted responses.
__________________
fysiks is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 03-18-2023 , 11:30   Re: Learning scripting in amx mod x but I can't find the functions of "register_event
Reply With Quote #9

that depends of your logic. you can't find a specific code that works exactly how you want.

better write it by yourself and think what you need to achieve.


if you want to create a thread about your plugin just do it and post the code and ask for solutions.


amxx is not documented as good as you think. you need to know pawn, amx mod x libraries and basics of programming to achieve what you said in your last post.

Last edited by lexzor; 03-18-2023 at 11:31.
lexzor 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 08:19.


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