AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   RegisterHamFromEntity calling too many times. (https://forums.alliedmods.net/showthread.php?t=74679)

soccdoodcss 07-23-2008 03:50

RegisterHamFromEntity calling too many times.
 
PHP Code:

public client_putinserver(id)
{
    if(
is_user_bot(id))
        
set_task(0.1"delayedBotRegister"id)
}

public 
delayedBotRegister(id)
{
    
RegisterHamFromEntity(Ham_Spawnid"postSpawn"1)
    
RegisterHamFromEntity(Ham_TakeDamageid"preDamage")
    
RegisterHamFromEntity(Ham_Killedid"postKilled"1)


When I do this, it calls the functions way too many times. I was wondering if I'm doing anything wrong. And yes, it is only dealing with bots, I use RegisterHam for human players.

Arkshine 07-23-2008 04:02

Re: RegisterHamFromEntity calling too many times.
 
You have to register one time. Take a look in gungame.

soccdoodcss 07-23-2008 04:40

Re: RegisterHamFromEntity calling too many times.
 
Aaaaah... I see how it works. Thanks a lot. :D


All times are GMT -4. The time now is 05:37.

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