SA-MP Forums Archive
Please help me about Textdraw - 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)
+--- Thread: Please help me about Textdraw (/showthread.php?tid=646238)



Please help me about Textdraw - hoanduy - 13.12.2017

How do we when we are standing in the radius of some textdraw will appear, while out of the radius will hide Textdraw.

My English is not good. Sorry


Re: Please help me about Textdraw - RIDE2DAY - 13.12.2017

Get Incognito's streamer and make use of the dynamic areas, for example:
PHP код:
new my_area;
public 
OnGameModeInit()
{
    
my_area CreateDynamicSphere(xyzradius); // Create the area, in this case it's a 3D sphere.
    
return 1;
}
public 
OnPlayerEnterDynamicArea(playeridareaid)
{
    if(
areaid == my_area)
    {
        
TextDrawShowForPlayer(playeridmy_textdraw); // Show the TD when entering the area.
        
return 1;
    }
    return 
1;
}
public 
OnPlayerLeaveDynamicArea(playeridareaid)
{
    if(
areaid == my_area)
    {
        
TextDrawHideForPlayer(playeridmy_textdraw); // Hide the TD when leaving the area.
        
return 1;
    }
    return 
1;




Re: Please help me about Textdraw - hoanduy - 13.12.2017

Quote:
Originally Posted by RIDE2DAY
Посмотреть сообщение
Get Incognito's streamer and make use of the dynamic areas, for example:
PHP код:
new my_area;
public 
OnGameModeInit()
{
    
my_area CreateDynamicSphere(xyzradius); // Create the area, in this case it's a 3D sphere.
    
return 1;
}
public 
OnPlayerEnterDynamicArea(playeridareaid)
{
    if(
areaid == my_area)
    {
        
TextDrawShowForPlayer(playeridmy_textdraw); // Show the TD when entering the area.
        
return 1;
    }
    return 
1;
}
public 
OnPlayerLeaveDynamicArea(playeridareaid)
{
    if(
areaid == my_area)
    {
        
TextDrawHideForPlayer(playeridmy_textdraw); // Hide the TD when leaving the area.
        
return 1;
    }
    return 
1;

Thank you very much


Re: Please help me about Textdraw - jasperschellekens - 13.12.2017

Quote:
Originally Posted by RIDE2DAY
Посмотреть сообщение
Get Incognito's streamer and make use of the dynamic areas, for example:
PHP код:
new my_area;
public 
OnGameModeInit()
{
    
my_area CreateDynamicSphere(xyzradius); // Create the area, in this case it's a 3D sphere.
    
return 1;
}
public 
OnPlayerEnterDynamicArea(playeridareaid)
{
    if(
areaid == my_area)
    {
        
TextDrawShowForPlayer(playeridmy_textdraw); // Show the TD when entering the area.
        
return 1;
    }
    return 
1;
}
public 
OnPlayerLeaveDynamicArea(playeridareaid)
{
    if(
areaid == my_area)
    {
        
TextDrawHideForPlayer(playeridmy_textdraw); // Hide the TD when leaving the area.
        
return 1;
    }
    return 
1;

Can this also be used to check if the player is not at CreateDynamicSphere(x, y, z, radius);?
Im creating a tutorial script
So like when you get away from this area it sends clientmessage to complete tutorial and tps player back.
I now have this using timers.

Код:
//==============================================================================
stock Tutorial1Timer(playerid, time)
{
	tutorial1extimer[playerid] = SetTimerEx("Tutorial1Timer2", time, true, "i", playerid);
}
forward Tutorial1Timer2(playerid);
public Tutorial1Timer2(playerid)
{
    if(!IsPlayerInRangeOfPoint(playerid, 5.0, 3603.6953,-1503.7928,9.6853))
	{
        if(DoingTutorial1[playerid] == 1 || DoingTutorial2[playerid] == 1)
        {
	   		SetPlayerPos(playerid,3603.6953,-1503.7928,9.6853);
       		ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Tutorial", "Complete the tutorial first", "OK", "");
       	}
       	else
       	{
       	    KillTimer(tutorial1extimer[playerid]);
       	}
       	
   	}
}



Re: Please help me about Textdraw - hoanduy - 13.12.2017

So how do I set up CreateDynamicCircle in the area of ​​a parking spot.
For example, I have ParkZone's Info, namely ParkZone[x][pzPosX], ParkZone[x][pzPosY], ParkZone[x][pzSize].
Then will be CreateDynamicCircle (ParkZone[x][pzPosX], ParkZone[x][pzPosY], ParkZone[x][pzSize]);
But it does not work in my Gamemode.


Re: Please help me about Textdraw - jasperschellekens - 13.12.2017

try this:
btw: dunno what this does: ParkZone[x][pzSize]); but this should be ParkZone[x][pzPosZ] right?
Код:
new Float:DCx,Float:DCy,Float:DCz; // dc - dynamic circle

DCx = ParkZone[x][pzPosX];
DCy = ParkZone[x][pzPosY];
DCz = ParkZone[x][pzPosZ];
CreateDynamicCircle (DCx, DCy, DCz, ratius);



Re: Please help me about Textdraw - RogueDrifter - 13.12.2017

or you can use if(IsPlayerInRangeOfPoint(playerid,RANGE,x,y,z)) textdrawshow else textdrawhide and hide it onplayerconnet/disconnect but i bet ride's way is more efficient use it if you're able to comprehend it otherwise refer to this tut about radius https://sampforum.blast.hk/showthread.php?tid=474980