Witam,
mam problem z pluginem siłownia. Powinien on dawać określoną prędkość po zrobieniu określonej liczby przysiadów lecz nie daje. Daje natomiast wtedy gdy np trzymamy jakaś bron i zaczniemy z niej strzelać, wtedy prędkość się pojawia tyle, że jest ona za duża tak jakby wartość dodatkowej prędkości którą powinno dodać raz do maxspeed dodało kilka razy, a gdy zmienimy broń np na nóż znów biegamy normalnie...
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fakemeta_util> #define PLUGIN "JailBreak: Silownia" #define VERSION "1.0" #define AUTHOR "Sn!ff3r" new ducks[33] new Float:speeds[] = { 0.0, 5.0, 10.0, 15.0, 25.0 } public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("CurWeapon", "CurWeapon", "be", "1=1") register_forward(FM_PlayerPreThink, "PlayerPreThink", 0) register_clcmd("say /silownia", "client_say") } public client_say(id) { if(get_user_team(id) != 1) { client_print(id, print_chat, "= gryps: Nie jestes wiezniem.") return } client_print(id, print_chat, "= gryps: Twoje statystyki na silowni:") client_print(id, print_chat, "= gryps: [ Przysiady: %d razy ]", ducks[id]) } public client_disconnect(id) { ducks[id] = 0 } public PlayerPreThink(id) { if(!is_user_alive(id)) return FMRES_IGNORED if(pev(id, pev_oldbuttons) & IN_DUCK && !(pev(id, pev_button) & IN_DUCK) && get_user_team(id) == 1) { static s_iFlags s_iFlags = pev(id, pev_flags) if(/*!*/(s_iFlags & FL_DUCKING)/* && pev(id, pev_bInDuck)*/) { ducks[id] ++ } } return FMRES_IGNORED; } public CurWeapon(id) { if(is_user_alive(id) && get_user_team(id) == 1) { switch(ducks[id]) { case 50 .. 100: fm_set_user_maxspeed(id, fm_get_user_maxspeed(id) + speeds[1]) case 101 .. 200: fm_set_user_maxspeed(id, fm_get_user_maxspeed(id) + speeds[2]) case 201 .. 300: fm_set_user_maxspeed(id, fm_get_user_maxspeed(id) + speeds[3]) case 301 .. 1000: fm_set_user_maxspeed(id, fm_get_user_maxspeed(id) + speeds[4]) default: {} } } }
Błąd jest chyba z CurWeapon, ale ja nie umiem tego naprawić