[HLF]Southclaw
Unregistered
You have now made the problem worse by starting a timer for every update where the player has exceeded the ping limit. You'll now get the exact same chat spam but 5 seconds later.
Ping does not need to be checked every ~20ms - you can just use a 1 second timer or even 5 second.
Another thing is you don't want to instantly kick someone who just has a momentary ping spike, it happens sometimes and one or two updates with higher ping is not a problem. If you do this you will end up with very angry users.
Instead, what you want to do is store a buffer of ping samples or count the number of times a user has exceeded the limit consecutively then use that data to kick. Here's some very old code that serves as a rough example of that idea:
https://github.com/Southclaws/Scaven....pwn#L221-L240
Posts: 455
Threads: 29
Joined: Apr 2014
when you use onplayerupdate, you have to limit the check amount. onplayerupdate is good because, when player is afk it won't be called.
Posts: 1,506
Threads: 13
Joined: Jun 2015
PHP код:
/*
A very simple help system to help show the usage and importance of iterator/ foreach
along with the new dialog styles added in 0.3.7
This is just taken out of, one of my Call of Duty scripts.
- Logic_
*/
Link: https://raw.githubusercontent.com/Al...aster/help.pwn
Posts: 1,506
Threads: 13
Joined: Jun 2015
10.06.2018, 07:27
(
Последний раз редактировалось Logic_; 10.06.2018 в 18:00.
)
Team Fortress 2: Payload
PHP код:
/*
Documentation
-------------
Mode name: Payload
Author: Logic_ (eXpose)
Script Type: Gamemode
A very simple implementation of TF2's Payload mode in SA-MP, originally was planned for a server which was later cancelled.
*/
Link: https://github.com/AliLogic/Payload-SAMP/tree/master
Gun Game: SA-MP
PHP код:
/*
Documentation
-------------
Mode name: Gun Game
Author: Logic_ (eXpose)
Script Type: Gamemode
A very simple implementation of CS:GO's Gun Game mode in SA-MP, originally was planned for a server which was later cancelled.
*/
LINK: https://github.com/AliLogic/Gun-Game-SAMP
Posts: 1,498
Threads: 110
Joined: Aug 2013
Quote:
Originally Posted by Dignity
such a big improvement !
|
I know right hahahaha he literally did nothing. LMFAO.
Posts: 1,498
Threads: 110
Joined: Aug 2013
Quote:
Originally Posted by cuber
I just thought I should paste it there. Go on discord and spam the n word again because you got banned because of Sew.
|
Chill brother just because I laughed that someone roasted you doesn’t mean I have something against you.LOL
Posts: 1,506
Threads: 13
Joined: Jun 2015
23.06.2018, 17:45
(
Последний раз редактировалось Logic_; 25.06.2018 в 03:01.
)
Quote:
Originally Posted by Calisthenics
You still call strlen many times and it does work, just tested it to confirm.
pawn Код:
main() { OnPlayerText(0, " it works."); }
public OnPlayerText(playerid, text[]) { for (new i = 0, j = strlen(text); i < j; i++) { if ('a' <= text[i] <= 'z') { //text[i] = toupper(text[i]); text[i] -= 32; break; } } printf("OPT: \"%s\"", text); return 1; }
|
You can alternatively use
if (new i; text[i] != EOS; i++) for the loop. Your code is better than Lokii's.