/scorelist? rep +
#1

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

Like

/scorelist
===================
Russians 6 kills.
Italians 8 kills.
===================
Reply
#2

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?
Reply
#3

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.
Reply
#4

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?
Reply
#5

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.
Reply
#6

anyone?
Reply
#7

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 ...
Reply
#8

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;
}
Reply
#9

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
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)