Plugin działa na takiej zasadzie, że gdy ktoś wyrzuci pake w czasie powiedzmy 10 sekund od startu rundy, jest slayowany.
Jaki efekt chciałbym uzyskać ?
Chciałbym, żeby w momencie gdy gracz wyrzuci pake, włączał się licznik ( powiedzmy 5 sekundowy) jest to czas w którym ten sam gracz, lub ktoś inny z drużyny musi podnieść bombę, Jeśli w ciągu 5 sekund nikt nie podniesie bomby, gracz jest slayowany.
#include <amxmodx> #include <amxmisc> #include <fun> #include <fakemeta> new index,cvar1,cvar2,cvar3,cvar4,cvar5; new Float:start, Float:end, Float:burytime; new origin[3]; public plugin_init() { register_plugin("Bomb Drop Slay","0.5","SweatyBanana"); register_dictionary("bombdict.txt") // bomb status // 1 - plugin on // 0 - plugin off cvar1 = register_cvar("bomb_status","1"); cvar2 = register_cvar("bomb_time","10.0"); cvar3 = register_cvar("bomb_punish","1"); cvar4 = register_cvar("bomb_slaphealth","50"); cvar5 = register_cvar("bomb_burytime","10.0"); if(engfunc(EngFunc_FindEntityByString, -1, "classname", "func_bomb_target") > 0) { register_logevent("f_spawned", 3, "2=Spawned_With_The_Bomb") register_logevent("f_dropped", 3, "2=Dropped_The_Bomb") } } public f_spawned() { if(get_pcvar_num(cvar1)==0) return PLUGIN_HANDLED; index = get_loguser_index(); start = get_gametime(); return PLUGIN_CONTINUE; } public f_dropped() { new user = get_loguser_index(); if(get_pcvar_num(cvar1)==0 || !is_user_alive(user)) return PLUGIN_HANDLED; end = get_gametime(); if(user==index && end-start<=get_pcvar_float(cvar2)) { f_punishuser(index); } return PLUGIN_CONTINUE; } public f_punishuser(index) { new punishment = get_pcvar_num(cvar3); new starthealth = get_user_health(index); new slaphealth = get_pcvar_num(cvar4); burytime = get_pcvar_float(cvar5); if(slaphealth<0 || burytime<0.0) { slaphealth = 50; burytime = 10.0; } new Name[33]; get_user_name(index,Name,32); set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 12.0); switch(punishment) { case 1: { user_kill(index,0); show_hudmessage(0,"%L",LANG_SERVER,"SLAY_U",Name); } case 2: { user_slap(index,slaphealth); show_hudmessage(0,"%L",LANG_SERVER,"SLAP",Name,starthealth-slaphealth); } case 3: { set_task(0.1,"f_bury",index); show_hudmessage(0,"%L",LANG_SERVER,"BURY",Name,floatround(burytime,floatround_floor)); } } } public f_bury(index) { get_user_origin(index,origin); origin[2] -= 50; set_user_origin(index,origin); set_task(burytime,"f_unbury",index); } public f_unbury(index) { get_user_origin(index,origin); origin[2] += 50; set_user_origin(index,origin); client_print(index,print_chat,"%L",LANG_SERVER,"UNBURY"); } stock get_loguser_index() { new loguser[80],name[32] read_logargv(0,loguser,79) parse_loguser(loguser,name,31) return get_user_index(name) }
plik tekstowy z jezykiem zawieral takie wpisy dla jezyka polskiego, o ile ktos potrzebuje
[pl]
SLAY_U = %s zostal zgladzony za ^nwyrzucenie bomby
SLAP = %s zostal uderzony do %i zycia za ^nwyrzucenie bomby
BURY = %s zostal zakopany na %f sekund za ^nwyrzucenie bomby
UNBURY = Zostales odkopany ^nNastepnym razem nie wyrzucaj bomby!