#include <amxmodx> #include <fakemeta> #include <hamsandwich> #pragma semicolon 1 new const PLUGIN[] = "Limit skokow"; new const VERSION[] = "v1.0"; new const AUTHOR[] = "KoRrNiK"; new userJump[33]; new userLimitJump[33]; new const additionalJump = 1; // Ilość dodatkowych skoków new const limitJump = 3; // Ilość powtórzeń public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_forward(FM_CmdStart, "cmdStart"); RegisterHam(Ham_Spawn, "player", "spawnHam", 1); } public spawnHam(id){ if(!is_user_alive(id)) return; userLimitJump[id] = limitJump; userJump[id] = additionalJump; } public cmdStart(id, uc_handle){ if (!is_user_alive(id)) return FMRES_IGNORED; static Float:velocity[3], button, oldButton, flags; button = get_uc(uc_handle, UC_Buttons); oldButton = pev(id, pev_oldbuttons); flags = pev(id, pev_flags); if ((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldButton & IN_JUMP) && userJump[id]) { if(userLimitJump[id] >= 0){ userJump[id]--; pev(id, pev_velocity, velocity); velocity[2] = random_float(265.0, 285.0); set_pev(id, pev_velocity, velocity); } } else { if (flags & FL_ONGROUND){ if(!userJump[id]) userLimitJump[id]--; userJump[id] = additionalJump; } } return FMRES_IGNORED; }Trzymaj
