Raised This Month: $ Target: $400
 0% 

Biohazard v2.00 Beta 3b (Zombie Mod)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
frwl
Junior Member
Join Date: Sep 2015
Old 01-21-2018 , 14:42   Re: Biohazard v2.00 Beta 3b (Zombie Mod)
Reply With Quote #11

hello!

there is a problem (or not) with random. sometimes the same player is infected too often per map while others are infected only 1-2 times. is there any way to fix it and make more fair random?

i guess this line responds for the random pick of zombies? or mb not...
Code:
#define _random(%1) random_num(0, %1 - 1)
and there is a stock:
Code:
stock randomly_pick_zombie()
{
	static data[4]
	data[0] = 0 
	data[1] = 0 
	data[2] = 0 
	data[3] = 0
	
	static index, players[2][32]
	for(index = 1; index <= g_maxplayers; index++)
	{
		if(!is_user_alive(index)) 
			continue
		
		if(g_zombie[index])
		{
			data[0]++
			players[0][data[2]++] = index
		}
		else 
		{
			data[1]++
			players[1][data[3]++] = index
		}
	}

	if(data[0] > 0 &&  data[1] < 1) 
		return players[0][_random(data[2])]
	
	return (data[0] < 1 && data[1] > 0) ?  players[1][_random(data[3])] : 0
}
players go mad with this...
frwl is offline
 


Thread Tools
Display Modes

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:41.


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