SA-MP Forums Archive
Problem TextDraw in turf - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem TextDraw in turf (/showthread.php?tid=154774)



Problem TextDraw in turf - eXtr1kE - 15.06.2010

When going through an area, to show you a TextDraw, as I do that?



Re: Problem TextDraw in turf - MEXICAN_NORTE - 15.06.2010

can u explain better??


Re: Problem TextDraw in turf - eXtr1kE - 16.06.2010

****** Translate is bad, what to do?
So, when passing through an area, to show me a TextDraw.


Re: Problem TextDraw in turf - randomkid88 - 16.06.2010

Do you want TextDraw or GameText?

You can use gametext with IsPlayerInRangeOfPoint, like this.

Set a timer:
pawn Код:
new msgtimer;
forward msgtimer;
public OnGamemodeInit()
{
   msgtimer = SetTimer("msgtimer", 3000, true); // change 3000 to whatever time you want, in milliseconds
   // rest of stuff
}

public msgtimer()
{
   for(new i=0;i<MAX_PLAYERS;i++)
   {
     if(IsPlayerInRangeOfPoint(i,300,x, y, z)) // I didn't check the function order but I think its playerid, range, X coord, Y coord, Z coord.
     {
        GameTextForPlayer(i, "You are entering an area", 3000, 4); // 3000 is time and 4 is style. Check wiki for more info https://sampwiki.blast.hk/wiki/GameTextStyle
     }
   }
   return 1;
}
Sorry for any errors, I'm tired


Re: Problem TextDraw in turf - eXtr1kE - 16.06.2010

Not so, I as an example, they make a GangZone when I get into it to defend a TextDraw. And when out of it disappear.
Sorry if I expressed wrong... ****** Translate goes wrong.


Re: Problem TextDraw in turf - Flashy - 16.06.2010

Quote:
Originally Posted by eXtr1kE
Not so, I as an example, they make a GangZone when I get into it to defend a TextDraw. And when out of it disappear.
Sorry if I expressed wrong... ****** Translate goes wrong.
He means that he want to enable a Textdraw when he get into an Area/Gangzone.



Re: Problem TextDraw in turf - eXtr1kE - 16.06.2010

Look we used the function IsPlayerInArea :

public IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}

I put in OnPlayerSpawn :

if(IsPlayerInArea(playerid, -1591.064, 1702.824, -1741.078, 1539.302))
{
PD = TextDrawCreate(0.0, 434.0,"Police Departament Turf.");
TextDrawFont(PD,3);
TextDrawLetterSize(PD,10,10);
TextDrawColor(PD,0xF6F6F6FF);
TextDrawSetShadow(PD,1);
TextDrawSetOutline(PD,1);
TextDrawBackgroundColor(PD,0x000FF);
TextDrawUseBox(PD,0);
return 1;
}

The problem is that nothing is seen


Re: Problem TextDraw in turf - MichalGusta - 16.06.2010

Try to remove the textdraw and use a client side message for debugging.