Outdated Port "Script problem"

FMpwnd

Veteran
Messages
19
Reaction score
2
Points
558
Hi everyone today i see the script on COD 4 of the Custom XP Text
XPText.png

And i see how to port i found the code in _rank.gsc but when i put it in my menu it say a syntax error.
36aad85231da4a08bd34eb3c98ffbe64.png

The code :
updaterankscorehud(amount)
{
self endon("disconnect");
self endon("joined_team");
self endon("joined_spectators");
if (isDefined(level.usingmomentum) && level.usingmomentum)
{
return;
}
if (amount == 0)
{
return;
}
self notify("update_score");
self endon("update_score");
self.rankupdatetotal = self.rankupdatetotal + amount;
wait 0,05;
if (isDefined(self.hud_rankscroreupdate))
{
if (self.rankupdatetotal < 0)
{
self.hud_rankscroreupdate.label = &"";
self.hud_rankscroreupdate.color = (0,73, 0,19, 0,19);
}
else
{
self.hud_rankscroreupdate.label = &"MP_PLUS";
self.hud_rankscroreupdate.color = (1, 1, 0,5);
}

self.hud_rankscroreupdate setvalue(self.rankupdatetotal);
self.hud_rankscroreupdate.alpha = 0,85;
self.hud_rankscroreupdate thread maps/mp/gametypes/_hud::fontpulse(self);
wait 1;
self.hud_rankscroreupdate fadeovertime(0,75);
self.hud_rankscroreupdate.alpha = 0;
self.rankupdatetotal = 0;
}
}
So thx a lot if u help me and its can be good in other menu :smile:
 

candy

G59 Terrorist
Staff member
Donator
Messages
1,322
Reaction score
752
Points
973
Hi everyone today i see the script on COD 4 of the Custom XP Text
XPText.png

And i see how to port i found the code in _rank.gsc but when i put it in my menu it say a syntax error.
36aad85231da4a08bd34eb3c98ffbe64.png

The code :
updaterankscorehud(amount)
{
self endon("disconnect");
self endon("joined_team");
self endon("joined_spectators");
if (isDefined(level.usingmomentum) && level.usingmomentum)
{
return;
}
if (amount == 0)
{
return;
}
self notify("update_score");
self endon("update_score");
self.rankupdatetotal = self.rankupdatetotal + amount;
wait 0,05;
if (isDefined(self.hud_rankscroreupdate))
{
if (self.rankupdatetotal < 0)
{
self.hud_rankscroreupdate.label = &"";
self.hud_rankscroreupdate.color = (0,73, 0,19, 0,19);
}
else
{
self.hud_rankscroreupdate.label = &"MP_PLUS";
self.hud_rankscroreupdate.color = (1, 1, 0,5);
}

self.hud_rankscroreupdate setvalue(self.rankupdatetotal);
self.hud_rankscroreupdate.alpha = 0,85;
self.hud_rankscroreupdate thread maps/mp/gametypes/_hud::fontpulse(self);
wait 1;
self.hud_rankscroreupdate fadeovertime(0,75);
self.hud_rankscroreupdate.alpha = 0;
self.rankupdatetotal = 0;
}
}
So thx a lot if u help me and its can be good in other menu :grinning:
because you're using "," instead of "." here is the syntax fix.
Code:
updaterankscorehud(amount)
{
self endon("disconnect");
self endon("joined_team");
self endon("joined_spectators");
if (isDefined(level.usingmomentum) && level.usingmomentum)
{
return;
}
if (amount == 0)
{
return;
}
self notify("update_score");
self endon("update_score");
self.rankupdatetotal = self.rankupdatetotal + amount;
wait 0.05;
if (isDefined(self.hud_rankscroreupdate))
{
if (self.rankupdatetotal < 0)
{
self.hud_rankscroreupdate.label = &"";
self.hud_rankscroreupdate.color = (0.73, 0.19, 0019);
}
else
{
self.hud_rankscroreupdate.label = &"MP_PLUS";
self.hud_rankscroreupdate.color = (1, 1, 0.5);
}
self.hud_rankscroreupdate setvalue(self.rankupdatetotal);
self.hud_rankscroreupdate.alpha = 0.85;
self.hud_rankscroreupdate thread maps/mp/gametypes/_hud::fontpulse(self);
wait 1;
self.hud_rankscroreupdate fadeovertime(0.75);
self.hud_rankscroreupdate.alpha = 0;
self.rankupdatetotal = 0;
}
}
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
because you're using "," instead of "." here is the syntax fix.
Code:
updaterankscorehud(amount)
{
self endon("disconnect");
self endon("joined_team");
self endon("joined_spectators");
if (isDefined(level.usingmomentum) && level.usingmomentum)
{
return;
}
if (amount == 0)
{
return;
}
self notify("update_score");
self endon("update_score");
self.rankupdatetotal = self.rankupdatetotal + amount;
wait 0.05;
if (isDefined(self.hud_rankscroreupdate))
{
if (self.rankupdatetotal < 0)
{
self.hud_rankscroreupdate.label = &"";
self.hud_rankscroreupdate.color = (0.73, 0.19, 0019);
}
else
{
self.hud_rankscroreupdate.label = &"MP_PLUS";
self.hud_rankscroreupdate.color = (1, 1, 0.5);
}
self.hud_rankscroreupdate setvalue(self.rankupdatetotal);
self.hud_rankscroreupdate.alpha = 0.85;
self.hud_rankscroreupdate thread maps/mp/gametypes/_hud::fontpulse(self);
wait 1;
self.hud_rankscroreupdate fadeovertime(0.75);
self.hud_rankscroreupdate.alpha = 0;
self.rankupdatetotal = 0;
}
}
Does this script work with the desired result?
 
Top