SA-MP Forums Archive
Problem With Selectable 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: Problem With Selectable Textdraw (/showthread.php?tid=632391)



Problem With Selectable Textdraw - akib - 13.04.2017

Код:
public OnPlayerConnect(playerid)
{
	engine = TextDrawCreate(514.400329, 205.333312, "Turn On Engine");
	TextDrawLetterSize(engine, 0.449999, 1.600000);
	TextDrawAlignment(engine, 1);
	TextDrawColor(engine, -1);
	TextDrawSetShadow(engine, 0);
	TextDrawSetOutline(engine, 1);
	TextDrawBackgroundColor(engine, 51);
	TextDrawFont(engine, 1);
	TextDrawSetProportional(engine, 1);
	PlayerTextDrawSetSelectable(playerid, engine, true);
	return 1;
}
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
		new vID=GetPlayerVehicleID(playerid);
      	        TextDrawShowForPlayer(playerid, engine);
  		PlayerTextDrawSetSelectable(playerid, engine, true);
     }
}
but it is not selectable :/


Re: Problem With Selectable Textdraw - Sanady - 13.04.2017

Quote:
Originally Posted by akib
Посмотреть сообщение
Код:
public OnPlayerConnect(playerid)
{
	engine = TextDrawCreate(514.400329, 205.333312, "Turn On Engine");
	TextDrawLetterSize(engine, 0.449999, 1.600000);
	TextDrawAlignment(engine, 1);
	TextDrawColor(engine, -1);
	TextDrawSetShadow(engine, 0);
	TextDrawSetOutline(engine, 1);
	TextDrawBackgroundColor(engine, 51);
	TextDrawFont(engine, 1);
	TextDrawSetProportional(engine, 1);
	PlayerTextDrawSetSelectable(playerid, engine, true);
	return 1;
}
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
		new vID=GetPlayerVehicleID(playerid);
      	        TextDrawShowForPlayer(playerid, engine);
  		PlayerTextDrawSetSelectable(playerid, engine, true);
     }
}
but it is not selectable :/
It is not selectable becouse you haven`t enabled textdraw box and give size to that box which you will enable.


Re: Problem With Selectable Textdraw - akib - 13.04.2017

Quote:
Originally Posted by Sanady
Посмотреть сообщение
It is not selectable becouse you haven`t enabled textdraw box and give size to that box which you will enable.
plz give me solution


Re: Problem With Selectable Textdraw - Sanady - 13.04.2017

Quote:
Originally Posted by akib
Посмотреть сообщение
plz give me solution
I gave you solution how to fix it, create box inside of that textdraw and make size of box same as a text that`s all.


Re: Problem With Selectable Textdraw - akib - 13.04.2017

Quote:
Originally Posted by Sanady
Посмотреть сообщение
I gave you solution how to fix it, create box inside of that textdraw and make size of box same as a text that`s all.
Fixed! THanks