|
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
|
07-19-2011
, 13:09
Re: Scripting Forum
|
#24
|
Quote:
Originally Posted by mehelp
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; }
}
|
You need to actually call it. For instance, to format the points in the modes 1 and 2 block above:
PHP Code:
new String:szPoints[15]; GetClientName(i, Name, sizeof(Name)); AddCommas((ClientPoints[i] + CurrentPoints[i]), szPoints, sizeof(szPoints)); CPrintToChat(i, "{blue}%s \x01(%s) got points for killing Infected", Name, szPoints);
__________________
Not currently working on SourceMod plugin development.
|
|
|
|