That's weird, weren't you using the Freeze-tag Rewards mod on your servers before?
I don't remember anything about the "addkills" command being bugged on Linux.
Printable View
That's weird, weren't you using the Freeze-tag Rewards mod on your servers before?
I don't remember anything about the "addkills" command being bugged on Linux.
I found this: https://www.x-null.net/forums/thread...ll=1#post22781
It seems like the crash happens when you use the "addkills" command through the "commanddelay" command
@win151
Try replacing this line:
local.melter commanddelay 0 addKills local.award
with this:
local.melter addkills local.award
and see if it still crashes
It works now. Thanks!
Now if I want to show the amount of melts in a hud, how would I add it? Right now, I have this and I'm assuming that its wrong.
ihuddraw_string $player[local.i] 96 local.totalpoints
Everything shows up except for the number of melts. I get a NIL message in place of the number. I tried changing it with different lines, but get the same error. Here's the whole line:
ihuddraw_alpha $player[local.i] 95 1
ihuddraw_font $player[local.i] 95 "verdana-14"
ihuddraw_color $player[local.i] 95 0.27 0.88 0
ihuddraw_color $player[local.i] 95 0.27 0.88 1
ihuddraw_rect $player[local.i] 95 10 -200 100 20
ihuddraw_string $player[local.i] 95 "Melts:"
ihuddraw_align $player[local.i] 95 left bottom
ihuddraw_alpha $player[local.i] 96 1
ihuddraw_font $player[local.i] 96 "verdana-14"
ihuddraw_color $player[local.i] 96 0.27 0.88 0
ihuddraw_color $player[local.i] 96 0.27 0.88 1
ihuddraw_rect $player[local.i] 96 80 -200 100 20
ihuddraw_string $player[local.i] 96 local.totalpoints
ihuddraw_align $player[local.i] 96 left bottom
There is no need to use two different huddraws, only one is enough
also, in the code, local.melter is the player (the melter). Using $player[local.i] will throw an error since local.i is not defined.
The right code should be something like this:
award_melter_points local.melters:
if (level.mef_baseversion == "sh" || level.mef_baseversion == "bt" || level.mef_baseversion == "aa")
{
for (local.i = 0; local.i < local.melters.size; local.i++)
{
local.melter = local.melters[local.i]
if (local.melter != NULL)
{
if (local.melter.ft_meltscore == NIL)
{
local.melter.ft_meltscore = 0.0
local.melter.ft_awardedpoints = 0
}
local.melter.ft_meltscore += (1.0 / local.melters.size)
local.totalpoints = int local.melter.ft_meltscore
// round up to the nearest integer
if ((local.melter.ft_meltscore - local.totalpoints) > 0.0)
{
local.totalpoints += 1
}
local.award = local.totalpoints - local.melter.ft_awardedpoints
// NEW REWARDS START HERE ------------------------------------------------------------------
if (local.award > 0)
{
local.melter addkills local.award // <-- this will add a kill every single melt
local.melter.ft_awardedpoints += local.award
ihuddraw_virtualsize local.melter 95 0
ihuddraw_align local.melter 95 left bottom
ihuddraw_color local.melter 95 0.27 0.88 1
ihuddraw_font local.melter 95 "facfont-20"
ihuddraw_rect local.melter 95 40 -185 100 20
ihuddraw_string local.melter 95 ("Melts: " + local.totalpoints)
ihuddraw_alpha local.melter 95 1
switch (local.melter.ft_awardedpoints)
{
case 1: // 1 melt
// do stuff here
local.melter iprint ("You got a point for your melting.")
break
case 2: // 2 melts
// do stuff here
local.melter give "models/weapons/silencedpistol.tik"
local.melter iprint ("You got a silenced pistol for your melting.")
break
default:
break
}
}
}
}
}
end