SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 26/04/2012, 08:02 PM   #1
oscar7610
Huge Clucker
 
Join Date: Feb 2012
Posts: 265
Reputation: 7
Default /scorelist? rep +

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

Like

/scorelist
===================
Russians 6 kills.
Italians 8 kills.
===================
oscar7610 is offline   Reply With Quote
Old 26/04/2012, 08:41 PM   #2
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,236
Reputation: 1004
Default Re: /scorelist? rep +

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?
__________________
Owner and developer of Mike's Cops and Robbers.

Click here to visit our site and find out more. Click here to view trailers.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Old 26/04/2012, 08:56 PM   #3
oscar7610
Huge Clucker
 
Join Date: Feb 2012
Posts: 265
Reputation: 7
Default Re: /scorelist? rep +

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.
oscar7610 is offline   Reply With Quote
Old 26/04/2012, 09:06 PM   #4
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,236
Reputation: 1004
Default Re: /scorelist? rep +

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?
__________________
Owner and developer of Mike's Cops and Robbers.

Click here to visit our site and find out more. Click here to view trailers.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Old 26/04/2012, 09:09 PM   #5
oscar7610
Huge Clucker
 
Join Date: Feb 2012
Posts: 265
Reputation: 7
Default Re: /scorelist? rep +

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.
oscar7610 is offline   Reply With Quote
Old 26/04/2012, 09:34 PM   #6
oscar7610
Huge Clucker
 
Join Date: Feb 2012
Posts: 265
Reputation: 7
Default Re: /scorelist? rep +

anyone?
oscar7610 is offline   Reply With Quote
Old 26/04/2012, 09:46 PM   #7
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,314
Reputation: 720
Default Re: /scorelist? rep +

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 ...
__________________



CONTATO: F A C E B O O K: @vinibornpawn

ViniBorn is offline   Reply With Quote
Old 26/04/2012, 09:48 PM   #8
[MG]Dimi
High-roller
 
[MG]Dimi's Avatar
 
Join Date: Mar 2011
Location: Serbia
Posts: 1,239
Reputation: 144
Default Re: /scorelist? rep +

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;
}
__________________
Scripting Admin/Account/VIP Systems for $$$ using ZCMD,dcmd, Dini, MySQL and sscanf.Scripting IRC Systems with all possible functions. (Echo channels, Chat channels, Admin channels...)Long time Experience with IRC Systems.For both offers PM me
Mini Games ServerServer IP:178.238.236.62:7777
[MG]Dimi is offline   Reply With Quote
Old 26/04/2012, 09:54 PM   #9
oscar7610
Huge Clucker
 
Join Date: Feb 2012
Posts: 265
Reputation: 7
Default Re: /scorelist? rep +

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
oscar7610 is offline   Reply With Quote
Old 26/04/2012, 09:58 PM   #10
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,314
Reputation: 720
Default Re: /scorelist? rep +

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



CONTATO: F A C E B O O K: @vinibornpawn

ViniBorn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Account + ScoreList saiberfun Help Archive 1 18/07/2009 05:17 PM


All times are GMT. The time now is 11:26 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.