[help]A new textdraw problem
#1

Ok. Hello guys. I hope you can help.

I got this problem:


with this script:
pawn Код:
public DisplayStats(targetid, playerid)
{
    if(IsPlayerConnected(targetid) && gLogged[targetid])
    {
        new str[32];
      new txt_sex[8];
      switch pInfo[targetid][Sex] do {
        case 1: format(txt_sex, 8, "Male");
      case 2: format(txt_sex, 8, "Female");
      }
      format(str, sizeof(str), "~w~Level: ~b~~h~%d", pInfo[targetid][Level]);
        StatsTD[playerid][0] = TextDrawCreate(510, 300, str);
        format(str, sizeof(str), "~w~Hours: ~b~~h~%d", pInfo[targetid][Hours]);
        StatsTD[playerid][1] = TextDrawCreate(510, 316, str);
        format(str, sizeof(str), "~w~Cash: ~b~~h~$%d", pInfo[targetid][Cash]);
        StatsTD[playerid][2] = TextDrawCreate(510, 332, str);
        format(str, sizeof(str), "~w~Age: ~b~~h~%d", pInfo[targetid][Age]);
        StatsTD[playerid][3] = TextDrawCreate(510, 448, str);
        format(str, sizeof(str), "~w~Sex: ~b~~h~%s", txt_sex);
        StatsTD[playerid][4] = TextDrawCreate(510, 464, str);
        format(str, sizeof(str), "~w~Kills: ~b~~h~%d", pInfo[targetid][Kills]);
        StatsTD[playerid][5] = TextDrawCreate(510, 472, str);
        format(str, sizeof(str), "~w~Deaths: ~b~~h~%d", pInfo[targetid][Deaths]);
        StatsTD[playerid][6] = TextDrawCreate(510, 488, str);
        TextDrawUseBox(StatsTD[playerid][0], true); TextDrawShowForPlayer(playerid, StatsTD[playerid][0]);
        TextDrawUseBox(StatsTD[playerid][1], true); TextDrawShowForPlayer(playerid, StatsTD[playerid][1]);
        TextDrawUseBox(StatsTD[playerid][2], true); TextDrawShowForPlayer(playerid, StatsTD[playerid][2]);
        TextDrawUseBox(StatsTD[playerid][3], true); TextDrawShowForPlayer(playerid, StatsTD[playerid][3]);
        TextDrawUseBox(StatsTD[playerid][4], true); TextDrawShowForPlayer(playerid, StatsTD[playerid][4]);
        TextDrawUseBox(StatsTD[playerid][5], true); TextDrawShowForPlayer(playerid, StatsTD[playerid][5]);
        TextDrawUseBox(StatsTD[playerid][6], true); TextDrawShowForPlayer(playerid, StatsTD[playerid][6]);
      return 1;
    }
    return 0;
}
the text draws just don't display. can anyone tell me why? only 3 are there but the others aren't, probable lower... ;/
Reply
#2

I'm not quite sure what you're switch do thing is all about.. Normally it's:

[pawn]
switch(thing to switch) {
case 1:
case 2:
default:
}

And I see you've adopted my user-bar...
Reply
#3

also make sure that the variable you're using is large enough
new StatsTD[MAX_PLAYERS][7];
Reply
#4

it is, i do not get any errors. and I use 'do' because when I got an error it said found -identifier- should be 'do'. it was a wrong syntax but it works this way...

it works, but the coordinates are messed up!

what do you mean i've adapted? I've made my own :PP
Reply
#5

I said adopted, and you didn't make the user bar I did..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)