AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   join team event get crash (https://forums.alliedmods.net/showthread.php?t=98648)

biscuit628 07-27-2009 12:47

join team event get crash
 
PHP Code:

    register_event("TextMsg","jointeam","a","1=1","2&Game_join_te","2&Game_join_ct")

public 
jointeam()
{
    new 
id read_data(1);
    if(!
handsome[id])
            
cs_set_user_team(idCS_TEAM_SPECTATOR)
    return 
PLUGIN_CONTINUE;


if i add a task,it's work perfect,but it will let the player spawn one time ,then send him to spec
i don't want the player can spawn..
here is the work code
PHP Code:

    register_event("TextMsg","jointeam","a","1=1","2&Game_join_te","2&Game_join_ct")

public 
jointeam()
{
    new 
id read_data(1);
    if(!
handsome[id])
        
set_task(0.5,"set_team",id)
    return 
PLUGIN_CONTINUE;
}

public 
set_team(id)
{
    
user_kill(id,1)
    
cs_set_user_team(idCS_TEAM_SPECTATOR)


anyone can help?


All times are GMT -4. The time now is 18:23.

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