Gpci banning
#1

Hello guys,

I'm scripting a GPCI ban system for someone. (Extra on the regular ban system)
I've used this part of code to check if he is GPCI banned.. (This is from OnPlayerConnect)

Код:
	new zSerial[128], serialfile[128], pName[MAX_PLAYER_NAME], info[128];
	GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	format(serialfile,128,"GPCI/%s.txt",zSerial);
	format(info,128,"[SEC]:%s was kicked.[Reason: Hash Banned]",pName);
	gpci(playerid, zSerial, 128);
	if(strcmp(zSerial,serialfile)) ABroadCast(0xFF0000FF, info, 2) && Kick(playerid);
But it kicks players even if his GPCI isn't in the GPCI map.
At the moment there is no GPCI saved in the GPCI map but it still kicks every player.
This is the code to save GPCI's:

Код:
stock BanGPCI(playerid)
{
	gpci(playerid, pSerial, 128);
	new file[128];
	format(file,128,"GPCI/%s.txt",pSerial);
	if(!fexist(file)) fcreate(file);
	return 0;
}
I hope somebody can help me!

Best of luck
Reply
#2

GPCI is NOT a UNIQUE serial , so many players will have the same serial and they will cannot join your server. I recommend you do not use gpci in a ban system.
Reply
#3

Quote:
Originally Posted by AdmBot
Посмотреть сообщение
GPCI is NOT a UNIQUE serial , so many players will have the same serial and they will cannot join your server. I recommend you do not use gpci in a ban system.
This still doesn't solve my problem.
Reply
#4

Right now all I see is you are comparing the gpci to a file path string. Which is always true. And you don't check if the file exists.

Код:
new zSerial[128], serialfile[128], pName[MAX_PLAYER_NAME], info[128];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
gpci(playerid, zSerial, 128);
format(serialfile,128,"GPCI/%s.txt",zSerial);

if(fexist(serialfile)) {
	format(info,128,"[SEC]:%s was kicked.[Reason: Hash Banned]",pName);
	ABroadCast(0xFF0000FF, info, 2) && Kick(playerid);
	return true;
}
Reply
#5

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)