Questions about stats.
#9

Quote:
Originally Posted by Misiur
Посмотреть сообщение
pawn Код:
//Insert this
new team[32];
switch(PlayerInfo[playerid][team]) {
    case TEAM_ME:
    {
        team = "Team medic";
        break;
    }
    case TEAM_SE:
    {
        team = "Team security";
        break;
    }
    case TEAM_TE:
    {
        team = "Team terrorists";
        break;
    }
    default:
    {
        team = "No team";
    }
}


format(str, sizeof(str), "Name:[ %s ]\nLevel:[ %d ]\nMoney: [ %d ]\nCurrent gun: [ %s ]", name, score, money, current_gun);
//to
format(str, sizeof(str), "Name:[ %s ]\nLevel:[ %d ]\nMoney: [ %d ]\nCurrent gun: [ %s ]\nFraction: [ %s ]", name, score, money, current_gun, team);
@edit:

I assume you have in playerinfo field which is enum for team. But I'm not 100% certain. Also if you have exact name team, then you'll get error about shadowing variable
Set the 'new team[32]' to 'new teams[16]' because with your usage you would be using 128 bytes when you only need to use 64 bytes. You are wasting 64 bytes which over time add up which shows your script isn't optimized.
Reply


Messages In This Thread
Questions about stats. - by TaLhA XIV - 27.07.2012, 10:19
Re: Questions about stats. - by Misiur - 27.07.2012, 10:21
Re: Questions about stats. - by TaLhA XIV - 27.07.2012, 11:10
Re: Questions about stats. - by TaLhA XIV - 27.07.2012, 12:24
Re: Questions about stats. - by Misiur - 27.07.2012, 12:32
Re: Questions about stats. - by Devilxz97 - 27.07.2012, 13:49
Re: Questions about stats. - by TaLhA XIV - 27.07.2012, 15:10
Re: Questions about stats. - by Misiur - 27.07.2012, 15:41
Re: Questions about stats. - by iTzZh - 27.07.2012, 16:02
Re: Questions about stats. - by Littlehelper - 27.07.2012, 17:59

Forum Jump:


Users browsing this thread: 1 Guest(s)