17.11.2009, 13:29
Hello there I have created a stats box for my gamemode it doesn't give any errors or anything but the box doesn't show up in game. In this script I am going to show you I have putted the stats underneath the money:
At the top:
OnPlayerCommandText:
The box are going to be showing all the time when a player types /statbox, but the text draws doesn't show, could anyone help me getting out of this?
At the top:
pawn Код:
New Text: Stats;
pawn Код:
if(strcmp(cmd, "/statsbox", true) ==0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] == 1)
{
new otext[20];
if(PlayerInfo[playerid][pOrigin] == 1) { otext = "USA"; }
else if(PlayerInfo[playerid][pOrigin] == 2) { otext = "Europe"; }
else if(PlayerInfo[playerid][pOrigin] == 3) { otext = "Asia"; }
else if(PlayerInfo[playerid][pOrigin] == 4) { otext = "Africa"; }
new name[MAX_PLAYER_NAME];
new level = PlayerInfo[playerid][pLevel];
new age = PlayerInfo[playerid][pAge];
new pnumber = PlayerInfo[playerid][pPnumber];
new coordsstring[256];
format(coordsstring, sizeof(coordsstring),"< %s >",name);
Stats = TextDrawCreate(507, 145, coordsstring);
format(coordsstring, sizeof(coordsstring), "Level:[%d]", level);
Stats = TextDrawCreate(507, 155, coordsstring);
format(coordsstring, sizeof(coordsstring), "Age:[%d]", age);
Stats = TextDrawCreate(507, 165, coordsstring);
format(coordsstring, sizeof(coordsstring), "Origin:[%d]",otext);
Stats = TextDrawCreate(507, 175, coordsstring);
format(coordsstring, sizeof(coordsstring), "Ph:[%d]",pnumber);
Stats = TextDrawCreate(507, 185, coordsstring);
Stats = TextDrawCreate(507, 196, "_______________");
TextDrawAlignment(Stats, 1);
TextDrawFont(Stats, 1);
TextDrawLetterSize(Stats, 0.1, 0.1);
TextDrawColor(Stats, COLOR_LIGHT_BLUE);
}
}
return 1;
}