• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Whitelist System
#3
(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;


  Reply


Messages In This Thread
Whitelist System - by Genon_May - 2021-03-23, 08:42 AM
RE: Whitelist System - by Pinch - 2021-03-23, 10:02 AM
RE: Whitelist System - by RhaegarX - 2021-03-23, 12:37 PM
RE: Whitelist System - by Genon_May - 2021-03-23, 03:05 PM

Forum Jump: