OnPlayerClickTextDraw
#1

I trying to make clickable text draw but when i click nothing happends mabye u guys might be able to help me out


ongamemodeint

PHP код:
TextDrawSetSelectable(TPdraw5true);
TPdraw5 TextDrawCreate(310.000000151.000000"Los Santos");
    
TextDrawBackgroundColor(TPdraw5255);
    
TextDrawFont(TPdraw53);
    
TextDrawLetterSize(TPdraw50.4799991.399999);
    
TextDrawColor(TPdraw5, -1);
    
TextDrawSetOutline(TPdraw50);
    
TextDrawSetProportional(TPdraw51);
    
TextDrawSetShadow(TPdraw51);
    
TextDrawSetSelectable(TPdraw51); 
PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
       if(
GetPVarInt(playerid"furnc_active") == 0) return 0;
    
// Handle: They cancelled (with ESC)
    
if(clickedid == Text:INVALID_TEXT_DRAW) {
        
DestroyFurnitureSelectionMenu(playerid);
        
SetPVarInt(playerid"furnc_active"0);
        
PlayerPlaySound(playerid10850.00.00.0);
        return 
1;
    }
     if(
clickedid == TPdraw5)
    {
         
SendClientMessage(playerid0xFFFFFFAA"You clicked on a textdraw.");
         
CancelSelectTextDraw(playerid);
    }
    return 
1;

PHP код:
COMMAND:tp(playeridparams[])
{
    if (
GetPVarInt(playerid"PlayerLogged") == 0) return SendClientMessage(playeridCOLOR_WHITE"You must be logged in to use this.");
    if(!
AdminUser(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to create a admin user, /admincreate.");
    if(
GetPVarInt(playerid"AdminLogged") == 0) return SendClientMessage(playeridCOLOR_GREY"You need to login into your admin account, /adminlogin.");
    if(
GetPVarInt(playerid"Admin") >= 1)
    {
        
TextDrawShowForPlayer(playeridTPdraw0); // Show the box
        
TextDrawShowForPlayer(playeridTPdraw1); // Show the box
        
TextDrawShowForPlayer(playeridTPdraw2); // Show the box
        
TextDrawShowForPlayer(playeridTPdraw3); // Show the box
        
TextDrawShowForPlayer(playeridTPdraw4); // Show the box
        
TextDrawShowForPlayer(playeridTPdraw5); // Show the box
        
SelectTextDraw(playerid0xA3B4C5FF); // Allow the player to select textdraws.
    
}
    else
    {
         
SendClientMessage(playeridCOLOR_LIGHTRED"SERVER: You do not have access to this command!");
    }
    return 
1;

Reply
#2

Quote:
Originally Posted by SA-MP Wiki
The clickable area is defined by TextDrawTextSize. The x and y parameters passed to that function must not be zero or negative.
You need to use TextDrawTextSize to set a clickable area. If you haven't done that, the textdraw won't be clickable I'm pretty sure.
Reply
#3

Quote:
Originally Posted by Threshold
Посмотреть сообщение
You need to use TextDrawTextSize to set a clickable area. If you haven't done that, the textdraw won't be clickable I'm pretty sure.
U r right, my friend.
Reply
#4

Quote:
Originally Posted by SamJust
Посмотреть сообщение
U r right, my friend.
Why u just post a useless post lol xD


added that but still same problem.
Reply
#5

It's either TextSize or LetterSize. Or u got your numbers wrong.
And, btw, cuase I enjoy posting useless post, whyle I wait for someone to help me in my thread..
Reply
#6

Quote:
Originally Posted by SamJust
Посмотреть сообщение
It's either TextSize or LetterSize. Or u got your numbers wrong.
And, btw, cuase I enjoy posting useless post, whyle I wait for someone to help me in my thread..
No i don't think so , also i have use this https://sampforum.blast.hk/showthread.php?tid=328267
got same problem there lol.


Off topic you're not allowed to make useless post lol
Код:
No Useless Replies - If you are unsure or don't know how to proceed with solving an issue, then do not respond to the thread, it will be considered spam.
Reply
#7

U can use TextDrawUseBox(); to check if u got ur TextSize (it's actually TextSize, not Letter) right. And, Put this
PHP код:
TextDrawSetSelectable(TPdraw5true); 
bellow this
PHP код:
TPdraw5 TextDrawCreate(310.000000151.000000"Los Santos"); 
Why am I not allowed to make usless posts? These forum rules r boring wherever they have ones.
Reply
#8

Quote:
Originally Posted by SamJust
Посмотреть сообщение
U can use TextDrawUseBox(); to check if u got ur TextSize (it's actually TextSize, not Letter) right. And, Put this
PHP код:
TextDrawSetSelectable(TPdraw5true); 
bellow this
PHP код:
TPdraw5 TextDrawCreate(310.000000151.000000"Los Santos"); 
Why am I not allowed to make usless posts? These forum rules r boring wherever they have ones.
Okey I will try,

Don't ask me it's a rule lol 😂
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)