[FilterScript] Version kick.
#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


Messages In This Thread
Version kick. - by RogueDrifter - 09.12.2017, 17:35
Re: Version kick. - by Xeon™ - 09.12.2017, 18:00
Re: Version kick. - by IllidanS4 - 09.12.2017, 18:01
Re: Version kick. - by RogueDrifter - 09.12.2017, 18:07
Re: Version kick. - by SonnyGamer - 09.12.2017, 18:25
Re: Version kick. - by RogueDrifter - 09.12.2017, 18:27
Re: Version kick. - by Xeon™ - 09.12.2017, 18:34
Re: Version kick. - by RogueDrifter - 09.12.2017, 18:45
Re: Version kick. - by SonnyGamer - 09.12.2017, 18:56
Re: Version kick. - by RogueDrifter - 09.12.2017, 19:00
Re: Version kick. - by Xeon™ - 09.12.2017, 19:04
Re: Version kick. - by RogueDrifter - 09.12.2017, 19:08
Re: Version kick. - by Xeon™ - 09.12.2017, 19:10
Re: Version kick. - by RogueDrifter - 09.12.2017, 19:13
Re: Version kick. - by Xeon™ - 09.12.2017, 19:16
Re: Version kick. - by RogueDrifter - 09.12.2017, 19:18
Re: Version kick. - by Lucky13 - 09.12.2017, 19:21
Re: Version kick. - by RogueDrifter - 09.12.2017, 19:23
Re: Version kick. - by Lucky13 - 09.12.2017, 19:27
Re: Version kick. - by RogueDrifter - 09.12.2017, 19:30
Re: Version kick. - by rfr - 09.12.2017, 19:33
Re: Version kick. - by rfr - 09.12.2017, 19:36
Re: Version kick. - by RogueDrifter - 09.12.2017, 19:43
Re: Version kick. - by rfr - 09.12.2017, 20:17
Re: Version kick. - by RogueDrifter - 09.12.2017, 20:50
Re: Version kick. - by R4nd4ll - 09.12.2017, 23:50
Re: Version kick. - by Killa[DGZ] - 10.12.2017, 00:44
Re: Version kick. - by Dignity - 10.12.2017, 00:46
Re: Version kick. - by SquirrelLSRP - 10.12.2017, 00:55
Re: Version kick. - by RogueDrifter - 10.12.2017, 01:30
Re: Version kick. - by Abagail - 10.12.2017, 03:39
Re: Version kick. - by Infinity - 10.12.2017, 07:44
Re: Version kick. - by RogueDrifter - 10.12.2017, 09:49
Re: Version kick. - by Xeon™ - 10.12.2017, 11:24
Re: Version kick. - by Wisam - 10.12.2017, 12:16
Re: Version kick. - by rfr - 10.12.2017, 12:32
Re: Version kick. - by RogueDrifter - 10.12.2017, 12:39
Re: Version kick. - by GhostHacker9 - 10.12.2017, 12:45
Re: Version kick. - by RogueDrifter - 10.12.2017, 12:55
Re: Version kick. - by Infinity - 10.12.2017, 12:56

Forum Jump:


Users browsing this thread: 2 Guest(s)