teszt nem volt, de lefut
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <ColorChat>
new jump[33];
//MultiJump
new jumpnum[33] = 0
new bool:dojump[33] = false
public plugin_init()
{
register_plugin("JumpMenu", "1.0", "Vinnice");
register_clcmd("chooseteam","JumpMenu")
public client_putinserver(id)
{
jumpnum[id] = 0;
dojump[id] = false;
}
public client_disconnect(id)
{
jump[id] = 0;
jumpnum[id] = 0;
dojump[id] = false;
}
public JumpMenu(id)
{
new menu = menu_create("\d[UgrásMenü]^n\rVálassz!:", "JumpMenu_handler");
menu_additem(menu, "1 ugrás", "1", 0);
menu_additem(menu, "2 ugrás", "2", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_setprop(menu, MPROP_EXITNAME, "Kilep");
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public JumpMenu_handler(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}
new command[6], name[64], access, callback;
menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
switch(item)
{
case 1:
{
jump[id] = 1;
ColorChat(id, RED,"[JumpMenu]^x03 Maximum 1-et ugorhatsz!")
}
case 2:
{
jump[id] = 2;
ColorChat(id, RED,"[JumpMenu]^x03 Maximum 2-öt ugorhatsz!")
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
/* MultiJump */
public client_PreThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE;
new nbut = get_user_button(id);
new obut = get_user_oldbutton(id);
if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
{
if(jumpnum[id] < jump[id])
{
dojump[id] = true;
jumpnum[id]++;
return PLUGIN_CONTINUE
}
}
if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
{
jumpnum[id] = 0;
return PLUGIN_CONTINUE;
}
return PLUGIN_CONTINUE;
}
public client_PostThink(id)
{
if(!is_user_alive(id)) return PLUGIN_CONTINUE;
if(dojump[id] == true)
{
new Float:velocity[3];
entity_get_vector(id,EV_VEC_velocity,velocity);
velocity[2] = random_float(265.0,285.0);
entity_set_vector(id,EV_VEC_velocity,velocity);
dojump[id] = false;
return PLUGIN_CONTINUE;
}
return PLUGIN_CONTINUE;
}