Raised This Month: $51 Target: $400
 12% 

Solved [TF2] Forcing class server crush


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
oplkill
Member
Join Date: Aug 2015
Old 11-11-2017 , 13:22   [TF2] Forcing class server crush
Reply With Quote #1

I making simple class wars plugin, which forcing players to their random class, but after Pyro update it was broken in some cases.
When previous round have for ex. Heavy and next class is Sniper, server crushing when one of players spawning with new class. Crushing always when next class is sniper. When i banning class sniper, bug do not appearing. And crushing in random cases, i tryed to repeat this bug, but this bug seems have special combination of weapons...
Maybe, someone knows the answer?
https://crash.limetech.org/ll7qgvi3a24r

PHP Code:
public Event_RoundWin(Handle:event, const String:name[], bool:dontBroadcast)
{
    
gClassRed GetRandomInt(19);
    
gClassBlue GetRandomInt(19);
}

public 
Event_PlayerSpawned(Handle:hEvent, const String:strEventName[], bool:bDontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(hEvent"userid"));
    
    if(
IsValidClient(client))
    {
        new 
team TF2_GetClientTeam(client);
        new 
TFClassType:settedClass = (team == TFTeam_Red) ? gClassRed gClassBlue;
        if(
TF2_GetPlayerClass(client) != settedClass)
        {
            
TF2_SetPlayerClass(clientsettedClass);
            
TF2_RespawnPlayer(client);
        }
    }


Last edited by oplkill; 11-12-2017 at 08:55.
oplkill is offline
oplkill
Member
Join Date: Aug 2015
Old 11-12-2017 , 08:54   Re: [TF2] Forcing class server crush
Reply With Quote #2

Solved, now i using user fake command and no more server crashed

PHP Code:
FakeClientCommand(client"joinclass %s"g_strClass[settedClass])); 
oplkill is offline
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 11-14-2017 , 11:10   Re: [TF2] Forcing class server crush
Reply With Quote #3

Respawn should be delayed. They cant even properly spawn and youre already respawning them.
__________________
luki1412 is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 11-18-2017 , 04:59   Re: [TF2] Forcing class server crush
Reply With Quote #4

Setted isn't a word. It's just "set".
404UserNotFound 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 15:10.


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