Thread: Problems
View Single Post
maniok112
Junior Member
Join Date: Mar 2015
Old 04-08-2015 , 10:52   Re: Problems
Reply With Quote #3

HTML Code:
public EndEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
	new players[32];

	new tempfrags, id;

	new swapfrags, swapid;

	new starfrags[3];
	new starid[3];
	
	new timeleft;
	GetMapTimeLeft(timeleft);
	if (timeleft <= 0)
	{
		for(new i = 1; i <= MaxClients; i++)
			if (IsClientInGame(i) && !IsFakeClient(i))
		{
			id = players[i];
			tempfrags = GetClientFrags(id);
			if (tempfrags > starfrags[0])
			{
				starfrags[0] = tempfrags;
				starid[0] = id;
				cod_set_user_xp(starid[0], cod_get_user_xp(starid[0])+900);
				if (tempfrags > starfrags[1])
				{
					swapfrags = starfrags[1];
					swapid = starid[1];
					starfrags[1] = tempfrags;
					starid[1] = id;
					starfrags[0] = swapfrags;
					starid[0] = swapid;
					cod_set_user_xp(starid[1], cod_get_user_xp(starid[1])+600);
					
					if ( tempfrags > starfrags[2] )
					{
						swapfrags = starfrags[2];
						swapid = starid[2];
						starfrags[2] = tempfrags;
						starid[2] = id;
						starfrags[1] = swapfrags;
						starid[1] = swapid;
						cod_set_user_xp(starid[2], cod_get_user_xp(starid[2])+300);

					}
				}
			}
		}
	
		PrintToChatAll("Najlepsi Gracze na Mapie:");
		PrintToChatAll("1. %i Fragow (+900 dosw.)", starfrags[2]);
		PrintToChatAll("2. %i Fragow (+600 dosw.)", starfrags[1]);
		PrintToChatAll("3. %i Fragow (+300 dosw.)", starfrags[0]);
	}
	
	return 0;
}
Currently it looks like this and still does not work, not even print an announcement if naa hut function timeleft = 0 did not work
maniok112 is offline