komenda po x sekundach po respawnie
sq69i
12.06.2014
Witam, istnieje taka możliwość aby dodać do poniższego pluginu czas, tzn. po 10 sekundach po respawnie dodany zostanie longjump dla gracza
#include <amxmodx> #include <amxmisc> #include <fun> #define PLUGIN_NAME "Longjump" #define PLUGIN_VERSION "2.5" #define PLUGIN_AUTHOR "COLT" new longjump public plugin_init() { longjump = register_cvar("amx_longjump", "1") register_event("ResetHUD","player_spawn","b") register_event("DeathMsg", "DeathMsg", "a") register_event("Damage", "Event_DamageDeath", "bd", "2>0") register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR) } public player_spawn(id) { if(get_pcvar_num(longjump) == 1) { if(is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_C) { give_item(id, "item_longjump") message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},id); write_byte(1); // status (0=hide, 1=show, 2=flash) write_string("item_longjump"); // icon write_byte(0); // red write_byte(210); // green write_byte(0); // blue message_end(); } } }
BlackPerfum
12.06.2014
Witam, istnieje taka możliwość aby dodać do poniższego pluginu czas, tzn. po 10 sekundach po respawnie dodany zostanie longjump dla gracza
Tak, użyj set_task
sq69i
12.06.2014
Witam, istnieje taka możliwość aby dodać do poniższego pluginu czas, tzn. po 10 sekundach po respawnie dodany zostanie longjump dla gracza
Tak, użyj set_task
coś takiego?
register_event("ResetHUD","player_spawn","b")
zamienić na
set_task(10.01, "player_spawn", _, _, _, "c")
dobrze myślę?
sq69i
12.06.2014
zielony jestem w tym, chodzi o coś takiego?
#include <amxmodx>
#include <amxmisc>#include <fun>#define PLUGIN_NAME "Longjump"#define PLUGIN_VERSION "2.5"#define PLUGIN_AUTHOR "COLT"new longjumppublic plugin_init(){longjump = register_cvar("amx_longjump", "1")register_event("ResetHUD","player_spawn","b")register_event("DeathMsg", "DeathMsg", "a")register_event("Damage", "Event_DamageDeath", "bd", "2>0")register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)}public player_spawn(id){set_task(10.01, "player_spawn")if(get_pcvar_num(longjump) == 1){if(is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_C){give_item(id, "item_longjump")message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},id);write_byte(1); // status (0=hide, 1=show, 2=flash)write_string("item_longjump"); // iconwrite_byte(0); // redwrite_byte(210); // greenwrite_byte(0); // bluemessage_end();}}}
dzięki wielkie, długo tego szukałem
Użytkownik sq69i edytował ten post 12.06.2014 18:32
BlackPerfum
12.06.2014
Już prędzej:
public player_spawn(id) if(!task_exists(id)) set_task(10.0, "AddLJ",id) public AddLJ(id) { if(get_pcvar_num(longjump) == 1) { if(is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_C) { give_item(id, "item_longjump") message_begin(MSG_ONE,get_user_msgid("StatusIcon"),{0,0,0},id); write_byte(1); // status (0=hide, 1=show, 2=flash) write_string("item_longjump"); // icon write_byte(0); // red write_byte(210); // green write_byte(0); // blue message_end(); } } }