enable scoreboard

Started by Eva, Apr 10, 2016, 05:13 PM

Previous topic - Next topic

Eva

Hello, how can i enable the scoreboard in f5?

i have this code in my script:
function onServerStart()
{
     SetDeathmatchScoreBoard( true );
     //To enable Deathmatch score board.
}


and this is the error i get:


Thijn

That function doesn't exist. The scoreboard is already enabled by default, so I'm not sure what you mean.

Eva

#2
Well the scores dont show on the board, everything else does like ID playername and ping

KAKAN

Meh
function onPlayerKill( killer, player, bodypart, reason ){
killer.Score++; //Increases the score by 1.
}
function onPlayerTeamKill( killer, player, bodypart, reason ){
killer.Score--; //Decreases the score by 1.
}
oh no

Eva

Ahhh, sry im newb, i get it didnt know it had to be scripted thankyou!

KAKAN

Quote from: Ron on Apr 10, 2016, 09:20 PMAhhh, sry im newb, i get it didnt know it had to be scripted thankyou!
That's just new to VCMP 0.4.
0.3 had that facility, 0.4 doesn't. That's the difference, many more things are missing, like player.Gravity etc
oh no

Thijn

Quote from: KAKAN on Apr 11, 2016, 06:06 AM
Quote from: Ron on Apr 10, 2016, 09:20 PMAhhh, sry im newb, i get it didnt know it had to be scripted thankyou!
That's just new to VCMP 0.4.
0.3 had that facility, 0.4 doesn't. That's the difference, many more things are missing, like player.Gravity etc
I wouldn't call scores missing. They let you implement it yourself, which is flexible and awesome.

DizzasTeR

It would have been even more awesome if we could create our very own scoreboard and disable the default one :D That would give the oppertunity to modify and/or add more columns with other data's rather than just Nick, Score and Ping.

Xmair

Quote from: Doom_Kill3R on Apr 12, 2016, 04:17 AMIt would have been even more awesome if we could create our very own scoreboard and disable the default one :D That would give the oppertunity to modify and/or add more columns with other data's rather than just Nick, Score and Ping.
+1.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

KAKAN

Quote from: Xmair on Apr 12, 2016, 12:09 PM
Quote from: Doom_Kill3R on Apr 12, 2016, 04:17 AMIt would have been even more awesome if we could create our very own scoreboard and disable the default one :D That would give the oppertunity to modify and/or add more columns with other data's rather than just Nick, Score and Ping.
+1.
oh no

Coolkid

Quote from: KAKAN on Apr 12, 2016, 12:16 PM
Quote from: Xmair on Apr 12, 2016, 12:09 PM
Quote from: Doom_Kill3R on Apr 12, 2016, 04:17 AMIt would have been even more awesome if we could create our very own scoreboard and disable the default one :D That would give the oppertunity to modify and/or add more columns with other data's rather than just Nick, Score and Ping.
+1.

Eva

I got it to work, but somehow it doesnt count right, and i get an error in console.

function onPlayerKill( player, killer, reason, bodypart )
{
 if ( stats[ killed.ID ].LMS )
        {
         LMSCount--;
         local a = killer;
         EMessage( ">> " + killed.Name + " is out of the LMS round." );
         stats[ killed.ID ].LMS = false;
         if ( LMSCount == 1 ) CheckEnd( a );
       stats[ killed.ID ].Lost++;
        }
        killer.Score++; //Increases the score by 1.
        EchoMessage( "** [" + player.ID + "] " + player.Name + " was killed by " + killer.Name + "." );
        }


function onPlayerTeamKill( player, killer, reason, bodypart )
{
onPlayerKill( player, killer, reason, bodypart );
killer.Score--; //Decreases the score by 1.
}



Xmair

#12
Use:
function onPlayerKill( player, killer, reason, bodypart )
{
 if ( stats[ killed.ID ].LMS )
        {
         LMSCount--;
         local a = killer;
         EMessage( ">> " + killer.Name + " is out of the LMS round." );
         stats[ killer.ID ].LMS = false;
         if ( LMSCount == 1 ) CheckEnd( a );
       stats[ killer.ID ].Lost++;
        }
        killer.Score++; //Increases the score by 1.
        EchoMessage( "** [" + player.ID + "] " + player.Name + " was killed by " + killer.Name + "." );
        }


function onPlayerTeamKill( player, killer, reason, bodypart )
{
onPlayerKill( player, killer, reason, bodypart );
killer.Score--; //Decreases the score by 1.
}

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

rww

Join to Irrelevant Club Discord: https://discord.gg/MsPPZ5uV4X

KAKAN

Quote from: Xmair on Apr 14, 2016, 02:20 PMUse:
function onPlayerKill( player, killer, reason, bodypart )
Seriously?
Here's a fixed one:
function onPlayerKill( killer, player, reason, bodypart )
{
 if ( stats[ player.ID ].LMS )
        {
         LMSCount--;
         EMessage( ">> " + player.Name + " is out of the LMS round." );
         stats[ player.ID ].LMS = false;
         if ( LMSCount == 1 ) CheckEnd( killer );
       stats[ player.ID ].Lost++;
        }
        killer.Score++; //Increases the score by 1.
        EchoMessage( "** [" + player.ID + "] " + player.Name + " was killed by " + killer.Name + "." );
        }


function onPlayerTeamKill( killer, player, reason, bodypart )
{
onPlayerKill( killer, player, reason, bodypart );
killer.Score -= 2; //Decreases the score by 1.
}
oh no