[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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)