AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   wait for a client to execute a command before setting a variable (https://forums.alliedmods.net/showthread.php?t=189225)

HLM 07-04-2012 19:09

wait for a client to execute a command before setting a variable
 
I have this code that is supposed to lock players down to their team for one minute if they are transferred/call a vote to even teams to help prevent abuse, but unfortunately, implementing this broke the teambalancer because the teambalancer sends players to other teams using client_cmd(id, "jointeam %d", team) but this fails because the teamlock has already been activated (for 0.1-0.3s depending on lag) other than using a set_task is there any way I can make this code wait until the user is on the other team?

its being used properly, but the

PHP Code:

stock fm_set_user_teamidteam )
{
    
client_print(0print_chat"transferring: %d:%d %f"idteamget_gametime())
    
client_cmd(id"jointeam %d"team)
    if(
get_pdata_int(idpev_team) == team)
        
g_teamlock[id] = get_gametime()
    else
        
client_print(0print_chat"error: could not switch teams.")




All times are GMT -4. The time now is 12:38.

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