26.12.2013, 09:10
Hello, i just made a clickable textdraw but seems to not work.
Here is:
OnGameModeInit
And this is where i make show the ShopTxd1:
This stock is called when you enter a checkpoint.
The problem is: The textdraw are showing but i can't click on them. Also the textdraw doesnt dissapear if i press ESC. What i did wrong?
Here is:
pawn Код:
new Text:ShopTxd1;
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(_:clickedid != INVALID_TEXT_DRAW)
{
if(clickedid == ShopTxd1)
{
SendClientMessage(playerid,COLOR_GREY,"You clicked textdraw 1");
}
CancelSelectTextDraw(playerid);
TextDrawHideForPlayer(playerid, ShopTxd1);
}
return 1;
}
pawn Код:
TextDrawSetSelectable(ShopTxd1, true);
pawn Код:
stock Shop(playerid)
{
if(pInfo[playerid][Logged] == 0) return SCM(playerid,0x0080C0FF,"Please login before using the shop.");
if(pInfo[playerid][Jailed] == 1) return SCM(playerid,0xFF0000FF,"You can't use the shop in jail.");
if(GetPVarInt(playerid, "spawned") == 0) return SCM(playerid, COLOR_LIGHTBLUE, "Please spawn before doing any action.");
if(pAlive[playerid] == 0) return SCM(playerid, COLOR_LIGHTBLUE, "You can't use the shop if you are dead.");
if(EnemyNear(playerid)) return SendClientMessage(playerid, red, "** You can't use the shop if enemies are near!");
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
SCM(playerid,red,"You can't access the shop if you are in a vehicle.");
return 1;
}
TextDrawShowForPlayer(playerid, ShopTxd1);
SelectTextDraw(playerid, 0xA3B4C5FF);
return 1;
}
The problem is: The textdraw are showing but i can't click on them. Also the textdraw doesnt dissapear if i press ESC. What i did wrong?