Team Score Update Help
#5

Quote:
Originally Posted by [MG]Dimi
View Post
UNTESTED:
pawn Code:
#include <a_samp>

new TEAM_I_SCORE = 0, TEAM_U_SCORE = 0, TEAM_P_SCORE = 0, TEAM_R_SCORE = 0, TEAM_U2_SCORE = 0;
new gTeam[MAX_PLAYERS];
#define TEAM_I 0
#define TEAM_U 1
#define TEAM_U2 2
#define TEAM_P 3
#define TEAM_R 4

public OnPlayerDeath(playerid,killerid,reason)
{
    SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
    switch(gTeam[playerid])/*I guess you used gTeam, if not just change it*/
    {
        case TEAM_I: TEAM_I_SCORE++;
        case TEAM_U: TEAM_U_SCORE++;
        case TEAM_P: TEAM_P_SCORE++;
        case TEAM_R: TEAM_R_SCORE++;
        case TEAM_U2: TEAM_U2_SCORE++;
        default: return 1;
    }
    return 1;
}

public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/teamscore",true))
    {
        new msg[128];
        switch(gTeam[playerid])
        {
            case TEAM_U: format(msg,128,"Your Team Score: %i",TEAM_U_SCORE);
            case TEAM_I: format(msg,128,"Your Team Score: %i",TEAM_I_SCORE);
            case TEAM_P: format(msg,128,"Your Team Score: %i",TEAM_P_SCORE);
            case TEAM_R: format(msg,128,"Your Team Score: %i",TEAM_R_SCORE);
            case TEAM_U2: format(msg,128,"Your Team Score: %i",TEAM_U2_SCORE);
            default: return 1;
        }
        SendClientMessage(playerid,0xFF0000FF,msg);
        return 1;
    }
    return 0;
}
Hey man its good but if the server restarts the score will become 0.Please tell hohw to save it and then load it when the server starts again.
Reply


Messages In This Thread
Team Score Update Help - by §с†¶e®РµРe - 16.12.2011, 14:00
Re: Team Score Update Help - by §с†¶e®РµРe - 16.12.2011, 14:12
Re: Team Score Update Help - by Tigerkiller - 16.12.2011, 14:20
Re: Team Score Update Help - by [MG]Dimi - 16.12.2011, 14:54
Re: Team Score Update Help - by §с†¶e®РµРe - 17.12.2011, 03:00
Re: Team Score Update Help - by Ballu Miaa - 17.12.2011, 03:37
Re: Team Score Update Help - by §с†¶e®РµРe - 17.12.2011, 04:00

Forum Jump:


Users browsing this thread: 1 Guest(s)