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.