Please help me about Textdraw
#1

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
Reply
#2

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;

Reply
#3

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
Reply
#4

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]);
       	}
       	
   	}
}
Reply
#5

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.
Reply
#6

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);
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)