Zacząłem sobie pisać prosty plugin w którym miały być monety i miały one razem z hp pokazywac sie na hudzie calosc wyglada tak
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #include <fakemeta> #include <hamsandwich> #include <core> #include <fakemeta_util> #include <colorchat> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" #define MONETY_RUNDA 5 new monety[33] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say test" , "test") register_clcmd("say test2" , "test2") register_logevent("Koniec_Rundy", 2, "1=Round_End") } public client_putinserver() { set_task(1.0,"hud",_,_,_,"b") } public Koniec_Rundy(id) { monety[id]=monety[id]+MONETY_RUNDA ColorChat(id,GREEN,"^x01 Dostales ^x03%d^x04 Monet",MONETY_RUNDA) } public hud(id) { set_hudmessage(255, 0, 0, 0.05, 0.90) show_hudmessage(id, "HP: %d Monety: %d",get_user_health(id),monety[id]) } public test(id) { client_print(id,3,"hp %d monety %d ",get_user_health(id),monety[id]) } public test2(id) { set_hudmessage(255, 0, 0, 0.2, 0.90,_,_,_,_,_,2) show_hudmessage(id, "HP: %d monety: %d",get_user_health(id),monety[id]) }
problem polega na tym ze wiadomosc hud odświeżana przez taska pokazuje caly czas 0hp wpisujac test2 wiadomosc poprawnie wyswietla hp drugi problem jest taki ze po skonczeniu rundy dostajemy monety i caly czas jest problem z hudem na hudzie gdzie jest wyswietlane 0hp monety pokazuje sie normalnie z kazda kolejna runda +5 monet i sie wyswietlaja 5,10,15 itp ale jak wpisze test2 aby wyswietlil sie hud gdzie jest popranie pokazywane hp monety sa rowne 0 nie mam pojecia co moze nie dzialac w tak prostym kodzie ktos ma jakies pomysly?
Użytkownik rzeznik9871 edytował ten post 03.04.2016 22:01