AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   @ in front of function? (https://forums.alliedmods.net/showthread.php?t=244298)

OvidiuS 07-16-2014 10:53

@ in front of function?
 
What does @ mean in front of function?

Code:
#include < amxmodx > public plugin_init( ) {     register_plugin( "Compile me", "1.0", "Author" ); } @__CompileThisPlugin( ) { }

Code:
#include < amxmodx > public plugin_init( ) {     register_plugin( "Compile me", "1.0", "Author" ); } __CompileThisPlugin( ) { }

I guess that @ = public but i'm not sure, that's why i'm asking.

hleV 07-16-2014 11:03

Re: @ in front of function?
 
It means nothing.

HamletEagle 07-16-2014 12:15

Re: @ in front of function?
 
http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf

Backstabnoob 07-16-2014 13:20

Re: @ in front of function?
 
@ is a shorthand for public. It's supposed to be used on events for readability reasons.

PHP Code:

#include <amxmodx>

public plugin_init()
{
    
set_task(1.0"@say")
}

@
say()
{
    
server_print("AAAAAAAAAAAAAAA")


Output: AAAAAAAAAAAAAAA

OvidiuS 07-16-2014 14:43

Re: @ in front of function?
 
Quote:

Originally Posted by hleV (Post 2168693)
It means nothing.

Compile those two plugins i posted and you'll see that compiler thinks different.

Quote:

Originally Posted by Backstabnoob (Post 2168783)
@ is a shorthand for public. It's supposed to be used on events for readability reasons.

PHP Code:

#include <amxmodx>

public plugin_init()
{
    
set_task(1.0"@say")
}

@
say()
{
    
server_print("AAAAAAAAAAAAAAA")


Output: AAAAAAAAAAAAAAA

Thanks, i was pretty sure that @ stands for public, but i never saw someone using it.

Backstabnoob 07-16-2014 15:10

Re: @ in front of function?
 
It doesn't really matter, it's more of a readability option. Like I said, this should be explicitly used for event-related functions, such as forwards. You cannot use it for defined forwards though as @ becomes a part of the function name.


All times are GMT -4. The time now is 13:12.

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