local DDwin = 1
local V = 10 -- csak egy beallitas, kesobb lehet jobb lenne allitani
local avgTime = 0
local varTime = 0
function calledWhenRaceStarts()
if mysql_query(handler, "SELECT COUNT(*) FROM tops WHERE this_is_this_map") == (1 or 0) then
-- Ha 1 top van csak, nincs variancia, szal az se jo
avgTime = 0
varTime = 0
return
end
local result = mysql_query(handler, "SELECT AVG(time) FROM tops WHERE this_is_this_map")
avgTime = toNumber(result)
local result = mysql_query(handler, "SELECT VAR_POP(time) FROM tops WHERE this_is_this_map")
varTime = toNumber(result)
end
function calculatePoints(rank, pc,
if not pc then pc = g_playerCount end
if not mode then mode = g_mode end
local points
if mode == 1 then -- Race
if (avgTime == 0 or varTime == 0 or time < avgTime)
points = 1
else
points = exp((time - avgTim)^2 / (2 * V * varTime))
end
elseif mode == 2 then -- DD
-- Gyakorlatilag atlagosan annyi pontot kap igy vki, ahany embert lokott le, ugy normalva, hogy ha nyer, kap DDwin*pc pontot. Nem mindig ad annyit, csak atlagosan nehany kor alatt elvileg. A campelokkel szemben nem mukodik, aki campel, es elfut a game elol, az tobb pontot kap igy mint amennyit megerdemel.
points = DDwin * log2 (3*pc/(4*rank - 2))
elseif mode == 3 then -- DM
-- Meghalt DM-en hunter elott, itt is fuggetlenek a jatekosok, szal csak az idotol fugg a pont
points = math.
elseif mode == 2 then -- DD
points = math.floor(pc - rank)
elseif mode == 3 then -- DM
points = math.floor(pc - rank)
end
return points
end
function
if
if not mode then mode = g_mode end
local money
if mode
points = 1
else
points = exp((time - avgTim)^2 / (2 * V * varTime))
end
end
function lelottEgyHuntertAHunterrelDMen()
--
money = (pc - rank) * 250
elseif mode == 2 then
--
money = (pc - rank) * 250
elseif mode == 3 then
--
money
points =
end
return money
end