open.mp forum
Whitelist System - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: General Discussions (https://forum.open.mp/forumdisplay.php?fid=6)
--- Thread: Whitelist System (/showthread.php?tid=1795)



Whitelist System - Genon_May - 2021-03-23

Hey, im wondering does anyone know where i can find a whitelist system for samp. There used to be a few on the samp forums but cant reach them right now since they are down. If anyone knows where i can find one (english version) i would be very grateful


RE: Whitelist System - Pinch - 2021-03-23

I don't have one, you can check the old forum's web archive but why don't you just create one yourself? It's like 7-8 minutes max (including time it takes to create a table)


RE: Whitelist System - RhaegarX - 2021-03-23

(2021-03-23, 08:42 AM)Genon_May Wrote: Hey, im wondering does anyone know where i can find a whitelist system for samp. There used to be a few on the samp forums but cant reach them right now since they are down. If anyone knows where i can find one (english version) i would be very grateful



If you use MySQL, the initial logic of the system would be this:

PHP Code:
public OnPlayerConnect(playerid)

{

? ? ? new 
query[60], str[16];

? ? ? 
//?SQL query that checks if the player's IP is in the whitelist table

? ? ??GetPlayerIp(playeridstrsizeof(str));

? ? ? 
mysql_format(ConexaoSQLquerysizeof(query), "SELECT `*` FROM `whitelist` WHERE `ip` = '%s'"str);

? ? ? 
mysql_tquery(ConexaoSQLquery"OnVerifiedWhiteList""i"playerid);

}



forward OnVerifiedWhiteList(playerid);

public 
OnVerifiedWhiteList(playerid)

{

? ? 
// if the player is on the whitelist

? ? if (cache_num_rows() > 0)

? ? {

? ? ? ? 
// Player Login

? ? }

? ? 
// if the player is not on the whitelist

? ? else

? ? {

? ? ? ? 
Kick(playerid);

? ? }

? ? return 
1;





RE: Whitelist System - Genon_May - 2021-03-23

Hey thanks for trying to help me i really appreciate it. I found one already today after 1 hour of googling xd, already implemented on my server, sorry for the incovenience.