Selecting textdraws with keys -
PeterJane - 28.06.2015
Hi guys.
Title explains my question. How can I select a textdraw using keys instead of mouse? Thank you.
Re: Selecting textdraws with keys -
Bomber07 - 28.06.2015
Код:
// This variable is used to store the id of the textdraw
// so that we can use it throught the script
new Text:welcomeText;
public OnGameModeInit()
{
// This line is used to create the textdraw.
// Note: This creates a textdraw without any formatting.
welcomeText = TextDrawCreate(240.0,580.0,"Welcome to my SA-MP server");
return 1;
}
public OnPlayerConnect(playerid)
{
//This is used to show the player the textdraw when they connect.
TextDrawShowForPlayer(playerid,welcomeText);
}
Re: Selecting textdraws with keys -
!damo!spiderman - 28.06.2015
Quote:
Originally Posted by Bomber07
Код:
// This variable is used to store the id of the textdraw
// so that we can use it throught the script
new Text:welcomeText;
public OnGameModeInit()
{
// This line is used to create the textdraw.
// Note: This creates a textdraw without any formatting.
welcomeText = TextDrawCreate(240.0,580.0,"Welcome to my SA-MP server");
return 1;
}
public OnPlayerConnect(playerid)
{
//This is used to show the player the textdraw when they connect.
TextDrawShowForPlayer(playerid,welcomeText);
}
|
This is nothing to do with what he actually asked for...
You cannot really select a textdraw with keyboard. I assume you mean an alternative to OnPlayerClickTextDraw. How would sa-mp know what textdraw you want selected? There's no X,Y screen coordinates for keyboards like there is for mice
Respuesta: Selecting textdraws with keys -
[DOG]irinel1996 - 28.06.2015
You can use a variable and the keys to change TextDraws properties (depending on the variable's value).
Re: Respuesta: Selecting textdraws with keys -
PeterJane - 28.06.2015
Quote:
Originally Posted by !damo!spiderman
This is nothing to do with what he actually asked for...
You cannot really select a textdraw with keyboard. I assume you mean an alternative to OnPlayerClickTextDraw. How would sa-mp know what textdraw you want selected? There's no X,Y screen coordinates for keyboards like there is for mice
|
Thank you for letting me know.
There is a workaround I guess.
Quote:
Originally Posted by [DOG]irinel1996
You can use a variable and the keys to change TextDraws properties (depending on the variable's value).
|
Variables, timer, GetPlayerKeys and textdraw settings?
I'll give it a try.
Thank you.
Respuesta: Selecting textdraws with keys -
[DOG]irinel1996 - 28.06.2015
Actually you don't need a timer, you can use OnPlayerUpdate (with GetPlayerKeys) and GetTickCount. Give a try, there's nothing better than something when you make it by yourself. If you need help, just ask here and I'll help you.
Best regards.
Re: Selecting textdraws with keys -
shadowdog - 28.06.2015
You could show the player the textdraws, and set a variable if he's in the selection.
Then under OnPlayerKeyStateChange, you check if is the player is in the selection. If they press the arrow keys for example, you give them the illusion that they are scrolling through the selection, using different colors for the 'currently selected' and the other.
If the player presses the next keys, you make the next button the other color and set the other back. With the same method you can keep track of which button he is at, so that when he presses the confirm key, the righ function pops up.
Respuesta: Re: Selecting textdraws with keys -
[DOG]irinel1996 - 28.06.2015
Quote:
Originally Posted by shadowdog
You could show the player the textdraws, and set a variable if he's in the selection.
Then under OnPlayerKeyStateChange, you check if is the player is in the selection. If they press the arrow keys for example, you give them the illusion that they are scrolling through the selection, using different colors for the 'currently selected' and the other.
If the player presses the next keys, you make the next button the other color and set the other back. With the same method you can keep track of which button he is at, so that when he presses the confirm key, the righ function pops up.
|
We have a problem there,
OnPlayerKeyStateChange isn't called for directional keys.
But that's the idea, yes.
Re: Selecting textdraws with keys -
Ritzy2K - 28.06.2015
Quote:
Originally Posted by Bomber07
Код:
// This variable is used to store the id of the textdraw
// so that we can use it throught the script
new Text:welcomeText;
public OnGameModeInit()
{
// This line is used to create the textdraw.
// Note: This creates a textdraw without any formatting.
welcomeText = TextDrawCreate(240.0,580.0,"Welcome to my SA-MP server");
return 1;
}
public OnPlayerConnect(playerid)
{
//This is used to show the player the textdraw when they connect.
TextDrawShowForPlayer(playerid,welcomeText);
}
|
Nice copy & paste..dumb you didnt read his question.
Edit: you should ask gammix he uses directional key to change textdraw in his gta v menu include... or if u have enough pawn knowledge check his include to understand yourself...
cheers.
Re: Selecting textdraws with keys -
hamzajaved780 - 28.06.2015
Quote:
Originally Posted by [ND]xXZeusXx.
Originally Posted by MafiaOink View Post
i am from pakistan and i love bombing and ak47 attack
|
I think one should not comment without knowing the reality.As this is not a political forum so I'll limit my comment to this.