Raised This Month: $32 Target: $400
 8% 

player spawn model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lexzor
Veteran Member
Join Date: Nov 2020
Old 06-16-2021 , 14:01   player spawn model
Reply With Quote #1

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


Last edited by lexzor; 06-16-2021 at 14:01.
lexzor is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:47.


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