RSSy MYGO.pl Opublikowano Kwiecień 9, 2022 o 08:17 RSSy Udostępnij Opublikowano Kwiecień 9, 2022 o 08:17 Yesterday I tried to crete bot check for my plugin, the goal - after check do function. If it is bot and he has low health and armor he will type: "/health" and "/armor". I can't trigger that function, how can I realize it? PHP Code: #include <amxmodx> #include <fun> new maxhealth = 100; public plugin_init() { register_plugin("health", "CNC", "0.1") register_clcmd("say /health", "give_health") register_clcmd("health", "give_health") register_clcmd("say /armor", "give_armor") } public give_health(id) { if(is_user_alive(id)) { client_print(id, print_chat, "Health function called successfully") set_user_health(id, get_user_health(id) + 100) client_cmd(id, "spk items/medshot4") } else { client_print(id, print_chat, "You are dead!") } } public give_armor(id) { if(is_user_alive(id)) { client_print(id, print_chat, "Armor gain") set_user_armor(id, get_user_armor(id) + 100) client_cmd(id, "spk items/ammopickup1") } else { client_print(id, print_chat, "You are dead!") } } public client_putinserver(id) { set_task(0, "set_task_check", id) } public set_task_check(id) { if(is_user_alive(id)) { if(is_user_bot(id)) { console_print(id, "bot") } if(is_user_bot(id) && get_user_health(id) < maxhealth) { give_health(id) client_print(id, print_chat, "Bot healed") } if(is_user_bot(id) && get_user_armor(id) == 0) { give_armor(id); client_print(id, print_chat, "Bot armored") } } } set_task is not working. Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi