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

Solved what does that mean


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wilian159
Member
Join Date: Dec 2013
Old 07-27-2022 , 13:19   what does that mean
Reply With Quote #1

I was looking at some plugins around and I came across this, what does that mean, I had never seen it.

in plugin_precache

PHP Code:
register_message(get_user_msgid("DeathMsg"), "MsgHook_Death"); 
the public

PHP Code:
public MsgHook_Death() <FireBulletsEnabled>
{
    
set_msg_arg_string(4WEAPON_DEATH_NAME)


but right below there is this

PHP Code:
public MsgHook_Death()            </* Empty statement */>        { /* Fallback */ }
public 
MsgHook_Death()            <FireBulletsDisabled>        { /* Do notning */ 
what does this 'Fire Bullets' mean, and why does it have 3 publics too
__________________

Last edited by wilian159; 07-28-2022 at 16:02.
wilian159 is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-27-2022 , 13:37   Re: what does that mean
Reply With Quote #2

That's an automaton which means "machine states" or, in this case, "plugin states".

You can learn more from here:
https://forums.alliedmods.net/showthread.php?t=85981

or from general topics about automatons.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
damage220
Member
Join Date: Jul 2022
Location: Ukraine
Old 07-27-2022 , 13:47   Re: what does that mean
Reply With Quote #3

I tried to compile a program with the code
PHP Code:
public MsgHook_Death() <FireBulletsDisabled>
{} 
and got error "warning 230: no implementation for state "" / function "MsgHook_Death", no fall-back".
pawn supports states and automatons (state machines) directly in the language, including state-local variables. Doing this in the compiler allows for flexibility and optimal performance, as well as having the compiler verify the constraints of the automaton.
Language features
More info is here, page 36.
damage220 is offline
wilian159
Member
Join Date: Dec 2013
Old 07-27-2022 , 14:07   Re: what does that mean
Reply With Quote #4

at the end of the day this doesn't affect performance gain these days, right?
__________________
wilian159 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-28-2022 , 14:13   Re: what does that mean
Reply With Quote #5

Quote:
Originally Posted by wilian159 View Post
at the end of the day this doesn't affect performance gain these days, right?
No, without automatons your code will be 99999999x times slower and will not run at all without an i9 12900k overclocked on liquid nitrogen.

(Not every single feature in a programming language is about speed or efficiency or performance)
__________________

Last edited by HamletEagle; 07-28-2022 at 14:14.
HamletEagle is online now
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 07:52.


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