RSSy MYGO.pl Opublikowano Czerwiec 20, 2023 o 15:40 RSSy Udostępnij Opublikowano Czerwiec 20, 2023 o 15:40 Hello. I would like some modifications to the plugin mentioned below. When players type "/afk" and enter the system, the screen should become transparently red, but the game should still be visible. When players type "/afk" and exit the system, the screen should return to normal. The plugin I mentioned is: #pragma semicolon 1 #include <amxmodx> #include <reapi> new bool:g_blPlayerAFK[MAX_PLAYERS+1]; public plugin_init(){ register_plugin("Is Player AFK", "0.1", "` BesTCore;"); /*Duzenleme: By.KinG*/ RegisterHookChain(RG_CBasePlayer_Spawn, "RG_CBasePlayer_Spawn_Post", .post = true); register_clcmd("say /afk", "clcmd_afk"); register_clcmd("say", "clcmd_say"); register_clcmd("say_team", "clcmd_say"); } public clcmd_say(const id){ if(g_blPlayerAFK[id]){ client_print_color(id, id, "^3Afk sisteminde olduğunuz için mesajlaşamazsınız, çıkış yapmak için ^4/afk^3 yazınız."); show_hudmessage(id, "^3Afk sisteminde olduğunuz için mesajlaşamazsınız, çıkış yapmak için ^4/afk^3 yazınız.", 0.45, 0.05, 1.0, 1.0, 0, 0.1, 1.0); return PLUGIN_HANDLED; } return PLUGIN_CONTINUE; } public RG_CBasePlayer_Spawn_Post(const id){ if(get_member(id, m_bJustConnected)){ return; } if(g_blPlayerAFK[id]){ set_task(5.0, "UserKill", id); } } public UserKill(id){ client_print_color(id, id, "^3Afk sisteminde olduğunuz için slaylandınız, çıkış yapmak için ^4/afk^3 yazınız."); show_hudmessage(id, "^3Afk sisteminde olduğunuz için slaylandınız, çıkış yapmak için ^4/afk^3 yazınız.", 0.45, 0.05, 1.0, 1.0, 0, 0.1, 1.0); user_kill(id, 1); set_entvar(id, var_frags, 0.0); set_member(id, m_iDeaths, 0); } public clcmd_afk(const id){ if(g_blPlayerAFK[id]){ client_print_color(id, id, "^3Başarılı bir şekilde afk sisteminden çıkış yaptınız."); show_hudmessage(id, "^3Başarılı bir şekilde afk sisteminden çıkış yaptınız.", 0.45, 0.05, 1.0, 1.0, 0, 0.1, 1.0); g_blPlayerAFK[id] = false; return PLUGIN_HANDLED; } else { g_blPlayerAFK[id] = true; client_print_color(id, id, "^3Afk sistemine giriş yaptınız, her el başı slaylanacak ve artık mesaj atamayacaksınız."); show_hudmessage(id, "^3Afk sistemine giriş yaptınız, her el başı slaylanacak ve artık mesaj atamayacaksınız.", 0.45, 0.05, 1.0, 1.0, 0, 0.1, 1.0); if(is_user_alive(id)){ set_task(5.0, "UserKill", id); } } return PLUGIN_HANDLED; } public client_disconnected(id){ g_blPlayerAFK[id] = false; } Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi