How can i handle laggers?
#1

Heey guys,
Is there a way to handle laggers?
I made a dialog for spawn and laggers spawn at 0,0,0:S
Reply
#2

Could you please define "handle laggers" with a bit more of an explaination with examples perhaps?
Usually when players are lagging, ther "ping" is what increases, so meaning you could get a players ping with this function: GetPlayerPing and jail/kick the laggers if the ping reaches the MAX ammount that you can set.
Reply
#3

I think he means desynced players? D:
Reply
#4

I mean just players with high ping (300) they spawn at 0,0,0. I need to fix that. I have hosted server at serverffs.
Reply
#5

So far I understood that you want a player to be teleported to the position 0.00, 0.00, 0.00 if his ping reaches 300 or higher?
Or do you already have this kind of function and want it to be removed?

If so, then:
pawn Code:
if(GetPlayerPing(playerid) >= 300) SetPlayerPos(playerid, 0.00, 0.00, 0.00); //If ping reaches 300+ then playerid will be teleported to position: 0.00, 0.00, 0.00
Reply
#6

No. I just want that the laggers spawn at the normal spawn not at 0,0,0. Because they have so much lag they spawn at 0,0,0 and not at normal place:S
Reply
#7

Quote:
Originally Posted by admigo
View Post
No. I just want that the laggers spawn at the normal spawn not at 0,0,0. Because they have so much lag they spawn at 0,0,0 and not at normal place:S
Ohhh, well there are a few ways to approach this.. Perhaps try a one-time timer that checks if player is near position 0.00, 0.00, 0.00 after 8 seconds that the player spawned. For Example:

pawn Code:
//Somewhere on top of your script or just above the Callback
forward CheckSpawnPosition(playerid);


//Put this under OnPlayerSpawn
SetTimerEx("CheckSpawnPosition", 8000, false, "i", playerid); //time is in milliseconds (8000 Milliseconds = 8 Seconds)


//Somewhere in between all Callbacks (public's)
public CheckSpawnPosition(playerid)
{
    new Float:Pos_Y, Float:Pos_X, Float:Pos_Z;
    GetPlayerPos(playerid, Pos_Y, Pos_X, Pos_Z);
    if(Pos_Y < 500 && Pos_Y > -500 && Pos_X < 500 && Pos_X > 500)
    {
        SetPlayerPos(playerid, 1000.00, -1000.00, 25.00); //Put your desired spawn location here.
    }
}
This Should probably do it, haven't tested it but I ammuse it should work.


FIRST EDIT: Forgot but Added the ; symbol behind the forward.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)