PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "SteamID WhiteList"
#define VERSION "1.0"
#define AUTHOR "akcaliberkk"
new const file[] = "addons/amxmodx/configs/STEAMID.ini"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /tarama","cmdTara")
if(!file_exists(file)) {
new f = fopen(file,"wt")
fclose(f);
}
}
public cmdTara(id) {
if(!access(id,ADMIN_BAN)) return PLUGIN_CONTINUE
new players[32],inum;
get_players(players,inum)
new steamid[32];
new LineTime[32],LineID[32];
new szLineText[64],txtlen;
new maxlines = file_size(file,1)
new tempid;
for(new i;i<inum;i++) {
tempid = players[i];
get_user_authid(tempid,steamid,31)
for(new line;line<maxlines;line++) {
read_file(file,line,szLineText,63,txtlen)
parse(szLineText,LineTime,31,LineID,31)
if(!(correct_time(LineTime) && equali(LineID,steamid))) {
server_cmd("kick #%d ^"SteamID'niz Listede Bulunmamaktadir.^"",get_user_userid(tempid))
}
}
}
return PLUGIN_HANDLED
}
public client_authorized(id) {
new steamid[32];
get_user_authid(id,steamid,31)
new LineTime[32],LineID[32];
new szLineText[64],txtlen;
new maxlines = file_size(file,1)
for(new line;line<maxlines;line++) {
read_file(file,line,szLineText,63,txtlen)
parse(szLineText,LineTime,31,LineID,31)
if(correct_time(LineTime) && equali(LineID,steamid)) {
return PLUGIN_CONTINUE
}
}
server_cmd("kick #%d ^"SteamID'niz Listede Bulunmamaktadir.^"",get_user_userid(id))
return PLUGIN_HANDLED
}
stock correct_time(const szTime[]) {
new now[32];
new mintime[32],maxtime[32];
new iMinTime,iMaxTime,iTime;
get_time("%H%M",now,31);
copy(mintime,4,szTime)
copy(maxtime,4,szTime[5])
iMinTime = str_to_num(mintime)
iMaxTime = str_to_num(maxtime)
iTime = str_to_num(now)
if(iMinTime <= iTime <= iMaxTime) return true;
return false;
}