![]() |
|
[Pawn] PlayerTextDrawSetString - Printable Version +- open.mp forum (https://forum.open.mp) +-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) +--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) +--- Thread: [Pawn] PlayerTextDrawSetString (/showthread.php?tid=1479) |
PlayerTextDrawSetString - Torque - 2021-01-02 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;
}RE: PlayerTextDrawSetString - Pinch - 2021-01-02 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~ RE: PlayerTextDrawSetString - shane adevaratu - 2021-01-02 Increase the values in PlayerTextDrawTextSize. => PlayerTextDrawTextSize(playerid, p_LocationTextdraw[playerid][1], This_Value, Or_This_Value ); and this probably will solve your problem. |