25.02.2016, 10:45
I trying to make clickable text draw but when i click nothing happends mabye u guys might be able to help me out
ongamemodeint
ongamemodeint
PHP код:
TextDrawSetSelectable(TPdraw5, true);
TPdraw5 = TextDrawCreate(310.000000, 151.000000, "Los Santos");
TextDrawBackgroundColor(TPdraw5, 255);
TextDrawFont(TPdraw5, 3);
TextDrawLetterSize(TPdraw5, 0.479999, 1.399999);
TextDrawColor(TPdraw5, -1);
TextDrawSetOutline(TPdraw5, 0);
TextDrawSetProportional(TPdraw5, 1);
TextDrawSetShadow(TPdraw5, 1);
TextDrawSetSelectable(TPdraw5, 1);
PHP код:
public OnPlayerClickTextDraw(playerid, Text: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(playerid, 1085, 0.0, 0.0, 0.0);
return 1;
}
if(clickedid == TPdraw5)
{
SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
CancelSelectTextDraw(playerid);
}
return 1;
}
PHP код:
COMMAND:tp(playerid, params[])
{
if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
if(!AdminUser(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to create a admin user, /admincreate.");
if(GetPVarInt(playerid, "AdminLogged") == 0) return SendClientMessage(playerid, COLOR_GREY, "You need to login into your admin account, /adminlogin.");
if(GetPVarInt(playerid, "Admin") >= 1)
{
TextDrawShowForPlayer(playerid, TPdraw0); // Show the box
TextDrawShowForPlayer(playerid, TPdraw1); // Show the box
TextDrawShowForPlayer(playerid, TPdraw2); // Show the box
TextDrawShowForPlayer(playerid, TPdraw3); // Show the box
TextDrawShowForPlayer(playerid, TPdraw4); // Show the box
TextDrawShowForPlayer(playerid, TPdraw5); // Show the box
SelectTextDraw(playerid, 0xA3B4C5FF); // Allow the player to select textdraws.
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: You do not have access to this command!");
}
return 1;
}