07/01/2023 20:28
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if (PlayerData[playerid][dDropped] || IsPlayerAdminDuty(playerid))
return 1;
if (GetPVarInt(playerid, "varItensBase"))
{
if (clickedid == Text:INVALID_TEXT_DRAW || clickedid == textBaseCraft[1])
{
hideCraftItensBase(playerid);
}
// <<
else if (clickedid == textBaseCraft[2])
{
if (GetPVarInt(playerid, "pageCraftBase") > 0)
{
SetPVarInt(playerid, "pageCraftBase", GetPVarInt(playerid, "pageCraftBase") - 1);
updatePlayerCraftBaseText(playerid);
}
}
// >>
else if (clickedid == textBaseCraft[3])
{
if (GetPVarInt(playerid, "pageCraftBase") < MAX_PAGES_CRAFT_BASES)
{
SetPVarInt(playerid, "pageCraftBase", GetPVarInt(playerid, "pageCraftBase") + 1);
updatePlayerCraftBaseText(playerid);
}
}
}
#if defined qOnPlayerClickTextDraw
return qOnPlayerClickTextDraw(playerid, clickedid);
#else
return 1;
#endif
}
#if defined _ALS_OnPlayerClickTextDraw
#undef OnPlayerClickTextDraw
#else
#define _ALS_OnPlayerClickTextDraw
#endif
#define OnPlayerClickTextDraw qOnPlayerClickTextDraw
#if defined qOnPlayerClickTextDraw
forward qOnPlayerClickTextDraw(playerid, Text:clickedid);
#endif
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if (IsPlayerAdminDuty(playerid))
return 1;
if (GetPVarInt(playerid, "varItensBase"))
{
for(new text; text < 6; text++) {
if (playertextid == textPlayerBaseCraft[text])
{
new curitem = (GetPVarInt(playerid, "pageCraftBase") * 6);
SelectPlayerItem(playerid, curitem + text);
break;
}
}
}
#if defined qOPCPTD
return qOPCPTD(playerid, playertextid);
#else
return 1;
#endif
}
#if defined _ALS_OnPlayerClickPlayerTD
#undef OnPlayerClickPlayerTextDraw
#else
#define _ALS_OnPlayerClickPlayerTD
#endif
#define OnPlayerClickPlayerTextDraw qOPCPTD
#if defined qOPCPTD
forward qOPCPTD(playerid, PlayerText:playertextid);
#endif
{
if (PlayerData[playerid][dDropped] || IsPlayerAdminDuty(playerid))
return 1;
if (GetPVarInt(playerid, "varItensBase"))
{
if (clickedid == Text:INVALID_TEXT_DRAW || clickedid == textBaseCraft[1])
{
hideCraftItensBase(playerid);
}
// <<
else if (clickedid == textBaseCraft[2])
{
if (GetPVarInt(playerid, "pageCraftBase") > 0)
{
SetPVarInt(playerid, "pageCraftBase", GetPVarInt(playerid, "pageCraftBase") - 1);
updatePlayerCraftBaseText(playerid);
}
}
// >>
else if (clickedid == textBaseCraft[3])
{
if (GetPVarInt(playerid, "pageCraftBase") < MAX_PAGES_CRAFT_BASES)
{
SetPVarInt(playerid, "pageCraftBase", GetPVarInt(playerid, "pageCraftBase") + 1);
updatePlayerCraftBaseText(playerid);
}
}
}
#if defined qOnPlayerClickTextDraw
return qOnPlayerClickTextDraw(playerid, clickedid);
#else
return 1;
#endif
}
#if defined _ALS_OnPlayerClickTextDraw
#undef OnPlayerClickTextDraw
#else
#define _ALS_OnPlayerClickTextDraw
#endif
#define OnPlayerClickTextDraw qOnPlayerClickTextDraw
#if defined qOnPlayerClickTextDraw
forward qOnPlayerClickTextDraw(playerid, Text:clickedid);
#endif
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if (IsPlayerAdminDuty(playerid))
return 1;
if (GetPVarInt(playerid, "varItensBase"))
{
for(new text; text < 6; text++) {
if (playertextid == textPlayerBaseCraft[text])
{
new curitem = (GetPVarInt(playerid, "pageCraftBase") * 6);
SelectPlayerItem(playerid, curitem + text);
break;
}
}
}
#if defined qOPCPTD
return qOPCPTD(playerid, playertextid);
#else
return 1;
#endif
}
#if defined _ALS_OnPlayerClickPlayerTD
#undef OnPlayerClickPlayerTextDraw
#else
#define _ALS_OnPlayerClickPlayerTD
#endif
#define OnPlayerClickPlayerTextDraw qOPCPTD
#if defined qOPCPTD
forward qOPCPTD(playerid, PlayerText:playertextid);
#endif