Quote:
Originally Posted by Powerlord
You really should post this as its own thread.
Having said that, here's a quick and completely untested port of the AddCommas function to SourceMod. SourceMod only has a float absolute value function, so I did a two's complement to swap the sign.
|
well, I kinda did post it as a thread at first, but occasionally at 'amxmod scripting help'. that was my first post and already turned out to be a spam, so didn't want to multiply threads.
thank you for your peace of code, it' just doesn't seem like I'm capable of inserting it properly to plugin). if I put it before the block, responsible for displaying client points on infected death, plugin compiles perfectly, but there's no effect - numbers are still displayed in gamechat with no comma between digits. and when I tried to put indicated code directly in the block , I couldn't compile a thing- got like undefined symbols.. pretty sure I'm doing something wrong)).
here's where I tried to insert it, but failed (peace of [L4D & L4D2] Custom Player Stats v1.4B105 by muukis, just attempting to adopt to how I'd like stats to be displayed):
PHP Code:
// Display common Infected scores to each player.
public Action:timer_ShowTimerScore(Handle:timer, Handle:hndl)
{
if (StatsDisabled())
return;
new Mode = GetConVarInt(cvar_AnnounceMode);
decl String:Name[MAX_LINE_WIDTH];
new maxplayers = GetMaxClients();
for (new i = 1; i <= maxplayers; i++)
{
if (IsClientConnected(i) && IsClientInGame(i) && !IsClientBot(i))
{
// if (CurrentPoints[i] > GetConVarInt(cvar_MaxPoints))
// continue;
TimerPoints[i] = GetMedkitPointReductionScore(TimerPoints[i]);
if (TimerPoints[i] > 0 && TimerKills[i] > 0)
{
if (Mode == 1 || Mode == 2)
{
GetClientName(i, Name, sizeof(Name));
CPrintToChat(i, "{blue}%s \x01(%i) got points for killing Infected", Name, (ClientPoints[i] + CurrentPoints[i]));
}
else if (Mode == 3)
{
GetClientName(i, Name, sizeof(Name));
StatsPrintToChatAll("\x05%s \x01has earned \x04%i \x01points for killing \x05%i \x01Infected!", Name, TimerPoints[i], TimerKills[i]);
}
}
InterstitialPlayerUpdate(i);
}
TimerPoints[i] = 0;
TimerKills[i] = 0;
TimerHeadshots[i] = 0;
}
}