AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   CurWeapon (https://forums.alliedmods.net/showthread.php?t=213914)

GhostMan 04-20-2013 16:56

CurWeapon
 
Does it makes any difference if i return some value in CurWeapon event or don't?

PHP Code:

public EventCurWeapon(id)
{
    if(
get_user_team(id) == 1)
        
engclient_cmd(id"weapon_knife")
    
    return 
PLUGIN_HANDLED
}

public 
EventCurWeapon(id)
{
    if(
get_user_team(id) == 1)
        
engclient_cmd(id"weapon_knife")
    
    return 
PLUGIN_CONTINUED
}

public 
EventCurWeapon(id)
{
    if(
get_user_team(id) == 1)
        
engclient_cmd(id"weapon_knife")



mottzi 04-20-2013 17:02

Re: CurWeapon
 
Why dont you test it out?

GhostMan 04-21-2013 04:13

Re: CurWeapon
 
I did, and it don't make any difference for me. But maby there's something i don't notice.

ConnorMcLeod 04-21-2013 06:08

Re: CurWeapon
 
You don't need to return any value in events callbacks, once the function is called, message has already been sent.
If you want to exit the function before its end, just put 'return' without any value.

^SmileY 04-22-2013 07:56

Re: CurWeapon
 
PHP Code:

return PLUGIN_CONTINUED 

lol you not need this and any return; its only if you want to exit the function or return to other function

hornet 04-22-2013 08:03

Re: CurWeapon
 
Quote:

Originally Posted by ^SmileY (Post 1937579)
PHP Code:

return PLUGIN_CONTINUED 

lol you not need this and any return; its only if you want to exit the function or return to other function

No reason to laugh at new users nor is there a reason to repeat something that was already said.

^SmileY 04-22-2013 08:43

Re: CurWeapon
 
is not a laugh comment, its only to remember the return is not needed, and i not really see this wrong return;

Backstabnoob 04-22-2013 09:28

Re: CurWeapon
 
I'm pretty sure 'lol' means laugh out loud.

^SmileY 04-22-2013 09:48

Re: CurWeapon
 
NO!

I only surprised with the unnecessary return;

ConnorMcLeod 04-22-2013 14:25

Re: CurWeapon
 
Quote:

Originally Posted by Backstabnoob (Post 1937625)
I'm pretty sure 'lol' means laugh out loud.

You, and the whole world, are wrong !


All times are GMT -4. The time now is 10:51.

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