Raised This Month: $51 Target: $400
 12% 

[HELP] Bug in lasthuman


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Laoming
Junior Member
Join Date: May 2015
Location: Czech Republic
Old 10-24-2015 , 06:22   [HELP] Bug in lasthuman
Reply With Quote #1

I have problem on my server.

Problem is here:
Code:
		// Last human 
		if (g_zombie[id] && fnGetHumans() == 1)
		{
		client_cmd(id, "say /zmenu")
		}
		if (g_isalive[id] && !g_zombie[id] && !g_survivor[id] && fnGetHumans() == 1)
		{
			if(fnGetZombies() == 0)
			{
			return;
			}
			if (!g_lasthuman[id])
			{
				lasthumanto(id)
				set_task(0.2, "lasthumanhud")
				client_cmd( 0, "mp3 play %s", mp3_last_human );
				// Last human forward
				ExecuteForward(g_fwUserLastHuman, g_fwDummyResult, id);
				
				// Reward extra hp
			}
			g_lasthuman[id] = true
		}
		else
			g_lasthuman[id] = false
	}
}

public lasthumanto(id)
{
	zp_colored_print(id, "^x04[ZP]^x01 *** ^x04YOU ARE THE LASTHUMAN ! ^x01***")
	zp_colored_print(id, "^x04[ZP]^x01 *** ^x04YOU ARE THE LASTHUMAN ! ^x01***")
	zp_colored_print(id, "^x04[ZP]^x01 *** ^x04YOU ARE THE LASTHUMAN ! ^x01***")
	fm_set_user_health(id, pev(id, pev_health) + get_pcvar_num(cvar_humanlasthp))
	set_user_armor(id, get_user_armor(id) +50)
	set_hudmessage( 10, 105, 200, -1.0, 0.15, 1, 0.02, 5.0, 0.01, 0.1, 2);	
	new name[32]
	get_user_name(id, name, 31)
	ShowSyncHudMsg(0, g_iHudChannel[HUDID_OSTATNI], "%s is lasthuman !", name) 
}
All Code at the end (function lasthumanto(id)) have bug. If begin a new round, so display this hud message to all players and chat message + armor & health to random player (every round). Why? This hud message must work only if lasthuman, not at roundstart. How i fix this bug?

Last edited by Laoming; 10-24-2015 at 06:27.
Laoming is offline
Mint
New Member
Join Date: Jun 2015
Old 10-24-2015 , 19:18   Re: [HELP] Bug in lasthuman
Reply With Quote #2

zp_has_round_started()
Mint is offline
Laoming
Junior Member
Join Date: May 2015
Location: Czech Republic
Old 10-25-2015 , 06:28   Re: [HELP] Bug in lasthuman
Reply With Quote #3

Fixed. Thanks for help.

Last edited by Laoming; 10-29-2015 at 19:40.
Laoming 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 10:36.


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