It still doesnt work for me, heres the code:
pawn Код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(ShowingStats[playerid])
{
if(playertextid == Textdraw28)
{
HidePlayerStatusTextDraws(playerid);
CancelSelectTextDraw(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "The textdraw was canceled successfuly!.");
ShowingStats[playerid] = 0;
return 1;
}
}
if(GetPVarInt(playerid, "mS_list_active") == 1 || (GetTickCount()-GetPVarInt(playerid, "mS_list_time")) > 200)
{
new curpage = GetPVarInt(playerid, "mS_list_page");
// Handle: cancel button
if(playertextid == gCancelButtonTextDrawId[playerid]) {
new listID = mS_GetPlayerCurrentListID(playerid);
if(listID == mS_CUSTOM_LISTID)
{
new extraid = GetPVarInt(playerid, "mS_custom_extraid");
HideModelSelectionMenu(playerid);
CallLocalFunction("OnPlayerModelSelectionEx", "dddd", playerid, 0, extraid, -1);
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
else
{
HideModelSelectionMenu(playerid);
CallLocalFunction("OnPlayerModelSelection", "dddd", playerid, 0, listID, -1);
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
return 1;
}
// Handle: next button
if(playertextid == gNextButtonTextDrawId[playerid]) {
new listID = mS_GetPlayerCurrentListID(playerid);
if(listID == mS_CUSTOM_LISTID)
{
if(curpage < (mS_GetNumberOfPagesEx(playerid) - 1)) {
SetPVarInt(playerid, "mS_list_page", curpage + 1);
mS_ShowPlayerMPs(playerid);
mS_UpdatePageTextDraw(playerid);
PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
} else {
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
}
else
{
if(curpage < (mS_GetNumberOfPages(listID) - 1)) {
SetPVarInt(playerid, "mS_list_page", curpage + 1);
mS_ShowPlayerMPs(playerid);
mS_UpdatePageTextDraw(playerid);
PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
} else {
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
}
return 1;
}
// Handle: previous button
if(playertextid == gPrevButtonTextDrawId[playerid]) {
if(curpage > 0) {
SetPVarInt(playerid, "mS_list_page", curpage - 1);
mS_ShowPlayerMPs(playerid);
mS_UpdatePageTextDraw(playerid);
PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
} else {
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
return 1;
}
// Search in the array of textdraws used for the items
new x=0;
while(x != mS_SELECTION_ITEMS) {
if(playertextid == gSelectionItems[playerid][x])
{
new listID = mS_GetPlayerCurrentListID(playerid);
if(listID == mS_CUSTOM_LISTID)
{
PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
new item_id = gSelectionItemsTag[playerid][x];
new extraid = GetPVarInt(playerid, "mS_custom_extraid");
HideModelSelectionMenu(playerid);
CallLocalFunction("OnPlayerModelSelectionEx", "dddd", playerid, 1, extraid, item_id);
return 1;
}
else
{
PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
new item_id = gSelectionItemsTag[playerid][x];
HideModelSelectionMenu(playerid);
CallLocalFunction("OnPlayerModelSelection", "dddd", playerid, 1, listID, item_id);
return 1;
}
}
x++;
}
}
return 1;
}
Under On
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(GetPVarInt(playerid, "mS_ignore_next_esc") == 1) {
SetPVarInt(playerid, "mS_ignore_next_esc", 0);
return CallLocalFunction("MP_OPCTD", "ii", playerid, _:clickedid);
}
if(GetPVarInt(playerid, "mS_list_active") == 0) return CallLocalFunction("MP_OPCTD", "ii", playerid, _:clickedid);
// Handle: They cancelled (with ESC)
if(clickedid == Text:INVALID_TEXT_DRAW)
{
if(ShowingStats[playerid])
{
HidePlayerStatusTextDraws(playerid);
CancelSelectTextDraw(playerid);
SendClientMessage(playerid, COLOR_YELLOW, "The textdraw was canceled successfuly!.");
ShowingStats[playerid] = 0;
return 1;
}
new listid = mS_GetPlayerCurrentListID(playerid);
if(listid == mS_CUSTOM_LISTID)
{
new extraid = GetPVarInt(playerid, "mS_custom_extraid");
mS_DestroySelectionMenu(playerid);
CallLocalFunction("OnPlayerModelSelectionEx", "dddd", playerid, 0, extraid, -1);
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
else
{
mS_DestroySelectionMenu(playerid);
CallLocalFunction("OnPlayerModelSelection", "dddd", playerid, 0, listid, -1);
PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
return 1;
}
return 0;
}