AlliedModders

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

gamelaster 08-31-2012 05:28

Dont revive
 
Hi, i be dead but dont revive.... I dont know why..
PHP Code:

 
public plugin_init()
{
...
    
register_event("DeathMsg","EventDeath","a");
...
    
g_MaxPlayers get_maxplayers();
...
}

GetAlivePlayers()
{
        new 
Count;
 
        for (new 
Client 1Client <= g_MaxPlayersClient++)
                if (
is_user_alive(Client))
                        
Count++;
 
        return 
Count;
}  

public 
EventDeath(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_CT)
    {
        if(
zivoty != 0)
        {
            if(
GetAlivePlayers() >> 2)
            {
                
set_task(5.0,"oziv");
            }
        }
    }
    return 
PLUGIN_CONTINUE;
}
public 
oziv(id)
{
    
ExecuteHam(Ham_Spawnid)


Thanx

Torge 08-31-2012 05:33

Re: Dont revive
 
PHP Code:

if(GetAlivePlayers() >> 2)


Shouldn't it not be ..

PHP Code:

if (GetAlivePlayers() > 2)


?

gamelaster 08-31-2012 05:34

Re: Dont revive
 
Oh Crap, im idiot..... I test and thanx :D

rak 08-31-2012 05:37

Re: Dont revive
 
Quote:

Originally Posted by gamelaster (Post 1787638)
Oh Crap, im idiot..... I test and thanx :D

you never pass the index in "set_task"


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

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