AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Method to detect spawn (https://forums.alliedmods.net/showthread.php?t=126318)

KadiR 05-08-2010 08:30

Method to detect spawn
 
I wanted to ask you which one is better to detect, that the player spawned:

PHP Code:

RegisterHam(Ham_Spawn"player""PlayerSpawn"1)

public 
PlayerSpawnid )
{
    if(!
is_user_alive(id))
    return 
PLUGIN_HANDLED;
    {
        
//stuff
    
}
    return 
PLUGIN_HANDLED;


or

PHP Code:

register_event("ResetHUD""fwEvResetHUD""b");

public 
fwEvResetHUDid ) {
        if (!
is_user_alive(id))
                return;

        
fwPlayerSpawn(id);
}

public 
fwPlayerSpawnid ) {
 if(!
is_user_alive(id))
  return 
PLUGIN_HANDLED;
 
 
//stuff
 
return PLUGIN_HANDLED;



Arkshine 05-08-2010 08:33

Re: Method to detect spawn
 
I'm surprised. You are not a beginner or you are here since 2008, such thing has been already discussed numerous times ( we can read very often someone saying how to hook properly the player's spawn ), there is even a tutorial about it, and still.. you ask again.

KadiR 05-08-2010 09:54

Re: Method to detect spawn
 
Well I read that the ham way is better, but I still saw some plugins which are approved with the 2. way.

Arkshine 05-08-2010 10:00

Re: Method to detect spawn
 
It should not be approved or the purpose is another thing. Anyway Ham_Spawn is the way to keep to hook player's spawn in most of situation. It's just a matter on what does exactly both to know how to to use it properly. For more informations, see the VEN's tuto.

KadiR 05-08-2010 10:21

Re: Method to detect spawn
 
Allright, thanks for your information.

fysiks 05-08-2010 16:30

Re: Method to detect spawn
 
Quote:

Originally Posted by KadiR (Post 1174393)
Well I read that the ham way is better, but I still saw some plugins which are approved with the 2. way.

It seems you have failed to read the date those plugins were posted. Anything approved nowadays will not have ResetHUD for spawning.


All times are GMT -4. The time now is 03:43.

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