Raised This Month: $ Target: $400
 0% 

CS_RespawnPlayer bug in 17.2.16 update


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
selax
AlliedModders Donor
Join Date: Apr 2008
Location: Moscow
Old 02-23-2016 , 18:06   CS_RespawnPlayer bug in 17.2.16 update
Reply With Quote #1

Hey!
I got problem (already fix, but i want know why this problem).

Before 17.2.16 update i use this code, some of this, and this work:
PHP Code:
// hook event
HookEvent"round_start"RoundStartEventHookMode_PostNoCopy );

// in roundstart event
{
    
CS_SwitchTeam    iRandomPlayers.IntValue    );
    
CS_RespawnPlayer );

After 17.2.16 update work only this code:
PHP Code:
// hook event
HookEvent"round_start"RoundStartEventHookMode_PostNoCopy );

// in roundstart event
{
    
CS_SwitchTeam    iRandomPlayers.IntValue    );
    
CreateTimer    0.01RandomRespawni     );
}

public 
Action RandomRespawn Handle timerint client )
{
    if ( 
IsClientInGameclient ) )
    {
        
CS_RespawnPlayer client );
    }

Full code there, if need: https://github.com/selax/deathrun

I already fix problem with 0.01 timer, but how do teleport to spawn without timer?
EventHookMode_PostNoCopy change not help.
__________________

Last edited by selax; 02-26-2016 at 15:02.
selax is offline
pride95
Senior Member
Join Date: Aug 2015
Old 02-24-2016 , 06:56   Re: CS_RespawnPlayer bug in 17.2.16 update
Reply With Quote #2

0.01 = 0.1
0 = 0.1

this is the lowest value for timer.

because valve
pride95 is offline
selax
AlliedModders Donor
Join Date: Apr 2008
Location: Moscow
Old 02-24-2016 , 07:52   Re: CS_RespawnPlayer bug in 17.2.16 update
Reply With Quote #3

Quote:
Originally Posted by pride95 View Post
0.01 = 0.1
0 = 0.1

this is the lowest value for timer.

because valve
0 != 0.1 != 0.01
I test this, I know this for 100%.
selax is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 02-24-2016 , 08:54   Re: CS_RespawnPlayer bug in 17.2.16 update
Reply With Quote #4

0.0 will be next tick (not 100% accurate), but 0.1 is still 0.1. Those timers are not 100% accurate too btw.
__________________
zipcore is offline
selax
AlliedModders Donor
Join Date: Apr 2008
Location: Moscow
Old 02-26-2016 , 12:31   Re: CS_RespawnPlayer bug in 17.2.16 update
Reply With Quote #5

How to change player team with correct spawns in roundstart without timer?
selax is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-26-2016 , 13:32   Re: CS_RespawnPlayer bug in 17.2.16 update
Reply With Quote #6

Quote:
Originally Posted by zipcore View Post
0.0 will be next tick (not 100% accurate), but 0.1 is still 0.1. Those timers are not 100% accurate too btw.
If you really want the next frame, use a RequestFrame.

But yes, SourceMod's internal timer only ticks every 0.1 seconds and it checks all active timers to see whether their callbacks need to run or not. So, setting a timer to 0.01 is still only going to be checked on that 0.1 second time that SourceMod's internal system uses.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-26-2016 at 13:39.
Powerlord is offline
selax
AlliedModders Donor
Join Date: Apr 2008
Location: Moscow
Old 02-26-2016 , 14:59   Re: CS_RespawnPlayer bug in 17.2.16 update
Reply With Quote #7

Quote:
Originally Posted by Powerlord View Post
So, setting a timer to 0.01 is still only going to be checked on that 0.1 second time that SourceMod's internal system uses.
It's wrong, i test this ~100 rounds.
If 0.01 timer - i not see old team spawn. (I see only 1 new spawn)
If 0.1 timer - i see old team spawn. (See 2 respawn on old and new team spawn)


Quote:
Originally Posted by Powerlord View Post
If you really want the next frame, use a RequestFrame.
Before CS:GO update i use this code and this work beautiful. After update CS_RespawnPlayer respawn player on old spawn (or not respawn). I don't know why. :c
PHP Code:
// hook event
HookEvent"round_start"RoundStartEventHookMode_PostNoCopy );

// in roundstart event
{
    
CS_SwitchTeam    iRandomPlayers.IntValue );
    
CS_RespawnPlayer );


UPD - i have idea how to do this cool with player_spawn event, i try this. But if you have good ideas - tell in thread plz.

Last edited by selax; 02-26-2016 at 15:11.
selax is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-26-2016 , 15:58   Re: CS_RespawnPlayer bug in 17.2.16 update
Reply With Quote #8

Quote:
Originally Posted by selax View Post
It's wrong, i test this ~100 rounds.
If 0.01 timer - i not see old team spawn. (I see only 1 new spawn)
If 0.1 timer - i see old team spawn. (See 2 respawn on old and new team spawn)
You realize that I linked to the SourceMod source code to back up my assertions, right?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
selax
AlliedModders Donor
Join Date: Apr 2008
Location: Moscow
Old 02-26-2016 , 18:50   Re: CS_RespawnPlayer bug in 17.2.16 update
Reply With Quote #9

Quote:
Originally Posted by Powerlord View Post
You realize that I linked to the SourceMod source code to back up my assertions, right?
It's SourceMod magic...

English is very hard for me, may be i not realize.
I see min - 0.1 in sourcemod code.

But i test ~100 rounds and.. 0.01 is faster, then 0.1

Message part of "checks all active timers" i not realize

Last edited by selax; 02-26-2016 at 18:53.
selax is offline
ESK0
BANNED
Join Date: May 2014
Location: Czech Republic
Old 02-26-2016 , 20:05   Re: CS_RespawnPlayer bug in 17.2.16 update
Reply With Quote #10

Here you go.

Code:
HookEvent("round_prestart", Event_OnRoundStartPre);

public Action Event_OnRoundStartPre(Event event, const char[] name, bool dontbroadcast)
{
    CS_SwitchTeam(i, RandomPlayers.IntValue);
}
ESK0 is offline
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 06:32.


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