CSPLague
saatli steamid girişi - Printable Version

+- CSPLague (https://www.csplague.com)
+-- Forum: CS 1.6 Plugin (Eklenti) Bölümü (https://www.csplague.com/forumdisplay.php?fid=6)
+--- Forum: [İSTEK] Cs 1.6 Plugin İstek Bölümü (https://www.csplague.com/forumdisplay.php?fid=80)
+---- Forum: Çözülmüş İstekler (https://www.csplague.com/forumdisplay.php?fid=87)
+---- Thread: saatli steamid girişi (/showthread.php?tid=7194)



saatli steamid girişi - shakespeare - 24-03-13

canberk daha önce de dedigim gibi /ekle steamid yazınca ini dosyasına steamid ekletiyorduk ya. Onun saatli olanını istiyorum yani atıyorum adam ini dosyasına 7-8 gibi bir başlık atıp altına o saat aralıgında girecek steam idleri yazacak. Mesela dedigim şu. Saat 7-8 arasında yazdıgı steamid ler, saat 8 - 9 arasında yazan steamid ler girecek sunucuya. onun dışında hiçbir kimse giremeyecek.

Örnek ini dosyası:

7-8
steam_0:0:12312312312
steam_0:0:12312312312
steam_0:0:12312312312

8-9
steam_0:0:12312312312
steam_0:0:12312312345
steam_0:0:12312312352


Cevap: saatli steamid girişi - akcaliberkk - 25-03-13

PHP Code:
/* 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(PLUGINVERSIONAUTHOR)
    
    if(!
file_exists(file)) {
        new 
fopen(file,"wt")
        
fclose(f);
    }
    
}
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;
    


senin dediğin yöntem daha karmaşık bir algoritma gerektiriyor, onun için zamanım yoktu. Şöyle bir şey yaptım bir dene.


"saatdakika-saatdakika" "id"
"0800-2000" "steamid"
"0930-2145" "steamid"


Cevap: saatli steamid girişi - shakespeare - 26-03-13

çok güzel çalışıyor, ellerin dert görmesin. Bana vakit ayırdıgın icin teşekkür ederim.


Cevap: saatli steamid girişi - akcaliberkk - 26-03-13

Rica ederim. Çözülmüş İsteklere taşındı.