SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 22/12/2015, 01:12 PM   #1
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,698
Reputation: 1177
Default L_Lag - Causes player to lag, ping fluctuations and more.

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 Code:
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
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.

Last edited by Lordzy; 02/01/2016 at 12:54 PM.
Lordzy is offline   Reply With Quote
Old 22/12/2015, 01:35 PM   #2
Ritzy2K
High-roller
 
Ritzy2K's Avatar
 
Join Date: Jun 2014
Location: India
Posts: 1,547
Reputation: 170
Default Re: L_Lag - Causes player to lag, ping fluctuations and more.

Why will someone make their player lag intentionally? This can be one form of punishment lol.
__________________
Ritzy2K is offline   Reply With Quote
Old 22/12/2015, 02:50 PM   #3
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,885
Reputation: 1337
Default Re: L_Lag - Causes player to lag, ping fluctuations and more.

I consider this a joke script there is little use beyond being an asshole to use this but at least it is originally goofy.
Pottus is offline   Reply With Quote
Old 22/12/2015, 03:07 PM   #4
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 200
Reputation: 275
Default Re: L_Lag - Causes player to lag, ping fluctuations and more.

Wouldn't it be better to use BlockIpAddress?
IllidanS4 is offline   Reply With Quote
Old 25/12/2015, 03:06 AM   #5
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,698
Reputation: 1177
Default Re: L_Lag - Causes player to lag, ping fluctuations and more.

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 View Post
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.
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 25/12/2015, 04:03 PM   #6
IllidanS4
Huge Clucker
 
IllidanS4's Avatar
 
Join Date: Feb 2013
Posts: 200
Reputation: 275
Default Re: L_Lag - Causes player to lag, ping fluctuations and more.

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.
IllidanS4 is offline   Reply With Quote
Old 26/12/2015, 05:15 PM   #7
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,698
Reputation: 1177
Default Re: L_Lag - Causes player to lag, ping fluctuations and more.

Quote:
Originally Posted by sprtik View Post
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).
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 02/01/2016, 12:51 PM   #8
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,698
Reputation: 1177
Default Re: L_Lag - Causes player to lag, ping fluctuations and more.

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 Code:
native ReconnectPlayer(playerid);
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 02/01/2016, 01:05 PM   #9
SpikY_
High-roller
 
SpikY_'s Avatar
 
Join Date: Jul 2014
Posts: 1,246
Reputation: 128
Default Re: L_Lag - Causes player to lag, ping fluctuations and more.

Good Update, Was just looking to make ReconnectPlayer for my server.
__________________
-
SpikY_ is offline   Reply With Quote
Old 02/01/2016, 01:11 PM   #10
Stanford
Gangsta
 
Stanford's Avatar
 
Join Date: Feb 2012
Posts: 983
Reputation: 84
Default Re: L_Lag - Causes player to lag, ping fluctuations and more.

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!
__________________
******: "That code compiles perfectly, but I can tell you now it won't make me a cup of tea."

******: "I've said this before. People think that MySQL is some simple plug-and-play magic bullet that you can use to just make your mode instantly better. They don't realise that the "L" in "SQL" means "language". So instead of programming PAWN, and using a bit of this mystery thing, you are now programming in two languages at once. If you spend months learning PAWN, you should spend the same time learning SQL, if not more - it is probably the more complex of the two languages, and not something that just gets bolted on to the side."
Stanford is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Music When Player Connect ++ Textdraw ++ ping wahyumahadir Scripting Help 4 05/02/2015 06:26 PM
Player Ping iKyle Scripting Help 0 18/12/2014 10:51 PM
How can i show player FPS, and Ping in their body? qazwsx Scripting Help 3 30/07/2013 08:25 AM
IP & PING Retruns me same ping as player which executes the command MiGu3X Scripting Help 3 30/03/2013 01:11 AM
Player's Ping in a variable? [HK]Ryder[AN] Scripting Help 4 12/09/2012 03:52 PM


All times are GMT. The time now is 12:05 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.