[FilterScript] Version kick.
#1

A simple version kick.
Introduction:
Advantages:
1- Make sure that your players are up to date, to make sure the players got all the new functions in the new versions.
2- Many of the cheats are based on older version, like the most known cheats, projects that aren't open-source..etc
3-Less moderation for you over new players, basically turn the version kick off when you're on, turn it on when you're off, server safe.
Disadvantages:
it does kick a shitload of players because many use the 0.3.7 version, but that's why i added the ability to tog the version kick by using /togversion
Why its based at OnPlayerConnect:
Because i don't want to give them a chance to do anything with their cheats, safer to not even spawn.
Since i haven't seen any type of a version kick and i'm not sure if everyone can do this, i mean i know it isn't rocket sience but some ppl might not be able to do it, so hope this helps some, no need for credits or anything its just a simple snippet, i realize that it might not be efficient but it is effective and i tested it many.
How to install?
Very easy, basically visit the pastebin link, paste all of the lines underneath the listed functions, if you have any suggestions/criticizes about the script i'll be more than glad to listen to them, have a good one.
Pastebin:
https://pastebin.com/A7dgrw23
If anything, the .pwn and .amx files are attached, have fun guys. PS: the version tog is turned on by default, number of lines: 45, fully explained everything on the pastebin link.

Thanks for everyone's advises and comments on this whether they were positive, negative I've sure benefited from them and i hope that this also has helped others.
Reply
#2

