Raised This Month: $ Target: $400
 0% 

How to set delayed change of player models on roundstart?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Servak
Member
Join Date: Feb 2007
Location: Russia, Ryazan
Old 11-03-2008 , 06:10   How to set delayed change of player models on roundstart?
Reply With Quote #1

This is peace of code "CS Hide&Seek by AlMod"
PHP Code:
    
    
for (new i=0i<numi++)
    {
        
id players[i]
        if (
id==g_FirstVADA)
        {
            
client_print(id,print_chat,"* [H&S] You are VADA!")
            
            
// Change model speed & godmode
            
cs_set_user_model(id,"vip")
            
set_user_godmode(id,1)
            
set_user_footsteps(id,1)
            
set_user_gravity(id,1.0)
        }
        else
        {
            new 
name[32]
            
get_user_name(g_FirstVADA,name,31)
            
client_print(id,print_chat,"* [H&S] VADA is %s",name)
            
            
// Change model speed & godmode
            
            
cs_set_user_model(id,"gign")
            
set_user_godmode(id)
            
set_user_footsteps(id,0)
            
set_user_gravity(id,g_Gravity)
        }
    } 
I need delayed change of player models on roundstart, because if many players on server, they have crash like that:
Error: server failed to transmit file 'AY&SY|***************************'
Host_Error: UserMsg: Not Present on Client 25
__________________
I have 6 24\7 LAN CS 1.6 Servers.
Servak is offline
Send a message via ICQ to Servak
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-03-2008 , 06:32   Re: How to set delayed change of player models on roundstart?
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=69386
__________________
Arkshine is offline
Servak
Member
Join Date: Feb 2007
Location: Russia, Ryazan
Old 11-03-2008 , 09:51   Re: How to set delayed change of player models on roundstart?
Reply With Quote #3

Can you help me?
I changed code like that
PHP Code:
// Now making a message and set some stuff
    
for (new i=0i<numi++)
    {
        
id players[i]
        if (
id==g_FirstVADA)
        {
            
            
client_print(id,print_chat,"* [H&S] You are VADA!")
            
            
// Change model speed & godmode
            
cs_set_user_model(id,"vip")
            
set_user_godmode(id,1)
            
set_user_footsteps(id,1)
            
set_user_gravity(id,1.0)
        }
        else
        {
            new 
name[32]
            
get_user_name(g_FirstVADA,name,31)
            
            
client_print(id,print_chat,"* [H&S] VADA is %s",name)
            
            
// Change model speed & godmode
            
set_task(1.0 g_models_counter"task_set_model"id+MODELSET_TASK)
                           
g_models_counter += TASK_DELAY
            set_user_godmode
(id)
            
set_user_footsteps(id,0)
            
set_user_gravity(id,g_Gravity)
        }
    }
    
    
g_RoundStarted=true 
But all what i have - delayed momentarely change of all models, it's going to crash again with delay in 1 second
This is my task_set_model:
PHP Code:
public task_set_model(id)
{
    
// Get player id
    
id -= MODELSET_TASK
    
    
// Actually set the player's model
    
fm_set_user_model(id"gign")

How to make asynchronized changing?
__________________
I have 6 24\7 LAN CS 1.6 Servers.

Last edited by Servak; 11-03-2008 at 09:53.
Servak is offline
Send a message via ICQ to Servak
Servak
Member
Join Date: Feb 2007
Location: Russia, Ryazan
Old 11-03-2008 , 10:35   Re: How to set delayed change of player models on roundstart?
Reply With Quote #4

Please help me I trying to do this almost 4 hours, but every time i have this crash

This is original plugin.
Attached Files
File Type: sma Get Plugin or Get Source (h&s.sma - 749 views - 26.8 KB)
__________________
I have 6 24\7 LAN CS 1.6 Servers.
Servak is offline
Send a message via ICQ to Servak
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-03-2008 , 10:41   Re: How to set delayed change of player models on roundstart?
Reply With Quote #5

try to add the checks
if(is_user_alive(id))
__________________
xPaw is offline
Servak
Member
Join Date: Feb 2007
Location: Russia, Ryazan
Old 11-03-2008 , 12:39   Re: How to set delayed change of player models on roundstart?
Reply With Quote #6

Quote:
Originally Posted by xPaw View Post
try to add the checks
if(is_user_alive(id))
No, same...
Maybe problem because in this plugin model set in round_start function in cycle, not in player_spawn?
__________________
I have 6 24\7 LAN CS 1.6 Servers.
Servak is offline
Send a message via ICQ to Servak
Old 11-03-2008, 13:50
Servak
This message has been deleted by Servak. Reason: not needed
Servak
Member
Join Date: Feb 2007
Location: Russia, Ryazan
Old 11-03-2008 , 15:48   Re: How to set delayed change of player models on roundstart?
Reply With Quote #8

It's my mistake, finally i do this Thank you all
This is fixed version
Attached Files
File Type: sma Get Plugin or Get Source (h&s.sma - 702 views - 27.4 KB)
__________________
I have 6 24\7 LAN CS 1.6 Servers.
Servak is offline
Send a message via ICQ to Servak
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 09:24.


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