This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

winning hud


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xAlecsu
Junior Member
Join Date: Apr 2024
Old 05-05-2024 , 16:28   winning hud
Reply With Quote #1

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)
	}
}

Last edited by xAlecsu; 05-05-2024 at 16:28.
xAlecsu is offline
xAlecsu
Junior Member
Join Date: Apr 2024
Old 05-06-2024 , 16:20   Re: winning hud
Reply With Quote #2

someone?.....
xAlecsu is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode