Miscstats help
Hi guys.
I tried to compile this plugin, but it has various errors. I need help to make these errors disappear. I'm brazilian, sorry. Plugin:
Spoiler
#include <translator>
#include <amxmod> #include <amxmisc> #include <fun> #include <VexdUM> #define AUTOMATIC_PRECACHING public MultiKill public MultiKillSound public BombPlanting public BombDefusing public BombPlanted public BombPlantedSound public BombDefused public BombDefusedSound public BombFailed public BombFailedSound public BombPickUp public BombDrop public BombCountHUD public BombCountVoice public BombCountDef public BombReached public ItalyBonusKill public EnemyRemaining public LastMan public LastManSound public KnifeKill public KnifeKillSound public GrenadeKill public GrenadeKillSound public GrenadeSuicide public GrenadeSuicideSound public HeadShotKill public HeadShotKillSound public RoundCounter public RoundCounterSound public KillingStreak public KillingStreakSound public KillingStreakChat public KillingStreakHUD public KillingStreakEndHUD public KillingStreakSay public DoubleKill public DoubleKillSound public TripleKill public TripleKillSound public PlayerName public FirstBloodSound public FallKill public Suicide public AirKill public WaterKill public WallShot new g_streakKills[33][2] new g_multiKills[33][2] new g_Planter new g_Defuser new g_C4Timer new g_mp_c4timer new g_Defusing new Float:g_LastOmg new Float:g_LastPlan new g_LastAnnounce new g_roundCount new Float:g_doubleKill new g_doubleKillId new Float:g_tripleKill new g_tripleKillId new g_friend[33] = {0,...} new g_firstBlood new g_kills[33] = {0,...} new g_deaths[33] = {0,...} new g_knife[33] = {0,...} new g_hs[33] = {0,...} new g_nade[33] = {0,...} new g_longestKillStreak[33] = {0,...} new g_longestDeathStreak[33] = {0,...} new Float:g_DeathStats[33] = {0.0,...} new g_disabledMsg[] = "Server has disabled that option" new Float:g_gameTime new g_funRunning new g_vexdRunning new g_MultiKillMsg[7][] = { "MULTI-KILL! %s^nwith %d kills (%d hs)", "MEGA-KILL!!! %s^nwith %d kills (%d hs)", "ULTRA-KILL!!! %s^nwith %d kills (%d hs)", "%s IS ON A KILLING SPREE!!!^nwith %d kills (%d hs)", "%s IS WICKEDSICK!!!^nwith %d kills (%d hs)", "RAMPAGE!!! %s^nwith %d kills (%d hs)", "%s IS UNSTOPPABLE!!!^nwith %d kills (%d hs)", "%s IS A MONSTER!^nwith %d kills (%d hs)", "%s IS A LUDACRISSKILL!^nwith %d kills (%d hs)", "%s IS GODLIKE!!!!^nwith %d kills (%d hs)", "%s IS A HOLYSHIT!^nwith %d kills (%d hs)", "%s IS DOMINATING!^nwith %d kills (%d hs)", "%s IS UNREAL!^nwith %d kills (%d hs)" } new g_Sounds[7][] = { "misc/multikill", "misc/megakill", "misc/ultrakill", "misc/killingspree", "misc/wickedsick", "misc/rampage", "misc/unstoppable", "misc/monsterkill", "misc/ludacrisskill", "misc/godlike", "misc/holyshit", "misc/dominating", "misc/unreal" } new g_KillingMsg[7][] = { "%s: MULTI-KILL!", "%s: MEGA-KILL!!!", "%s: ULTRA-KILL!!!", "%s IS ON A KILLING SPREE!!!", "%s: WICKEDSICK!!!", "%s: RAMPAGE!!!", "%s IS UNSTOPPABLE!!!", "%s IS A MONSTER!", "%s LUDACRISSKILL!!!", "%s IS GODLIKE!!!", "%s HOLYSHIT!!!", "%s DOMINATING!!!", "%s UNREAL!!!" } new g_KnifeMsg[4][] = { "%s corto e serviu %s", "%s tirou fora a faca e tacou em %s", "%s se escondeu bem cuidadosamente e pegou %s", "%s esfaqueou sem piedade %s" } new g_LastMessages[4][] = { "Agora todo mundo depende de voce!", "Acreditamos que voce ainda tenha vida!", "Todos seus amigos foram mortos, boa sorte!", "Agora voce esta sozinho, se divirta!" } new g_HeMessages[4][] = { "%s enviou um presentinho para %s", "%s mandou com precisao, uma granada para %s", "%s explodiu %sem mil pedacos" } new g_SHeMessages[4][] = { "%s detonou ele mesmo com uma granada", "%s tirou o pino da granada e ficou ^nolhando para ela", "%s colocou uma granada na sua propria bunda", "%s explodiu!" } new g_HeadShots[7][] = { "$kn matou $vn com um belo^ntiro na cabeca!", "$kn removeu a cabeca de $vn^ncom a $wn", "$kn transformou a cabeca de $vn^nem um pudim com a $wn", "$vn foi decapitado por $kn" } new g_FallKillMessages[3][] = { "%s tentou uma queda livre sem paraquedas!", "%s esqueceu de pular!", "%s esqueceu a existencia da gravidade!" } new g_SuicideMessages[2][] = { "%s sabe como o comando de matar funciona!", "%s preferiu se matar ao ter que lutar!" } new g_AirKillMessages[3][] = { "$vn foi morto por $kn^nenquanto estava no ar", "$vn foi morto por $kn^nenquanto voava feito um passarinho", "$vn nao conseguiu alcancar o chao^nporque foi morto antes por $kn" } new g_WaterKillMessages[3][] = { "$vn foi morto por $kn^nenquanto estava na agua", "$vn foi morto por $kn^nenquanto tomava banho", "$vn foi morto por $kn^nenquanto mergulhava" } new g_WallShotMessages[3][] = { "$kn matou $vn^nalem da parede :)", "$kn matou $vn^ncom um belo tiro na parede!", "$kn matou $vn^ncom seu wallhack! :)" } new g_teamsNames[2][] = { "TERRORIST", "CT" } public disable_natives_check() { } public plugin_init() { if(cvar_exists("amxmodx_version")) load_module("error") load_translations("miscstats") register_plugin(_T("Misc. Stats"),AMX_VERSION,"AMX Team") g_funRunning = (is_module_running("Fun")) g_vexdRunning = (is_module_running("VexdUM")) if(g_funRunning) { register_cvar("amx_bomb_frags","3") } if(g_vexdRunning) { if(!cvar_exists("amx_bomb_frags")) register_cvar("amx_bomb_frags","3") } register_clcmd("say /streak","cmdKillingStreak",0,_T("- display info. about your killing streak")) register_event("ResetHUD","eResetHud","be") register_event("DeathMsg","eDeathMsg","a") register_logevent("SuicideMsg",4,"1=committed suicide with") register_event("TextMsg","eRestart","a","2&#G ame_C","2&#Game_w") register_event("SendAudio","eEndRound","a","2 &%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_ro unddraw") register_event("RoundTime","eNewRound","bc") register_event("StatusValue","setTeam","be"," 1=1") register_event("StatusValue","showStatus","be ","1=2","2!0") register_event("StatusValue","hideStatus","be ","1=1","2=0") new mapname[32] get_mapname(mapname, 31) if(equali(mapname, "cs_italy")) { register_event("23","chickenKill","a","1=108" ,"15=4") register_event("23","radioKill","a","1=108"," 15=2") } else if(g_vexdRunning) { if((find_entity(-1, "info_bomb_target") > 0) || (find_entity(-1, "func_bomb_target") > 0)) { register_event("StatusIcon","eGotBomb","be"," 1=1","1=2","2=c4") register_event("SendAudio","eBombPlanted","a" ,"2&%!MRAD_BOMBPL") register_event("SendAudio","eBombDef","a","2& %!MRAD_BOMBDEF") register_event("TextMsg","eBombFail","a","2&# Target_B") register_event("BarTime","eBombDefG","be","1= 10","1=5","1=3") register_event("BarTime","eBombDefL","be","1= 0") register_event("TextMsg","eBombPickUp","bc"," 2&#Got_bomb") register_event("TextMsg","eBombDrop","bc","2& #Game_bomb_d") } } else if(equali(mapname, "de_", 3) || equali(mapname, "csde_", 5)) { register_event("StatusIcon","eGotBomb","be"," 1=1","1=2","2=c4") register_event("SendAudio","eBombPlanted","a" ,"2&%!MRAD_BOMBPL") register_event("SendAudio","eBombDef","a","2& %!MRAD_BOMBDEF") register_event("TextMsg","eBombFail","a","2&# Target_B") register_event("BarTime","eBombDefG","be","1= 10","1=5","1=3") register_event("BarTime","eBombDefL","be","1= 0") register_event("TextMsg","eBombPickUp","bc"," 2&#Got_bomb") register_event("TextMsg","eBombDrop","bc","2& #Game_bomb_d") } } public plugin_precache() { new filename[64] build_path(filename, 63, "$configdir/stats.ini") if(file_exists(filename)) { new text[256], name[32] new len, pos = 0, xid while((pos = read_file(filename, pos, text, 255, len))) { if(text[0] == ';' || !len) continue // line is a comment parse(text, name, 31) if((xid = get_xvar_id(name)) != -1) set_xvar_num(xid, 1) } } #if defined AUTOMATIC_PRECACHING if(MultiKillSound || KillingStreakSound) { for(new i = 0; i < 7; ++i) precache_sound_custom(g_Sounds[i]) } if(BombPlantedSound) { precache_sound_custom("djeyl/c4powa") } if(BombDefusedSound) { precache_sound_custom("djeyl/laugh") } if(BombFailedSound || GrenadeSuicideSound) { precache_sound_custom("djeyl/witch") } if(LastManSound) { precache_sound_custom("misc/maytheforce") precache_sound_custom("misc/oneandonly") } if(KnifeKillSound) { precache_sound_custom("misc/humiliation") } if(GrenadeKillSound) { precache_sound_custom("djeyl/grenade") } if(HeadShotKillSound) { precache_sound_custom("misc/headshot") } if(RoundCounterSound) { precache_sound_custom("misc/prepare") } if(DoubleKillSound) { precache_sound_custom("misc/doublekill") } if(TripleKillSound) { precache_sound_custom("misc/triplekill") } if(FirstBloodSound) { precache_sound_custom("misc/firstblood") } #endif } #if defined AUTOMATIC_PRECACHING new g_precSoundCust[64] public precache_sound_custom(sound[]) { format(g_precSoundCust, 63, "sound/%s.wav", sound) if(file_exists(g_precSoundCust)) { replace(g_precSoundCust, 63, "sound/", "") precache_sound(g_precSoundCust) } } #endif public plugin_cfg() { new g_addStast[] = "amx_statscfg add ^"%s^" %s" server_cmd(g_addStast,"MultiKill","MultiKill" ) server_cmd(g_addStast,"MultiKill Sound","MultiKillSound") server_cmd(g_addStast,"Bomb Planting","BombPlanting") server_cmd(g_addStast,"Bomb Defusing","BombDefusing") server_cmd(g_addStast,"Bomb Planted","BombPlanted") server_cmd(g_addStast,"Bomb Planted Sound","BombPlantedSound") server_cmd(g_addStast,"Bomb Defuse Succ.","BombDefused") server_cmd(g_addStast,"Bomb Defuse Succ. Sound","BombDefusedSound") server_cmd(g_addStast,"Bomb Def. Failure","BombFailed") server_cmd(g_addStast,"Bomb Def. Failure Sound","BombFailedSound") server_cmd(g_addStast,"Bomb PickUp","BombPickUp") server_cmd(g_addStast,"Bomb Drop","BombDrop") server_cmd(g_addStast,"Bomb Countdown HUD","BombCountHUD") server_cmd(g_addStast,"Bomb Countdown Voice","BombCountVoice") server_cmd(g_addStast,"Bomb Countdown (defuser)","BombCountDef") server_cmd(g_addStast,"Bomb Site Reached","BombReached") server_cmd(g_addStast,"Italy Bonus Kill","ItalyBonusKill") server_cmd(g_addStast,"Last Man","LastMan") server_cmd(g_addStast,"Last Man Sound","LastManSound") server_cmd(g_addStast,"Knife Kill","KnifeKill") server_cmd(g_addStast,"Knife Kill Sound","KnifeKillSound") server_cmd(g_addStast,"Grenade Kill","GrenadeKill") server_cmd(g_addStast,"Grenade Kill Sound","GrenadeKillSound") server_cmd(g_addStast,"Grenade Suicide","GrenadeSuicide") server_cmd(g_addStast,"Grenade Suicide Sound","GrenadeSuicideSound") server_cmd(g_addStast,"HeadShot Kill","HeadShotKill") server_cmd(g_addStast,"HeadShot Kill Sound","HeadShotKillSound") server_cmd(g_addStast,"Round Counter","RoundCounter") server_cmd(g_addStast,"Round Counter Sound","RoundCounterSound") server_cmd(g_addStast,"Killing Streak","KillingStreak") server_cmd(g_addStast,"Killing Streak Sound","KillingStreakSound") server_cmd(g_addStast,"Killing Streak Chat","KillingStreakChat") server_cmd(g_addStast,"Killing Streak HUD","KillingStreakHUD") server_cmd(g_addStast,"Killing Streak End HUD","KillingStreakEndHUD") server_cmd(g_addStast,"Killing Streak Say","KillingStreakSay") server_cmd(g_addStast,"Double Kill","DoubleKill") server_cmd(g_addStast,"Double Kill Sound","DoubleKillSound") server_cmd(g_addStast,"Triple Kill","TripleKill") server_cmd(g_addStast,"Triple Kill Sound","TripleKillSound") server_cmd(g_addStast,"Enemy Remaining","EnemyRemaining") server_cmd(g_addStast,"Player Name","PlayerName") server_cmd(g_addStast,"First Blood Sound","FirstBloodSound") server_cmd(g_addStast,"Fall Kill","FallKill") server_cmd(g_addStast,"Suicide","Suicide") if(g_vexdRunning) { server_cmd(g_addStast,"Air Kill","AirKill") server_cmd(g_addStast,"Water Kill","WaterKill") server_cmd(g_addStast,"Wall Shot","WallShot") } } public client_connect(id) { g_multiKills[id] = {0, 0} g_streakKills[id] = {0, 0} g_kills[id] = 0 g_deaths[id] = 0 g_knife[id] = 0 g_hs[id] = 0 g_nade[id] = 0 g_longestDeathStreak[id] = 0 g_longestKillStreak[id] = 0 g_DeathStats[id] = 0.0 } public eDeathMsg() { new killerId = read_data(1) if(killerId == 0) return new victimId = read_data(2) g_DeathStats[victimId] = get_gametime() + get_cvar_float("amx_statsx_duration") new bool:enemykill = (get_user_team(killerId) != get_user_team(victimId)) new headshot = read_data(3) new dm_ppl[32], plnum = 0 get_players(dm_ppl, plnum, "c") if(KillingStreakHUD) { new param[8] param[0] = victimId param[1] = g_kills[victimId] param[2] = g_hs[victimId] param[3] = g_nade[victimId] param[4] = g_knife[victimId] param[5] = g_longestKillStreak[victimId] param[6] = g_longestDeathStreak[victimId] param[7] = 1 set_task(12.0, "showKillingStreakHud", 12345+victimId, param, 8) } if((g_kills[victimId] > 4) && KillingStreakEndHUD && killerId != victimId) { new param[6] param[0] = victimId param[1] = killerId param[2] = g_kills[victimId] param[3] = g_hs[victimId] param[4] = g_nade[victimId] param[5] = g_knife[victimId] set_task(12.0, "showKillingStreakEndHud", 23456+victimId, param, 6) } if(headshot && enemykill) { ++g_hs[killerId] } new arg[4] read_data(4, arg, 3) if(equal(arg, "kni") && enemykill) { ++g_knife[killerId] } else if(equal(arg, "gre") && enemykill) { ++g_nade[killerId] } if(enemykill) { g_kills[killerId] += 1 g_deaths[killerId] = 0 } else g_kills[killerId] -= 1 g_kills[victimId] = 0 g_deaths[victimId] += 1 g_hs[victimId] = 0 g_knife[victimId] = 0 g_nade[victimId] = 0 if(g_kills[killerId] > g_longestKillStreak[killerId]) { g_longestKillStreak[killerId] = g_kills[killerId] } if(g_deaths[victimId] > g_longestDeathStreak[victimId]) { g_longestDeathStreak[victimId] = g_deaths[victimId] } new tempId if(g_firstBlood) { g_firstBlood = 0 if(FirstBloodSound) play_wav("misc/firstblood") } if((KillingStreak || KillingStreakSound) && enemykill) { ++g_streakKills[killerId][0] g_streakKills[killerId][1] = 0 ++g_streakKills[victimId][1] g_streakKills[victimId][0] = 0 new a = g_streakKills[killerId][0] - 3 if((a > -1) && !(a % 2)) { new name[32] get_user_name(killerId, name, 31) if((a >>= 1) > 6) a = 6 if(KillingStreak) { set_hudmessage(0, 100, 255, 0.05, 0.53, 2, 0.02, 6.0, 0.01, 0.1, 3) for(new i = 0; i < plnum; ++i) { tempId = dm_ppl[i] if(g_DeathStats[tempId] > get_gametime()) continue show_hudmessage(tempId, _T(g_KillingMsg[a]), name) } } if(KillingStreakSound) play_wav(g_Sounds[a]) } } if(MultiKill || MultiKillSound) { if(killerId && enemykill) { ++g_multiKills[killerId][0] g_multiKills[killerId][1] += headshot new param[2] param[0] = killerId param[1] = g_multiKills[killerId][0] set_task(4.0 + float(param[1]), "checkKills", 0, param, 2) } } if(EnemyRemaining) { new ppl[32], pplnum = 0 new team = get_user_team(victimId) - 1 if(team == 0 || team == 1) get_players(ppl, pplnum, "e", g_teamsNames[1 - team]) if(pplnum) { new eppl[32], epplnum get_players(eppl, epplnum, "ae", g_teamsNames[team]) if(epplnum) { new message[128] new teammsg[64] format(teammsg, 63, "%s%s", g_teamsNames[team], (epplnum == 1) ? "" : "S") set_hudmessage(255, 255, 255, 0.02, 0.9, 2, 0.05, 0.1, 0.02, 3.0, 3) for(new a = 0; a < pplnum; ++a) { tempId = ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue format(message, 127, _T("%d %s Remaining...",tempId), epplnum, _T(teammsg,tempId)) show_hudmessage(tempId, message) //client_print(tempId,print_chat,message) } } } } if(LastMan) { new cts[32], ts[32], ctsnum, tsnum get_players(cts, ctsnum, "ae", g_teamsNames[1]) get_players(ts, tsnum, "ae", g_teamsNames[0]) if(ctsnum == 1 && tsnum == 1) { new ctname[32], tname[32] get_user_name(cts[0], ctname, 31) get_user_name(ts[0], tname, 31) set_hudmessage(0, 255, 255, -1.0, 0.33, 0, 6.0, 6.0, 0.5, 0.15, 3) for(new a = 0; a < plnum; ++a) { tempId = dm_ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue show_hudmessage(tempId, _T("%s vs. %s"), ctname, tname) } if(LastManSound) play_wav("misc/maytheforce") } else if(!g_LastAnnounce) { new opposite = 0, team = 0 if(ctsnum == 1 && tsnum > 1) { g_LastAnnounce = cts[0] opposite = tsnum team = 0 } else if(tsnum == 1 && ctsnum > 1) { g_LastAnnounce = ts[0] opposite = ctsnum team = 1 } if(g_LastAnnounce) { new name[32] new teammsg[64] get_user_name(g_LastAnnounce, name, 31) set_hudmessage(0, 255, 255, -1.0, 0.33, 0, 6.0, 6.0, 0.5, 0.15, 3) for(new a = 0; a < plnum; ++a) { tempId = dm_ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue format(teammsg, 63, "%s%s", g_teamsNames[team], (opposite == 1) ? "" : "S") show_hudmessage(tempId, "%s (%d HP) vs. %d %s : %s", name, get_user_health(g_LastAnnounce), opposite, _T(teammsg), _T(g_LastMessages[random_num(0,3)])) } if(LastManSound && !is_user_connecting(g_LastAnnounce)) client_cmd(g_LastAnnounce, "spk misc/oneandonly") } } } if(equal(arg, "kni") && (KnifeKill || KnifeKillSound)) { if(KnifeKill && killerId != victimId) { new killer[32], victim[32] get_user_name(killerId, killer, 31) get_user_name(victimId, victim, 31) set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1) for(new a = 0; a < plnum; ++a) { tempId = dm_ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue show_hudmessage(tempId, _T(g_KnifeMsg[random_num(0,3)]), killer, victim) } } if(KnifeKillSound) play_wav("misc/humiliation") } else if(equal(arg, "gre") && (GrenadeKill || GrenadeKillSound || GrenadeSuicide || GrenadeSuicideSound)) { new killer[32], victim[32] get_user_name(killerId, killer, 31) get_user_name(victimId, victim, 31) set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1) if(killerId != victimId) { if(GrenadeKill) { for(new a = 0; a < plnum; ++a) { tempId = dm_ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue show_hudmessage(tempId, _T(g_HeMessages[random_num(0,3)]), killer, victim) } } if(GrenadeKillSound) play_wav("djeyl/grenade") } else { if(GrenadeSuicide) { for(new a = 0; a < plnum; ++a) { tempId = dm_ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue show_hudmessage(tempId, _T(g_SHeMessages[random_num(0,3)]), victim) } } if(GrenadeSuicideSound) play_wav("djeyl/witch") } } if(headshot && (HeadShotKill || HeadShotKillSound) && !equal(arg, "kni")) { if(HeadShotKill && killerId != victimId) { new killer[32], victim[32], weapon[32], message[128] get_user_name(killerId, killer, 31) get_user_name(victimId, victim, 31) read_data(4, weapon, 31) set_hudmessage(100, 100, 255, -1.0, 0.29, 0, 6.0, 6.0, 0.5, 0.15, 1) for(new a = 0; a < plnum; ++a) { tempId = dm_ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue copy(message, 127, _T(g_HeadShots[random_num(0,6)],tempId)) replace(message, 127, "$vn", victim) replace(message, 127, "$wn", weapon) replace(message, 127, "$kn", killer) show_hudmessage(tempId, message) } } if(HeadShotKillSound) { client_cmd(killerId, "spk misc/headshot") client_cmd(victimId, "spk misc/headshot") } } if(DoubleKill || DoubleKillSound) { new Float:nowtime = get_gametime() if(g_doubleKill == nowtime && g_doubleKillId == killerId) { if(DoubleKill) { new name[32] get_user_name(killerId, name, 31) set_hudmessage(255, 0, 255, -1.0, 0.35, 0, 6.0, 6.0, 0.5, 0.15, 3) for(new a = 0; a < plnum; ++a) { tempId = dm_ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue show_hudmessage(tempId, _T("Uau! %s fez um double kill!!!"), name) } } if(DoubleKillSound) play_wav("misc/doublekill") } g_doubleKill = nowtime g_doubleKillId = killerId } } if(TripleKill || TripleKillSound) { new Float:nowtime = get_gametime() if(g_tripleKill == nowtime && g_tripleKillId == killerId) { if(TripleKill) { new name[32] get_user_name(killerId, name, 31) set_hudmessage(255, 0, 255, -1.0, 0.35, 0, 6.0, 6.0, 0.5, 0.15, 3) for(new a = 0; a < plnum; ++a) { tempId = dm_ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue show_hudmessage(tempId, _T("Uau! %s fez um triple kill!!!"), name) } } if(TripleKillSound) play_wav("misc/triplekill") } g_tripleKill = nowtime g_tripleKillId = killerId } if(g_vexdRunning) { if(AirKill && !(entity_get_int(victimId, EV_INT_flags) & FL_ONGROUND) && killerId != victimId) { new killer[32], victim[32], message[128] get_user_name(killerId, killer, 31) get_user_name(victimId, victim, 31) set_hudmessage(100, 100, 255, -1.0, 0.29, 0, 6.0, 6.0, 0.5, 0.15, 1) for(new a = 0; a < plnum; ++a) { tempId = dm_ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue copy(message, 127, _T(g_AirKillMessages[random_num(0,2)],tempId)) replace(message, 127, "$vn", victim) replace(message, 127, "$kn", killer) show_hudmessage(tempId, message) } } if(WaterKill && (entity_get_int(victimId, EV_INT_waterlevel) == 2 || entity_get_int(victimId, EV_INT_waterlevel) == 3) && killerId != victimId) { new killer[32], victim[32], message[128] get_user_name(killerId, killer, 31) get_user_name(victimId, victim, 31) set_hudmessage(100, 100, 255, -1.0, 0.29, 0, 6.0, 6.0, 0.5, 0.15, 1) for(new a = 0; a < plnum; ++a) { tempId = dm_ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue copy(message, 127, _T(g_WaterKillMessages[random_num(0,2)], tempId)) replace(message, 127, "$vn", victim) replace(message, 127, "$kn", killer) show_hudmessage(tempId, message) } } if(WallShot && !equal(arg, "kni") && !equal(arg, "gre") && killerId != victimId && !can_see(killerId, victimId)) { new killer[32], victim[32], message[128] get_user_name(killerId, killer, 31) get_user_name(victimId, victim, 31) set_hudmessage(100, 100, 255, -1.0, 0.29, 0, 6.0, 6.0, 0.5, 0.15, 1) for(new a = 0; a < plnum; ++a) { tempId = dm_ppl[a] if(g_DeathStats[tempId] > get_gametime()) continue copy(message, 127, _T(g_WallShotMessages[random_num(0,2)], tempId)) replace(message, 127, "$vn", victim) replace(message, 127, "$kn", killer) show_hudmessage(tempId, message) } } } } public SuicideMsg() { if(FallKill) { new arg[64] read_logargv(0, arg, 63) new name[32] parse_loguser(arg, name, 31) set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1) new players[32], pnum get_players(players, pnum, "c") for(new i = 0; i < pnum; ++i) { if(g_DeathStats[players[i]] > get_gametime()) continue show_hudmessage(players[i], _T(g_FallKillMessages[random_num(0,2)]), name) } } } public client_kill(id) { if(Suicide && is_user_alive(id)) { new name[32] get_user_name(id, name, 31) set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, 1) new players[32], pnum get_players(players, pnum, "c") for(new i = 0; i < pnum; ++i) { if(g_DeathStats[players[i]] > get_gametime()) continue show_hudmessage(players[i], _T(g_SuicideMessages[random_num(0,1)]), name) } } } public hideStatus(id) { if(!is_user_bot(id) && is_user_connected(id)) { if(PlayerName) { set_hudmessage(0, 0, 0, 0.0, 0.0, 0, 0.0, 0.01, 0.0, 0.0, 4) show_hudmessage(id, "") } } } public setTeam(id) { g_friend[id] = read_data(2) } public showStatus(id) { if(!is_user_bot(id) && is_user_connected(id)) { if(PlayerName) { new name[32], pid = read_data(2) get_user_name(pid, name, 31) new color1 = 0, color2 = 0 if(get_user_team(pid) == 1) color1 = 255 else color2 = 255 if(g_friend[id] == 1) { // friend new clip, ammo, wpnid = get_user_weapon(pid,clip,ammo) if(wpnid > 0) { new wpnname[32] get_weaponname(wpnid, wpnname, 31) set_hudmessage(color1, 50, color2, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, 4) show_hudmessage(id, _T("%s -- %d HP / %d AP / %s"), name, get_user_health(pid), get_user_armor(pid), wpnname[7]) } } else { set_hudmessage(color1, 50, color2, -1.0, 0.60, 1, 0.01, 3.0, 0.01, 0.01, 4) show_hudmessage(id, name) } } } } public eNewRound() { if(read_data(1) == floatround(get_cvar_float("mp_roundtime") * 60.0)) { g_firstBlood = 1 g_C4Timer = 0 g_mp_c4timer = get_cvar_num("mp_c4timer") ++g_roundCount if(RoundCounter) { set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1) show_hudmessage(0, _T("Prepare to FIGHT!^nRound %d"), g_roundCount) } if(RoundCounterSound) play_wav("misc/prepare") if(KillingStreakChat) { new appl[32], ppl, i get_players(appl, ppl, "ac") for(new a = 0; a < ppl; ++a) { i = appl[a] if(g_streakKills[i][0] >= 2) client_print(i, print_chat, _T("* Voce matou %d inimigos ate agora"), g_streakKills[i][0]) else if(g_streakKills[i][1] >= 2) client_print(i, print_chat, _T("* Cuidado! Voce morreu %d rounds seguidos ate agora..."), g_streakKills[i][1]) } } } } public eRestart() { eEndRound() g_roundCount = 0 g_firstBlood = 1 for(new a = 0; a < 33; ++a) { g_DeathStats[a] = 0.0 g_kills[a] = 0 g_deaths[a] = 0 g_knife[a] = 0 g_hs[a] = 0 g_nade[a] = 0 g_longestKillStreak[a] = 0 g_longestDeathStreak[a] = 0 g_multiKills[a] = {0, 0} g_streakKills[a] = {0, 0} } } public eEndRound() { g_LastOmg = 0.0 g_LastPlan = 0.0 remove_task(8038) g_LastAnnounce = 0 set_task(0.3, "resetC4Timer", 978744) } public resetC4Timer() { g_C4Timer = -2 } public checkKills(param[]) { new id = param[0] new a = param[1] if(a == g_multiKills[id][0]) { a -= 3 if(a > -1) { if(MultiKill) { if(a > 6) a = 6 new name[32] get_user_name(id, name, 31) new ck_ppl[32], plnum = 0 get_players(ck_ppl, plnum, "c") set_hudmessage(255, 0, 100, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2) for(new i = 0; i < plnum; ++i) { if(g_DeathStats[ck_ppl[i]] > get_gametime()) continue show_hudmessage(ck_ppl[i], _T(g_MultiKillMsg[a]), name, g_multiKills[id][0], g_multiKills[id][1]) } } if(MultiKillSound) { if(a > 6) a = 6 play_wav(g_Sounds[a]) } } g_multiKills[id] = {0, 0} } } public chickenKill() { if(ItalyBonusKill) announceEvent(0, "Alguem matou uma galinha!!!") } public radioKill() { if(ItalyBonusKill) announceEvent(0, "Alguem explodiu o radio!!!") } announceEvent(id,message[]) { new name[32] get_user_name(id, name , 31) set_hudmessage(255, 100, 50, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1) new players[32], pnum get_players(players, pnum, "c") for(new i = 0; i < pnum; ++i) { if(g_DeathStats[players[i]] > get_gametime()) continue show_hudmessage(players[i], _T(message), name) } } announceEventDef(id,message[],C4Timer) { new name[32] get_user_name(id, name , 31) set_hudmessage(255, 100, 50, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 2) new players[32], pnum get_players(players, pnum, "c") for(new i = 0; i < pnum; ++i) { if(g_DeathStats[players[i]] > get_gametime()) continue show_hudmessage(players[i], _T(message), name, C4Timer) } } public eGotBomb(id) { g_Planter = id g_Defuser = g_Defusing = 0 if(BombReached && read_data(1) == 2 && g_LastOmg < get_gametime()) { g_LastOmg = get_gametime() + 15.0 announceEvent(g_Planter, "OMG! %s alcancou o objetivo!") } } public eBombDefG(id) { if(read_data(1) == 3) { if(BombPlanting && g_LastPlan < get_gametime()) { g_LastPlan = get_gametime() + 15.0 announceEvent(g_Planter, "%s esta plantando a bomba!") } } else { g_Defuser = g_Defusing = id if(BombDefusing && g_LastPlan < get_gametime()) { g_LastPlan = get_gametime() + 15.0 announceEvent(g_Defusing, "%s esta desarmando a bomba...") } } } public eBombDefL(id) { g_Defusing = 0 } public eBombPlanted() { if(g_C4Timer != -2) { if(BombPlanted) announceEvent(g_Planter, "%s plantou a bomba!!!") if(BombPlantedSound) play_wav("djeyl/c4powa") g_C4Timer = g_mp_c4timer set_task(1.0, "bombTimer", 8038) g_gameTime = get_gametime() g_LastPlan = 0.0 } } public bombTimer() { if(--g_C4Timer > 0) { if(BombCountVoice) { if(g_C4Timer == 40 || g_C4Timer == 30 || g_C4Timer == 20) { new temp[64] num_to_word(g_C4Timer, temp, 63) format(temp, 63, "^"vox/%s segundos para explodir^"", temp) play_wav(temp) } else if(g_C4Timer < 11) { new temp[64] num_to_word(g_C4Timer, temp, 63) format(temp, 63, "^"vox/%s^"", temp) play_wav(temp) } } if(BombCountDef && g_Defusing) client_print(g_Defusing, print_center, "%d", g_C4Timer) if(BombCountHUD) { if(g_C4Timer < 6) set_hudmessage(150, 0, 0, -1.0, 0.78, 0, 1.0, 1.1, 0.01, 0.01, 4) if(g_C4Timer > 5) set_hudmessage(150, 150, 0, -1.0, 0.78, 0, 1.0, 1.1, 0.01, 0.01, 4) if(g_C4Timer > 10) set_hudmessage(0, 150, 0, -1.0, 0.78, 0, 1.0, 1.1, 0.01, 0.01, 4) new bt_ppl[32], plnum = 0 get_players(bt_ppl, plnum, "c") for(new a = 0; a < plnum; ++a) { if(g_DeathStats[bt_ppl[a]] > get_gametime()) continue show_hudmessage(bt_ppl[a], _T("C4: %ds"), g_C4Timer) } } new Float:gameTime = get_gametime() new Float:offset = gameTime - g_gameTime offset = offset - floatround(offset, floatround_floor) offset = floatround(offset*10.0, floatround_floor) / 10.0 set_task(1.0 - offset, "bombTimer", 8038) } } public eBombDef() { if(BombDefused && (g_C4Timer >= 0)) announceEventDef(g_Defuser, "%s desarmou a bomba!^nC4 parou a %d seg.", g_C4Timer) if(BombDefusedSound) play_wav("djeyl/laugh") if(is_user_connected(g_Defuser)) { if(g_funRunning) { new frags = get_user_frags(g_Defuser) - 3 + get_cvar_num("amx_bomb_frags") set_user_frags(g_Defuser, frags) } else if(g_vexdRunning) { new frags = get_user_frags(g_Defuser) - 3 + get_cvar_num("amx_bomb_frags") entity_set_float(g_Defuser, EV_FL_frags, float(frags)) message_begin(MSG_ALL, get_user_msgid("ScoreInfo")) write_byte(g_Defuser) write_short(frags) write_short(get_user_deaths(g_Defuser)) write_short(0) write_short(get_user_team(g_Defuser)) message_end() } } } public eBombFail() { if(g_Defuser) { if(BombFailed) announceEvent(g_Defuser, "%s falhou em desarmar a bomba...") if(BombFailedSound) play_wav("djeyl/witch") } if(is_user_connected(g_Planter)) { if(g_funRunning) { new frags = get_user_frags(g_Planter) - 3 + get_cvar_num("amx_bomb_frags") set_user_frags(g_Planter, frags) } else if(g_vexdRunning) { new frags = get_user_frags(g_Planter) - 3 + get_cvar_num("amx_bomb_frags") entity_set_float(g_Planter, EV_FL_frags, float(frags)) message_begin(MSG_ALL, get_user_msgid("ScoreInfo")) write_byte(g_Planter) write_short(frags) write_short(get_user_deaths(g_Planter)) write_short(0) write_short(get_user_team(g_Planter)) message_end() } } } public eBombPickUp(id) { if(BombPickUp) announceEvent(id, "%s pegou a bomba...") } public eBombDrop() { if(BombDrop) announceEvent(g_Planter, "%s dropou a bomba!!!") } public eResetHud(id) { remove_task(12345+id) if(g_kills[id] > 0) { if(KillingStreakHUD) { new param[8] param[0] = id param[1] = g_kills[id] param[2] = g_hs[id] param[3] = g_nade[id] param[4] = g_knife[id] param[5] = g_longestKillStreak[id] param[6] = g_longestDeathStreak[id] param[7] = 0 set_task(get_cvar_float("mp_freezetime")+2.0, "showKillingStreakHud", 987654+id, param, 8) } } else { if(KillingStreakHUD) { new param[4] param[0] = id param[1] = g_deaths[id] param[2] = g_longestKillStreak[id] param[3] = g_longestDeathStreak[id] set_task(get_cvar_float("mp_freezetime")+2.0, "showDeathStreakHud", 876543+id, param, 4) } } return PLUGIN_CONTINUE } public cmdKillingStreak(id) { if(!KillingStreakSay) { client_print(id, print_chat, _T(g_disabledMsg,id)) return PLUGIN_HANDLED } if(KillingStreakHUD) { if(g_kills[id] > 0) { new param[8] param[0] = id param[1] = g_kills[id] param[2] = g_hs[id] param[3] = g_nade[id] param[4] = g_knife[id] param[5] = g_longestKillStreak[id] param[6] = g_longestDeathStreak[id] param[7] = 0 showKillingStreakHud(param) } else { new param[4] param[0] = id param[1] = g_deaths[id] param[2] = g_longestKillStreak[id] param[3] = g_longestDeathStreak[id] showDeathStreakHud(param) } } return PLUGIN_HANDLED } public showKillingStreakHud(param[]) { new player = param[0] if(!is_user_connected(player)) return PLUGIN_CONTINUE new l_kills = param[1] new l_hs = param[2] new l_nade = param[3] new l_knife = param[4] new l_longkstreak = param[5] new l_longdstreak = param[6] new l_end = param[7] set_hudmessage(150, 150, 0, 0.02, 0.9, 2, 0.05, 0.1, 0.01, 6.0, 4) new sBuffer[256] new iLen = 0 if(l_end) iLen = format(sBuffer, 255, _T("Your latest streak was %d %s.",player), l_kills, (l_kills != 1) ? _T("kills",player) : _T("kill",player)) else iLen = format(sBuffer, 255, _T("Your current streak is %d %s.",player), l_kills, (l_kills != 1) ? _T("kills",player) : _T("kill",player)) if(l_hs || l_nade || l_knife) { iLen += format(sBuffer[iLen], 255-iLen, " (") if(l_hs) iLen += format(sBuffer[iLen], 255-iLen, "%d hs,", l_hs) if(l_nade) iLen += format(sBuffer[iLen], 255-iLen, "%d %s,", l_nade, (l_nade>1) ? _T("nades",player) : _T("nade",player)) if(l_knife) iLen += format(sBuffer[iLen], 255-iLen, "%d %s,", l_knife, (l_knife>1) ? _T("knives",player) : _T("knife",player)) iLen -= 1 iLen += format(sBuffer[iLen], 255-iLen, ")") } iLen += format(sBuffer[iLen], 255-iLen, _T("^nYour longest killstreak is %d. Your longest deathstreak is %d.",player), l_longkstreak, l_longdstreak) show_hudmessage(player, sBuffer) return PLUGIN_CONTINUE } public showDeathStreakHud(param[]) { new player = param[0] if(!is_user_connected(player)) return PLUGIN_CONTINUE new l_deaths = param[1] new l_longkstreak = param[2] new l_longdstreak = param[3] set_hudmessage(150, 150, 0, 0.02, 0.9, 2, 0.05, 0.1, 0.01, 6.0, 4) new sBuffer[256] format(sBuffer, 255, _T("Your current streak is %d %s.^nYour longest killstreak is %d. Your longest deathstreak is %d.",player), l_deaths, (l_deaths != 1) ? _T("deaths",player) : _T("death",player), l_longkstreak, l_longdstreak) show_hudmessage(player, sBuffer) return PLUGIN_CONTINUE } public showKillingStreakEndHud(param[]) { set_hudmessage(0, 150, 255, 0.73, 0.65, 2, 0.02, 8.0, 0.01, 6.0, 3) new l_victim = param[0] new l_killer = param[1] new l_kills = param[2] new l_hs = param[3] new l_nade = param[4] new l_knife = param[5] new l_vname[32] get_user_name(l_victim, l_vname, 31) new l_kname[32] get_user_name(l_killer, l_kname, 31) new sBuffer[256] new iLen = 0 new pl[32], plnum, tempId get_players(pl, plnum, "c") for(new a = 0; a < plnum; ++a) { tempId = pl[a] iLen = format(sBuffer, 255, _T("%s's^nkilling spree^n%d kills",tempId), l_vname, l_kills) if(l_hs || l_nade || l_knife) { iLen += format(sBuffer[iLen], 255-iLen, " (") if(l_hs) iLen += format(sBuffer[iLen], 255-iLen, "%d hs,", l_hs) if(l_nade) iLen += format(sBuffer[iLen], 255-iLen, "%d %s,", l_nade, (l_nade>1) ? _T("nades",tempId) : _T("nade",tempId)) if(l_knife) iLen += format(sBuffer[iLen], 255-iLen, "%d %s,", l_knife, (l_knife>1) ? _T("knives",tempId) : _T("knife",tempId)) iLen -= 1 iLen += format(sBuffer[iLen], 255-iLen, ")") } iLen += format(sBuffer[iLen], 255-iLen, _T("^nwas ended by^n%s",tempId), l_kname) show_hudmessage(tempId, sBuffer) } return PLUGIN_CONTINUE } public play_wav(sound[]) { new players[32], inum get_players(players, inum, "c") for(new i = 0; i < inum; ++i) { if(is_user_connecting(players[i])) continue client_cmd(players[i], "spk %s", sound) } } |
Re: Miscstats help
You get errors because this is an AMXMod plugin and we are an AMXModX community. Rewrite it to be for AMXModX and it will work
|
| All times are GMT -4. The time now is 15:10. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.