SA-MP Forums Archive
/scorelist? rep + - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /scorelist? rep + (/showthread.php?tid=337548)



/scorelist? rep + - oscar7610 - 26.04.2012

I want to make a score list /scorelist for teams (currently have 6)

Like

/scorelist
===================
Russians 6 kills.
Italians 8 kills.
===================


Re: /scorelist? rep + - MP2 - 26.04.2012

You're not giving enough details, elaborate.

How do you store the data?
Do you already store it? If so, we need to know what variables you use etc.

How do you want it displayed?
Chat? Dialog? Textdraw? Cheese?

What team variables etc. are you using?
How can someone write code for something they know nothing about?


Re: /scorelist? rep + - oscar7610 - 26.04.2012

I only have.
pawn Code:
#include <a_samp>
#include <sscanf2>
#include <SII>
#include <dini>
#include <streamer>
#include <func>
I want a cmd /scorelist.

Teams/
pawn Code:
#define ITALIAN_MAFIA 0
#define RUSSIAN_MAFIA 1
#define HITMANS 2
#define BIKER 3
#define ELITEG 4
#define GANGZ 5
When for example a russian kills an italian it show.

/scorelist
==========
Russian 1 kills.
Italian 0 kills.
Bikers 0 kills. etc etc ....
========== Like that


understood? im a newb here.


Re: /scorelist? rep + - MP2 - 26.04.2012

You still haven't answered my questions:
Quote:
Originally Posted by MP2
View Post
How do you store the data?
Do you already store it? If so, we need to know what variables you use etc.

How do you want it displayed?
Chat? Dialog? Textdraw? Cheese?



Re: /scorelist? rep + - oscar7610 - 26.04.2012

Quote:
Originally Posted by MP2
View Post
You still haven't answered my questions:
Displayed chat.

And the store thing I dont have I think yeah. can we use Dini? I have Luxadmin too.


Re: /scorelist? rep + - oscar7610 - 26.04.2012

anyone?


Re: /scorelist? rep + - ViniBorn - 26.04.2012

Each team kill, store the number in a variable.

Example for 1 team :
pawn Code:
new Kills;

//OnPlayerDeath
if(team[killerid] == ITALIAN_MAFIA)
    Kill++;
Now it's your turn ...


Re: /scorelist? rep + - [MG]Dimi - 26.04.2012

pawn Code:
//top of script
new TeamScore[6] = 0;

//callback
public OnPlayerDeath(playerid,killerid,reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        TeamScore[GetPlayerTeam(killerid)]++;
    }
    return 1;
}

//command

public OnPlayerCommandText(playerid,cmdtext[]) // I guess you are using strcmp
{
    if(!strcmp("/scorelist",cmdtext,true))
    {
        new string[128];
        SendClientMessage(playerid,0xFFFF00FF,"Team Scores:");
        format(string,128,"1) Italian Mafia: %d",TeamScore[0]);
        SendClientMessage(playerid,0xFFFF00FF,string);
        format(string,128,"2) Russian Mafia: %d",TeamScore[1]);
        SendClientMessage(playerid,0xFFFF00FF,string);
        format(string,128,"3) Hitmans: %d",TeamScore[2]);
        SendClientMessage(playerid,0xFFFF00FF,string);
        format(string,128,"4) Bikers: %d",TeamScore[3]);
        SendClientMessage(playerid,0xFFFF00FF,string);
        format(string,128,"5) EliteG: %d",TeamScore[4]);
        SendClientMessage(playerid,0xFFFF00FF,string);
        format(string,128,"6) Gangz: %d",TeamScore[5]);
        SendClientMessage(playerid,0xFFFF00FF,string);
        return 1;
    }
    return 0;
}



Re: /scorelist? rep + - oscar7610 - 26.04.2012

pawn Code:
C:\Users\Oscar\Desktop\*\Gangwarz\gamemodes\backup.pwn(1022) : error 017: undefined symbol "TeamScore"
C:\Users\Oscar\Desktop\*\Gangwarz\gamemodes\backup.pwn(1022) : error 001: expected token: ";", but found "]"
C:\Users\Oscar\Desktop\*\Gangwarz\gamemodes\backup.pwn(1022) : error 029: invalid expression, assumed zero
C:\Users\Oscar\Desktop\*\Gangwarz\gamemodes\backup.pwn(1022) : fatal error 107: too many error messages on one line



Re: /scorelist? rep + - ViniBorn - 26.04.2012

It is easier to use a function that gets the team's name.
Avoid the use of many SendClientMessage / format