• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] PlayerTextDrawSetString
#1
I'm having an issue with this function. I have the below code:



Code:
new zone[28];

GetPlayer3DZone(i, zone, MAX_ZONE_NAME);

PlayerTextDrawSetString(i, p_LocationTextdraw[i][1], zone);





The issue is that when it prints it onto the screen, every word is on a new line. I know that a string is meant to be something like "This_is_one_line" but since the 3D Zone string that's produced has spaces instead of underscores, it's difficult to get it to work correct.



Any tips?



Code:
stock GetPlayer3DZone(playerid, zone[], len) //Credits to Cueball, Betamaster, Mabako, and Simon (for finetuning).

{

new Float:x, Float:y, Float:z;

GetPlayerPos(playerid, x, y, z);

for(new i = 0; i != sizeof(gSAZones); i )

{

if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4] && z >= gSAZones[i][SAZONE_AREA][2] && z <= gSAZones[i][SAZONE_AREA][5])

{

? ? return format(zone, len, gSAZones[i][SAZONE_NAME], 0);

}

}

return 0;

}
  Reply
#2
Are you sure that you ain't doing something wrong elsewhere? As far as I know know, the PlayerTextDrawSetString doesn't require any underscores for the new line, it's using gametext formatting so it'd be ~n~
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#3
Increase the values in PlayerTextDrawTextSize. => PlayerTextDrawTextSize(playerid, p_LocationTextdraw[playerid][1], This_Value, Or_This_Value ); and this probably will solve your problem.
  Reply


Forum Jump: