AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Model delay works bad (https://forums.alliedmods.net/showthread.php?t=125920)

DoviuX 05-03-2010 16:04

Model delay works bad
 
When player respawns model hardly changes maybe someone knows how ?
Becouse classes have different models and when respawn another class model still remains and when about 10 seconds go he changes to hes class model.

PHP Code:

#define TASK_DELAY 0.5    
#define TASKID_MODEL        3810 

new player_model[33][32]
new 
Floatg_counter

        
new currentmodel[32];
        
fm_get_user_model(idcurrentmodelsizeof currentmodel 1);
        
        if(!
equal(currentmodelplayer_model[id]))
        {
            
set_task(0.1 g_counter"Task_Model"id TASKID_MODEL)
            
g_counter += TASK_DELAY;
        }


public 
Task_Model(task)
{
    new 
id task TASKID_MODEL 
    
    fm_set_user_model
(idplayer_model[id])
}

stock fm_set_user_model(playermodelname[])
{   
    
engfunc(EngFunc_SetClientKeyValueplayerengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modelname)
    
    
g_model[player] = true
}

stock fm_get_user_model(playermodel[], len)
{   
    
engfunc(EngFunc_InfoKeyValueengfunc(EngFunc_GetInfoKeyBufferplayer), "model"modellen)
}

stock fm_reset_user_model(player)
{         
    
g_model[player] = false
    
    dllfunc
(DLLFunc_ClientUserInfoChangedplayerengfunc(EngFunc_GetInfoKeyBufferplayer))



Exolent[jNr] 05-03-2010 19:24

Re: Model delay works bad
 
Quote:

Originally Posted by DoviuX (Post 1169427)
and when respawn another class model still remains and when about 10 seconds go he changes to hes class model.

That's the purpose of model change delay.
The first player will be the first model to change, and the last player will be delayed long enough for other players to change their models.


All times are GMT -4. The time now is 03:48.

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