Witam. Tak więc zrobiłem sobie swoje proste menu z możliwością robienia ss'ów wybranym graczom lub wszystkim naraz. Gdy chce zrobić ss'y wybranemu graczowi to nie ma problemu , jednak gdy chce wykonać tę operację na wszystkich graczach to plugin zaczyna świrować i robi np. około 70 screenów przy 10 graczach (bez HLTV) i w ogóle miesza dane. Różnych sposobów próbowałem , niektóre są tam skomentowane ale prawie zawsze ten sam efekt albo crash Error logów brak.
Proszę o pomoc z tą częścią.
Spoiler
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <colorchat> new const PLUGIN[] = "Menu SS"; new const VERSION[] = "1.0"; new const AUTHOR[] = "Ogen Dogen"; new const UB[] = "www.strona.pl"; new Num,Players[32],g_Menu,i; new nick[32],sid[32],ip[32]; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("ss_menu","menu_ss"); } public menu_ss(id) { new menussy = menu_create("Wybor trybu SS","menussy_handle"); menu_additem(menussy,"SS'y dla gracza"); menu_additem(menussy,"SS'y dla wszystkich"); menu_setprop(menussy,MPROP_EXITNAME, "Wyjdz"); menu_display(id,menussy,0); return PLUGIN_HANDLED; } public menussy_handle(id,menu,item) { if (item == MENU_EXIT) return PLUGIN_HANDLED; switch(item) { case 0: { get_players(Players,Num); g_Menu = menu_create("Menu Screenshota","ssy_gracz"); for (i=0 ; i<Num ; i++) { new id=Players[i]; get_user_name(id,nick,31); menu_additem(g_Menu,nick); } menu_setprop(g_Menu,MPROP_BACKNAME,"Cofnij"); menu_setprop(g_Menu,MPROP_NEXTNAME,"Dalej"); menu_setprop(g_Menu,MPROP_EXITNAME,"Wyjdz"); menu_display(id,g_Menu,0); return PLUGIN_HANDLED; } case 1: { get_players(Players,Num); for (i=0 ; i<Num ; i++) { new id=Players[i]; if (is_user_connected(id) && !is_user_hltv(id) && !is_user_bot(id)) { //set_task(1.5,"ssy_all",_,_,_,"a",1); ssy_all(id); } } } } return PLUGIN_HANDLED; } new zid,nick2[32],hostname[64],czas[32],dzisiejsza_data[32]; public ssy_all(id) { zid = id; get_user_authid(id,sid,31); get_user_ip(id,ip,31,1); get_user_name(id,nick2,31); get_cvar_string("hostname",hostname,63); get_time("%H:%M:%S",czas,31); // godzina get_time("%x",dzisiejsza_data,31); // data set_hudmessage(255, 255, 255, -1.0, 0.07, 0, 0.0, 2.0, 0.01, 0.2, 1); show_hudmessage(id, "Nick : %s | SID: %s | IP: %s",nick2,sid,ip); set_hudmessage(255, 255, 255, -1.0, 0.12, 0, 0.0, 2.0, 0.01, 0.2, 2) show_hudmessage(id, "Data %s %s",dzisiejsza_data,czas); set_hudmessage(255, 255, 255, -1.0, 0.15, 0, 0.0, 2.0, 0.01, 0.2, 3) show_hudmessage(id,"Serwer %s",hostname); set_hudmessage(255, 255, 255, -1.0, 0.18, 0, 0.0, 2.0, 0.01, 0.2, 4) show_hudmessage(id,"Wstaw SSy na : %s",UB); client_print(id,print_chat,"id = %i",id); ColorChat(id,YELLOW,"[SS] Gracz ^x04%s ^x01SID: ^x04%s ^x01IP: ^x04%s",nick2,sid,ip); ColorChat(id,YELLOW,"[SS] Wykonane ^x04%s %s",czas,dzisiejsza_data); ColorChat(id,YELLOW,"[SS] Serwer ^x04%s",hostname); ColorChat(id,YELLOW,"[SS] Wstaw SSy na : ^x04%s",UB); //client_cmd(id,"snapshot"); set_task(1.5,"dalsze_ssy_all",_,_,_,"a",4); /*set_task(3.0,"dalsze_ssy_all",_,_,_,"a",1); set_task(4.5,"dalsze_ssy_all",_,_,_,"a",1); set_task(6.0,"dalsze_ssy_all",_,_,_,"a",1);*/ } public dalsze_ssy_all(id) { get_user_authid(zid,sid,31); get_user_ip(zid,ip,31,1); get_user_name(zid,nick2,31); get_time("%H:%M:%S",czas,31); // godzina get_time("%x",dzisiejsza_data,31); // data /*format(wiadomosc_hud,499,"Nick : %s | SID: %s | IP: %s^nData %s %s^nSerwer %s^nWstaw SSy na : %s",nick2,sid,ip,dzisiejsza_data,czas,hostname,ub); set_hudmessage(255, 255, 255, -1.0, 0.07, 0, 0.0, 1.0, 0.01, 0.2, -1); show_hudmessage(pid,wiadomosc_hud);*/ set_hudmessage(255, 255, 255, -1.0, 0.07, 0, 0.0, 2.0, 0.01, 0.2, 1) show_hudmessage(zid, "Nick : %s | SID: %s | IP: %s",nick2,sid,ip); set_hudmessage(255, 255, 255, -1.0, 0.12, 0, 0.0, 2.0, 0.01, 0.2, 2) show_hudmessage(zid, "Data %s %s",dzisiejsza_data,czas); set_hudmessage(255, 255, 255, -1.0, 0.15, 0, 0.0, 2.0, 0.01, 0.2, 3) show_hudmessage(zid,"Serwer %s",hostname); set_hudmessage(255, 255, 255, -1.0, 0.18, 0, 0.0, 2.0, 0.01, 0.2, 4) show_hudmessage(zid,"Wstaw SSy na : %s",UB); ColorChat(zid,YELLOW,"[SS] Gracz ^x04%s ^x01SID: ^x04%s ^x01IP: ^x04%s",nick2,sid,ip); ColorChat(zid,YELLOW,"[SS] Wykonane ^x04%s %s",czas,dzisiejsza_data); ColorChat(zid,YELLOW,"[SS] Serwer ^x04%s",hostname); ColorChat(zid,YELLOW,"[SS] Wstaw SSy na : ^x04%s",UB); //client_cmd(id,"snapshot"); } new pid; new data[6], iName[64]; new aaccess, callback; public ssy_gracz(id,menu,item) { menu_item_getinfo(menu, item, aaccess, data,5, iName, 63, callback); pid = get_user_index(iName); if (item == MENU_EXIT) return PLUGIN_HANDLED; else { new iTarget = cmd_target(pid,iName,CMDTARGET_ALLOW_SELF | CMDTARGET_OBEY_IMMUNITY); if (iTarget) { get_user_authid(pid,sid,31); get_user_ip(pid,ip,31,1); get_user_name(pid,nick2,31); get_cvar_string("hostname",hostname,63); get_time("%H:%M:%S",czas,31); // godzina get_time("%x",dzisiejsza_data,31); // data set_hudmessage(255, 255, 255, -1.0, 0.07, 0, 0.0, 2.0, 0.01, 0.2, 1); show_hudmessage(pid, "Nick : %s | SID: %s | IP: %s",nick2,sid,ip); set_hudmessage(255, 255, 255, -1.0, 0.12, 0, 0.0, 2.0, 0.01, 0.2, 2) show_hudmessage(pid, "Data %s %s",dzisiejsza_data,czas); set_hudmessage(255, 255, 255, -1.0, 0.15, 0, 0.0, 2.0, 0.01, 0.2, 3) show_hudmessage(pid,"Serwer %s",hostname); set_hudmessage(255, 255, 255, -1.0, 0.18, 0, 0.0, 2.0, 0.01, 0.2, 4) show_hudmessage(pid,"Wstaw SSy na : %s",UB); ColorChat(pid,YELLOW,"[SS] Gracz ^x04%s ^x01SID: ^x04%s ^x01IP: ^x04%s",nick2,sid,ip); ColorChat(pid,YELLOW,"[SS] Wykonane ^x04%s %s",czas,dzisiejsza_data); ColorChat(pid,YELLOW,"[SS] Serwer ^x04%s",hostname); ColorChat(pid,YELLOW,"[SS] Wstaw SSy na : ^x04%s",UB); client_cmd(pid,"snapshot"); set_task(1.5,"dalsze_ssy",_,_,_,"a",1); set_task(3.0,"dalsze_ssy",_,_,_,"a",1); set_task(4.5,"dalsze_ssy",_,_,_,"a",1); set_task(6.0,"dalsze_ssy",_,_,_,"a",1); } } return PLUGIN_HANDLED; } public dalsze_ssy(id) { get_time("%H:%M:%S",czas,31); // godzina get_time("%x",dzisiejsza_data,31); // data /*format(wiadomosc_hud,499,"Nick : %s | SID: %s | IP: %s^nData %s %s^nSerwer %s^nWstaw SSy na : %s",nick2,sid,ip,dzisiejsza_data,czas,hostname,ub); set_hudmessage(255, 255, 255, -1.0, 0.07, 0, 0.0, 1.0, 0.01, 0.2, -1); show_hudmessage(pid,wiadomosc_hud);*/ set_hudmessage(255, 255, 255, -1.0, 0.07, 0, 0.0, 2.0, 0.01, 0.2, 1) show_hudmessage(pid, "Nick : %s | SID: %s | IP: %s",nick2,sid,ip); set_hudmessage(255, 255, 255, -1.0, 0.12, 0, 0.0, 2.0, 0.01, 0.2, 2) show_hudmessage(pid, "Data %s %s",dzisiejsza_data,czas); set_hudmessage(255, 255, 255, -1.0, 0.15, 0, 0.0, 2.0, 0.01, 0.2, 3) show_hudmessage(pid,"Serwer %s",hostname); set_hudmessage(255, 255, 255, -1.0, 0.18, 0, 0.0, 2.0, 0.01, 0.2, 4) show_hudmessage(pid,"Wstaw SSy na : %s",UB); ColorChat(pid,YELLOW,"[SS] Gracz ^x04%s ^x01SID: ^x04%s ^x01IP: ^x04%s",nick2,sid,ip); ColorChat(pid,YELLOW,"[SS] Wykonane ^x04%s %s",czas,dzisiejsza_data); ColorChat(pid,YELLOW,"[SS] Serwer ^x04%s",hostname); ColorChat(pid,YELLOW,"[SS] Wstaw SSy na : ^x04%s",UB); client_cmd(pid,"snapshot"); return PLUGIN_CONTINUE; }
Użytkownik Ogen Dogen edytował ten post 30.06.2013 19:07