PHP Code:
public OnPlayerConnect(playerid)
{
        new 
string[40];
        
GetPlayerVersion(playeridstringsizeof(string));
        if(
strcmp(string"0.3.7-R2")) Kick(playerid);
        return 
1;

thanks, k bye
Reply
#3

This post looks like a website from the 90s.
Reply
#4

That's my style IllidanS4, doesn't break the rules so it's overall none of your business, if you just go on to bash other people's code/posts i'd rather suggest you go get a life, @XeonTM your code isn't explained and doesn't have the ability to tog the version kick nor send messages nor a delayed kick, hence my code took more lines, your code hasn't done what my code does in a better way and in a shorter number of lines as my code still does more, if you can sum up what i did and make it as effective as it is i'll be more than glad to update, that is if you even viewed my code but yeah thanks for the reply overall the purpose of this was to help people who don't know how to make a version kick or how it's done.
Reply
#5

If player has different version samp then they still can't connect the server. I think this system is pretty useless but because of you worked hard on making it. I will give u +rep
Reply
#6

Quote:
Originally Posted by SonnyGamer
View Post
If player has different version samp then they still can't connect the server. I think this system is pretty useless but because of you worked hard on making it. I will give u +rep
Thanks! @Sonny, but how come? i mean players with 0.3.7 are connecting to 0.3.7-R2 sorry but i don't get your point, explain more if possible, thanks.
Reply
#7

Ok here we go, I've reviewed your code.

1- Indentation is killed.

2- You forget #define FILTERSCRIPT

3-
PHP Code:
new versioncheck
This variable will take only two cases, false or true, so you have to use bool: tag like this.

PHP Code:
new bool:versioncheck
4- You are declaring 3 arrays for 3 strings you could optimize that by using only 2.

5-
PHP Code:
if(strcmp(versionstring"0.3.7-R2"))//checking if that string has the wanted version.
{

waste of lines you could use
PHP Code:
if(!strcmp(versionstring"0.3.7-R2")) 
instead

6-
PHP Code:
format(messagestringsizeof(messagestring), " Server Has Kicked %s, Reason : OLD CLIENT VERSION %s "playername,versionstring);
SendClientMessageToAll(-1,messagestring);
SetTimerEx("DelayedKick",1000false"i"playerid);//delaying both the kick and the message to make sure the player gets the messages on time.
SetTimerEx("DelayedMessages",500,false,"i",playerid);//thats  the delayed message 
Delayed message

waste of lines and CPU usage, you could send directly the messages (your messages won't appear to the player because the second one will be called after delayed kick finish and that's not cool.

7 -
PHP Code:
SetPlayerWeather(playerid999);//blinding the player on his disconnect to make sure he's totally out.
SetPlayerVirtualWorld(playerid999);//same as above
SetPlayerInterior(playerid,999);//same as above 
You are wrong mate, these are a valid values. VW 999 exists same for others.

8-
PHP Code:
CMD:togversion(playerid,params[])
{
if (
IsPlayerAdmin(playerid))//change this to your admin system
{
if(
versioncheck ==0)//if the version is ON
{
 
versioncheck =1;
 
SendClientMessage(playerid,-1,".: VERSION OFF :.");
 }
 else if(
versioncheck ==1)//if the version is OFF
 
{
 
versioncheck =0;
 
SendClientMessage(playerid,-1,".: VERSION ON :.");
 }
 }
return 
1;
 } 
I can do it on fewer lines like that:
PHP Code:
 CMD:togversion(playerid)
 {
     if(!
IsPlayerAdmin(playerid)) return 1;
     if(
versioncheck == falseversioncheck trueSendClientMessage(playerid,-1,".: VERSION ON :.");
     else 
versioncheck falseSendClientMessage(playerid,-1,".: VERSION OFF :.");
     return 
1;
 } 
spaghetti code...

thanks for your shit long code mate!

P.S: we need quality/rapidity, not the longer
Reply
#8

Quote:
Originally Posted by Xeon™
View Post
Ok here we go, I've reviewed your code.

1- Indentation is killed.

2- You forget #define FILTERSCRIPT

3-
PHP Code:
new versioncheck
This variable will take only two cases, false or true, so you have to use bool: tag like this.

PHP Code:
new bool:versioncheck
4- You are declaring 3 arrays for 3 strings you could optimize that by using only 2.

5-
PHP Code:
if(strcmp(versionstring"0.3.7-R2"))//checking if that string has the wanted version.
{

waste of lines you could use
PHP Code:
if(!strcmp(versionstring"0.3.7-R2")) 
instead

6-
PHP Code:
format(messagestringsizeof(messagestring), " Server Has Kicked %s, Reason : OLD CLIENT VERSION %s "playername,versionstring);
SendClientMessageToAll(-1,messagestring);
SetTimerEx("DelayedKick",1000false"i"playerid);//delaying both the kick and the message to make sure the player gets the messages on time.
SetTimerEx("DelayedMessages",500,false,"i",playerid);//thats  the delayed message 
Delayed message

waste of lines and CPU usage, you could send directly the messages (your messages won't appear to the player because the second one will be called after delayed kick finish and that's not cool.

7 -
PHP Code:
SetPlayerWeather(playerid999);//blinding the player on his disconnect to make sure he's totally out.
SetPlayerVirtualWorld(playerid999);//same as above
SetPlayerInterior(playerid,999);//same as above 
You are wrong mate, these are a valid values. VW 999 exists same for others.

8-
PHP Code:
CMD:togversion(playerid,params[])
{
if (
IsPlayerAdmin(playerid))//change this to your admin system
{
if(
versioncheck ==0)//if the version is ON
{
 
versioncheck =1;
 
SendClientMessage(playerid,-1,".: VERSION OFF :.");
 }
 else if(
versioncheck ==1)//if the version is OFF
 
{
 
versioncheck =0;
 
SendClientMessage(playerid,-1,".: VERSION ON :.");
 }
 }
return 
1;
 } 
I can do it on fewer lines like that:
PHP Code:
 CMD:togversion(playerid)
 {
     if(!
IsPlayerAdmin(playerid)) return 1;
     if(
versioncheck == falseversioncheck trueSendClientMessage(playerid,-1,".: VERSION ON :.");
     else 
versioncheck falseSendClientMessage(playerid,-1,".: VERSION OFF :.");
     return 
1;
 } 
spaghetti code...

thanks for your shit long code mate!

P.S: we need quality/rapidity, not the longer
Okay, here we go:
1- the indenation isn't killed.
2- the purpose was for this to be a snippet not an FS as i've said before in my post, anyone can put #define fs...
3- okay, that's true bool could've been used, made the code pretty quick so didn't notice.
4- i have no fucken clue what you said right there, using the same string for the version,message? the string formats the version what the fuck are you on about "mate" ?
5- i made the code, i wanted to give the ability to do something whether the version was true or false, that's why i put a comment there if you could put on your glasses and read well.
6- delayed the message to send them to the player, you can try it by yourself, send messages onplayerconnect and see if they're there every time, if that works i'll delete the thread.
7- the values do exist but im messing it all up as to when the player is kicked he can't see anything.
8- i don't think you read my post well, the reason for this was to " SHOW PEOPLE HOW ITS DONE ", but instead you got no shit to do so you come off by being a fuckhead to random people, well guess what, fuck you and your irrelevant code take that shit somewhere else you wanker.
Reply
#9

Well, I meant that for example 0.3.7 can't connect 0.3.8
Or 0.3z can't connect 0.3.7
something like that
Reply
#10

Quote:
Originally Posted by SonnyGamer
View Post
Well, I meant that for example 0.3.7 can't connect 0.3.8
Or 0.3z can't connect 0.3.7
something like that
Oh well i dunno maybe in later versions people would want to forbid or limit down to a version that can be reached to through other versions, since 0.3.7 can already connect to 0.3.7-R2 which is used by many same for 0.3.7, you never know, thanks for the support tho really appreciated.
Reply
#11

Here you go mate, a well-scripted snippet, better than this shit.

http://forum.sa-mp.com/showpost.php?...postcount=1230
Reply
#12

Quote:
Originally Posted by Xeon™
View Post
Here you go mate, a well-scripted snippet, better than this shit.

http://forum.sa-mp.com/showpost.php?...postcount=1230
is this guy fucking autistic or what? go test your code on an online server with a ping ranging from 200 to above and see if you'll get those onplayerconnect messages, thats for starters, second of all your code consists of 42 lines yet still doesn't have as much functions as i did on mine nor will the players receieve those onplayerconnect messages nor is it as explained as mine, you're either a pure fuckhead or just a dumbass nolifer succeeding at being a fuckhead, which is congrats you have succeeded at.
Reply
#13

Quote:
Originally Posted by RogueDrifter
View Post
is this guy fucking autistic or what? go test your code on an online server with a ping ranging from 200 to above and see if you'll get those onplayerconnect messages, thats for starters, second of all your code consists of 42 lines yet still doesn't have as much functions as i did on mine nor will the players receieve those onplayerconnect messages nor is it as explained as mine, you're either a pure fuckhead or just a dumbass nolifer succeeding at being a fuckhead, which is congrats you have succeeded at.
wow, thanks.
Reply
#14

Quote:
Originally Posted by Xeon™
View Post
wow, thanks.
You're very welcome, now go find something more productive to do other than post harassing comments on other people's posts who were trying to help others and acting like a fuckhead for no absolute reason, have a good one "mate".
Reply
#15

Quote:
Originally Posted by RogueDrifter
View Post
You're very welcome, now go find something more productive to do other than post harassing comments on other people's posts who were trying to help others and acting like a fuckhead for no absolute reason, have a good one "mate".
we both know this how gonna end, so you do rather like deleting this thread by yourself or it will get deleted and you will get a bonus with it. most likely ban
Reply
#16

Quote:
Originally Posted by Xeon™
View Post
we both know this how gonna end, so you do rather like deleting this thread by yourself or it will get deleted and you will get a bonus with it. most likely ban
i'm shivering, literally, please don't freak me out like that, you're the most likely to get a ban for being an ass outta nowhere, also, posting a snippet under a post called useful snippets and calling it useless, yeah you've been proven to be your true self, gj. (even though it isnt useless and can be used on 0.3.7-R2 servers to prevent 0.3.7 users from connecting).
Reply
#17

I think we should support each other rather than insulting. Someone will always be better than someone else in scripting or in anything..so from my point of view, there should be room only for teaching and learning.. Not insulting..

Good job for the effort you put in for this script. Take negative comments as a motivation to do better later on.
Reply
#18

Quote:
Originally Posted by Lucky13
View Post
I think we should support each other rather than insulting. Someone will always be better than someone else in scripting or in anything..so from my point of view, there should be room only for teaching and learning.. Not insulting..

Good job for the effort you put in for this script. Take negative comments as a motivation to do better later on.
Thank you, finally someone being rational, i already do and i've already gotten something useful out of it and hopefully given out something useful as well to others, i would happily take negative comments as a respectful mature criticizem not a little kid ranting out " this is shit " and whinning like a 6 year old.
Reply
#19

Quote:
Originally Posted by RogueDrifter
View Post
Thank you, finally someone being rational, i already do and i've already gotten something useful out of it and hopefully given out something useful as well to others, i would happily take negative comments as a respectful mature criticizem not a little kid ranting out " this is shit " and whinning like a 6 year old.
No problem. Just be happy, have a will to do it and have patience. You'll be far. Everyone had to learn walking before running.
Reply
#20

@Lucky13 True, thanks again for the support,
@Barnwell Thanks.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)