[Include] L_Lag - Causes player to lag, ping fluctuations and more.
#1

L_Lag
Version - 1.0
Introduction

This include allows to get a player to lag by slowing down their connections with the server, which can result in increase over packet-loss and causes ping fluctuations. When a player's lag state is set to true, the player will lag just like how they normally lag because of bad network condition. This include contains only two functions -
pawn Код:
native TogglePlayerLag(playerid, bool:lag_state, lag_delay = 3000);
//playerid - Player on which lag_state should be toggled.
//lag_state - 0 to stop lag state, 1 to enable lagging.
//lag_delay - Lagging delay interval in milliseconds, it's set to 3000 by default.
//returns 1 if function is called successfully, 0 if fails.

native GetPlayerLagState(playerid);
//returns 1 if lagging, returns 0 if not lagging.

native ReconnectPlayer(playerid);
//Causes player to reconnect. This function doesn't return any value.
Changelogs

V - 1.1
- Uses function BlockIpAddress for SA-MP versions 0.3z R2-2 and above.
- Adds new optional function : ReconnectPlayer
V - 1.0
- Initial release.
Download

GitHub - https://github.com/Lordzy/L_Lag
Raw Source - https://raw.githubusercontent.com/Lo...lude/L_Lag.inc
Reply
#2

Why will someone make their player lag intentionally? This can be one form of punishment lol.
Reply
#3

I consider this a joke script there is little use beyond being an asshole to use this but at least it is originally goofy.
Reply
#4

Wouldn't it be better to use BlockIpAddress?
Reply
#5

I don't really see a use of it either but this can be used by anyone if they want any player to lag on purpose. Even for testing purposes, it can be used.

Quote:
Originally Posted by sprtik
Посмотреть сообщение
Wouldn't it be better to use BlockIpAddress?
I haven't tried using BlockIpAddress function. I feel it's better to use SendRconCommand since it'll be compatible for every SA-MP versions.
Reply
#6

Yeah, but in case the server crashed during the ban, the player would remain banned until manual unban. Nevertheless, you can use macros to check if BlockIpAddress and use it if so.
Reply
#7

Quote:
Originally Posted by sprtik
Посмотреть сообщение
Yeah, but in case the server crashed during the ban, the player would remain banned until manual unban.
That's a good point. I never thought of it earlier but I'm going to release an update supporting both SendRconCommand and BlockIpAddress (Depends on the SA-MP version used).
Reply
#8

Include updated to v1.1!

Change Logs:

- Uses function BlockIpAddress for SA-MP versions 0.3z R2-2 and above.
- Adds new optional function : ReconnectPlayer
pawn Код:
native ReconnectPlayer(playerid);
Reply
#9

Good Update, Was just looking to make ReconnectPlayer for my server.
Reply
#10

About the ReconnectPlayer function, won't this bug out sometimes? Like this might make players get the you are banned message or something? I remember I had something like this and this problem was an obstacle for the relogging feature!
I hope that this is fully functional your include is actually useful and good for testing things on laggy players!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)