Hello ,how i can make this code from biohazard.sma :
Code:
public msg_textmsg(msgid, dest, id)
{
if(get_msg_arg_int(1) != 4)
return PLUGIN_CONTINUE
static txtmsg[25], winmsg[32]
get_msg_arg_string(2, txtmsg, 24)
if(equal(txtmsg[1], "Game_bomb_drop"))
return PLUGIN_HANDLED
else if(equal(txtmsg[1], "Terrorists_Win"))
{
formatex(winmsg, 31, "%L", LANG_SERVER, "WIN_TXT_ZOMBIES")
set_msg_arg_string(2, winmsg)
}
else if(equal(txtmsg[1], "Target_Saved") || equal(txtmsg[1], "CTs_Win"))
{
formatex(winmsg, 31, "%L", LANG_SERVER, "WIN_TXT_SURVIVORS")
set_msg_arg_string(2, winmsg)
}
return PLUGIN_CONTINUE
}
To work with this plugin?:
Code:
#include <amxmodx>
#include <fakemeta>
#include <fakemeta_util>
#include <zp_dsohud>
#include <zombieplague>
// Win sprites dirs'
new const g_zombie_win[] = "sprites/zombie_plague/zombie_win.spr"
new const g_human_win[] = "sprites/zombie_plague/human_win.spr"
new g_maxplayers
public plugin_init()
{
register_plugin("[ZP] Advanced Win Msgs.", "1.0", "@bdul!");
// Round start event
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
// Retrieve max players
g_maxplayers = get_maxplayers()
}
// Prechache the sprites
public plugin_precache()
{
precache_model(g_zombie_win)
precache_model(g_human_win)
}
// Remove win sprites on new round
public event_round_start()
{
static id
for (id = 1; id <= g_maxplayers; id++)
zp_remove_hud_sprite(id)
}
public zp_round_ended(win_team)
{
// No one won ?
if (win_team == WIN_NO_ONE)
return
// Set the sprites on players HUD
static id
for (id = 1; id <= g_maxplayers; id++)
{
if (win_team == WIN_HUMANS)
zp_display_hud_sprite(id, g_human_win, 0.04)
else
zp_display_hud_sprite(id, g_zombie_win, 0.05)
}
}
This is what i try but don't work (in game appear default text "ct win" and " tero win"
Code:
#include <amxmodx>
#include <fakemeta>
#include <fakemeta_util>
#include <zp_dsohud>
#include <biohazard>
// Win sprites dirs'
new const g_zombie_win[] = "sprites/zombie_plague/zombie_win.spr"
new const g_human_win[] = "sprites/zombie_plague/human_win.spr"
new g_maxplayers
public plugin_init()
{
register_plugin("[ZP] Advanced Win Msgs.", "1.0", "@bdul!");
// Round start event
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
// Retrieve max players
g_maxplayers = get_maxplayers()
}
// Prechache the sprites
public plugin_precache()
{
precache_model(g_zombie_win)
precache_model(g_human_win)
}
// Remove win sprites on new round
public event_round_start()
{
static id
for (id = 1; id <= g_maxplayers; id++)
zp_remove_hud_sprite(id)
}
public zp_round_ended(win_team)
{
static txtmsg[25]
// Set the sprites on players HUD
static id
for (id = 1; id <= g_maxplayers; id++)
{
if (equal(txtmsg[1], "Target_Saved") || equal(txtmsg[1], "CTs_Win"))
zp_display_hud_sprite(id, g_human_win, 0.04)
else
zp_display_hud_sprite(id, g_zombie_win, 0.05)
}
}