Thread: Scripting Forum
View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-19-2011 , 13:09   Re: Scripting Forum
Reply With Quote #24

Quote:
Originally Posted by mehelp View Post
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:timerHandle:hndl)
{
    if (
StatsDisabled())
        return;

    new 
Mode GetConVarInt(cvar_AnnounceMode);
    
decl String:Name[MAX_LINE_WIDTH];
    
    new 
maxplayers GetMaxClients();
    for (new 
1<= maxplayersi++)
    {
        if (
IsClientConnected(i) && IsClientInGame(i) && !IsClientBot(i))
        {
            
// if (CurrentPoints[i] > GetConVarInt(cvar_MaxPoints))
            //     continue;
            
            
            
TimerPoints[i] = GetMedkitPointReductionScore(TimerPoints[i]);
            
            if (
TimerPoints[i] > && TimerKills[i] > 0)
            {
                if (
Mode == || Mode == 2)
                {
                    
GetClientName(iNamesizeof(Name));
                    
CPrintToChat(i"{blue}%s \x01(%i) got points for killing Infected"Name, (ClientPoints[i] + CurrentPoints[i]));
                }
                else if (
Mode == 3)
                {
                    
GetClientName(iNamesizeof(Name));
                    
StatsPrintToChatAll("\x05%s \x01has earned \x04%i \x01points for killing \x05%i \x01Infected!"NameTimerPoints[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(iNamesizeof(Name));
AddCommas((ClientPoints[i] + CurrentPoints[i]), szPointssizeof(szPoints));
CPrintToChat(i"{blue}%s \x01(%s) got points for killing Infected"NameszPoints); 
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline