AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   player spawn model (https://forums.alliedmods.net/showthread.php?t=333047)

lexzor 06-16-2021 14:01

player spawn model
 
hello. i have a csgo remake server and i made a csgo agents plugin using this api: https://forums.alliedmods.net/showthread.php?t=161255

After 15 rounds, the teams are changing using freeze time and set_task (for id 1..8 task 0.1, for id 9..16 task 0.2 etc). The problem is after this freeze time, the server is restarting using sv_restart 1. All good, but for some players the model belongs to the team he was on before sv_restart.

How can i prevent this ?

i don t have the source file for changing team.

this is the code that check player model:

PHP Code:


public plugin_init()
{
        
RegisterHam(Ham_Spawn"player""player_spawn_post"1)
}

public 
player_spawn_post(id)
{
    if(
is_user_alive(id))
    {
        
cs_reset_player_model(id)

        if(
get_user_team(id) == && g_iPlayerSkin[id][T] == NON_USED_SKIN)
        {
            return 
PLUGIN_HANDLED
        
}

        if(
get_user_team(id) == && g_iPlayerSkin[id][CT] == NON_USED_SKIN)
        {
            return 
PLUGIN_HANDLED
        
}

        if(
get_user_team(id) == && g_iPlayerSkin[id][T] != NON_USED_SKIN)
        {
            new 
iSkin g_iPlayerSkin[id][T]
            
cs_set_player_model(idg_TSkin[iSkin][szCTSkin])
        }

        if(
get_user_team(id) == && g_iPlayerSkin[id][CT] != NON_USED_SKIN)
        {
            new 
iSkin g_iPlayerSkin[id][CT]
            
cs_set_player_model(idg_CTSkin[iSkin][szCTSkin])
        }
    }

    return 
PLUGIN_CONTINUE




All times are GMT -4. The time now is 02:31.

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