Raised This Month: $ Target: $400
 0% 

Error models for both teams


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 09-29-2009 , 14:57   Error models for both teams
Reply With Quote #1

Where can be the problem ? I don't get it

PHP Code:
    public fw_PlayerSpawnid )
    {
     
// Not alive or didn't join a team yet
     
if ( !is_user_aliveid ) || !cs_get_user_teamid ) )
        return;
        
// Set to Survivor if on Counter team
        
g_survivor[id] = cs_get_user_teamid ) == CS_TEAM_CT true false;
    
     
// Remove previous tasks (if any)
     
remove_taskid MODELSET_TASK )
    
        if ( 
g_survivor[id] )
        {
         switch (
random_num(12))
         {
             case 
1copy(g_player_model[id], sizeof g_player_model[] - 1ModelT1)
                
             case 
2copy(g_player_model[id], sizeof g_player_model[] - 1ModelT2
 }
        else if ( 
g_survivor[id] ) = cs_get_user_teamid ) == CS_TEAM_T true false;
     {
             case 
1copy(g_player_model[id], sizeof g_player_model[] - 1ModelCT1)
                
             case 
2copy(g_player_model[id], sizeof g_player_model[] - 1ModelCT2
 }
         
// Get current model
         
new currentmodel[32]
         
fm_get_user_modelidcurrentmodelcharsmaxcurrentmodel ) )
        
         
// Check whether it matches the custom model
         
if ( !equalcurrentmodelg_player_model[id] ) )
         {
             
// An additional delay is offset at round start
             // since SVC_BAD is more likely to be triggered there
             
if ( get_gametime() - g_roundstarttime 5.0 )
                 
set_task5.0 MODELCHANGE_DELAY"fm_user_model_update"id MODELSET_TASK )
             else
                 
fm_user_model_updateid MODELSET_TASK )
         }
     }
     
// Not a survivor, but still has a custom model
     
else if ( g_has_custom_model[id] )
     {
         
// Reset it back to the default one
         
fm_reset_user_modelid )
     }
    }  
    public 
fw_SetClientKeyValueid, const infobuffer[], const key[] )
    {   
     
// Block CS model changes
     
if ( g_has_custom_model[id] && equalkey"model" ) )
         return 
FMRES_SUPERCEDE;
    
     return 
FMRES_IGNORED;
    }
    public 
fw_ClientUserInfoChangedid )
    {
     
// Player doesn't have a custom model
     
if ( !g_has_custom_model[id] )
         return 
FMRES_IGNORED;
    
     
// Get current model
     
static currentmodel[32]
     
fm_get_user_modelidcurrentmodelcharsmaxcurrentmodel ) )
    
     
// Check whether it matches the custom model - if not, set it again
     
if ( !equalcurrentmodelg_player_model[id] ) && !task_existsid MODELSET_TASK ) )
         
fm_set_user_modelid MODELSET_TASK )
    
     return 
FMRES_IGNORED;
    }
    public 
fm_user_model_updatetaskid )
    {
     static 
Float:current_time
     current_time 
get_gametime()
    
     
// Do we need a delay?
     
if ( current_time g_models_targettime >= MODELCHANGE_DELAY )
     {
         
fm_set_user_modeltaskid )
         
g_models_targettime current_time
     
}
     else
     {
         
set_task( (g_models_targettime MODELCHANGE_DELAY) - current_time"fm_set_user_model"taskid )
         
g_models_targettime g_models_targettime MODELCHANGE_DELAY
     
}
    }
    public 
fm_set_user_modelplayer )
    {
     
// Get actual player id
     
player -= MODELSET_TASK
    
     
// Set new model
     
engfuncEngFunc_SetClientKeyValueplayerengfuncEngFunc_GetInfoKeyBufferplayer ), "model"g_player_model[player] )
    
     
// Remember this player has a custom model
     
g_has_custom_model[player] = true
    
}
    
stock fm_get_user_modelplayermodel[], len )
    {
     
// Retrieve current model
     
engfuncEngFunc_InfoKeyValueengfuncEngFunc_GetInfoKeyBufferplayer ), "model"modellen )
    }
    
stock fm_reset_user_modelplayer )
    {
     
// Player doesn't have a custom model any longer
     
g_has_custom_model[player] = false
    
     dllfunc
DLLFunc_ClientUserInfoChangedplayerengfuncEngFunc_GetInfoKeyBufferplayer ) )
    } 
DoviuX is offline
Send a message via Skype™ to DoviuX
Reply



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 22:36.


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