AnyHelp?
#1

Hello i've created a menu and its worked but the problem when i've press 1 its worked too but WHEN Press LMB The Textdraws is not destroyed Why?? Sorry I Dont know how to create a KEY_FIRE For Destroy it can you help me?!

PHP код:
public OnPlayerText(playeridtext[])
{
    if(
InMenu[playerid] == 1)
    {
       if(
strval(text) == 1)
       {
          
TextDrawHideForPlayer(playeridTextdraw66);
          
TextDrawHideForPlayer(playeridTextdraw67);
          
TextDrawHideForPlayer(playeridTextdraw68);
          
TextDrawHideForPlayer(playeridTextdraw69);
          
TextDrawHideForPlayer(playeridTextdraw70);
          
TextDrawHideForPlayer(playeridTextdraw71);
          
TextDrawHideForPlayer(playeridTextdraw72);
          
TextDrawHideForPlayer(playeridTextdraw73);
          
TextDrawHideForPlayer(playeridTextdraw74);
          
TextDrawHideForPlayer(playeridTextdraw75);
          
TextDrawHideForPlayer(playeridTextdraw76);
          
TextDrawHideForPlayer(playeridTextdraw77);
          
TextDrawHideForPlayer(playeridTextdraw78);
          
TextDrawHideForPlayer(playeridTextdraw79);
          
TextDrawHideForPlayer(playeridTextdraw80);
          
TextDrawHideForPlayer(playeridTextdraw81);
          
TextDrawHideForPlayer(playeridTextdraw82);
          
TextDrawHideForPlayer(playeridTextdraw83);
          
TextDrawHideForPlayer(playeridTextdraw84);
          
TextDrawHideForPlayer(playeridTextdraw85);
          
TextDrawHideForPlayer(playeridTextdraw86);
          
TextDrawHideForPlayer(playeridTextdraw87);
          
TextDrawHideForPlayer(playeridTextdraw88);
          
TextDrawHideForPlayer(playeridTextdraw89);
          
TextDrawHideForPlayer(playeridTextdraw90);
          
TextDrawHideForPlayer(playeridTextdraw91);
          
TextDrawHideForPlayer(playeridTextdraw92);
          
TextDrawHideForPlayer(playeridTextdraw93);
          
TextDrawHideForPlayer(playeridTextdraw94);
          
TextDrawHideForPlayer(playeridTextdraw95);
          
TextDrawHideForPlayer(playeridTextdraw96);
          
TextDrawHideForPlayer(playeridTextdraw97);
          
TextDrawHideForPlayer(playeridTextdraw98);
          
TextDrawHideForPlayer(playeridTextdraw99);
          
TextDrawHideForPlayer(playeridTextdraw100);
          
TextDrawHideForPlayer(playeridTextdraw101);
          
TextDrawHideForPlayer(playeridTextdraw102);
          
TextDrawHideForPlayer(playeridTextdraw103);
          
TextDrawHideForPlayer(playeridTextdraw104);
          
TextDrawHideForPlayer(playeridTextdraw105);
          
TextDrawShowForPlayer(playeridTextdraw106);
          
TextDrawShowForPlayer(playeridTextdraw107);
          
TextDrawShowForPlayer(playeridTextdraw108);
          
TextDrawShowForPlayer(playeridTextdraw109);
          
TextDrawShowForPlayer(playeridTextdraw110);
          
TextDrawShowForPlayer(playeridTextdraw111);
          
TextDrawShowForPlayer(playeridTextdraw112);
          
TextDrawShowForPlayer(playeridTextdraw113);
          
TextDrawShowForPlayer(playeridTextdraw114);
          
TextDrawShowForPlayer(playeridTextdraw115);
          
TextDrawShowForPlayer(playeridTextdraw116);
          
TextDrawShowForPlayer(playeridTextdraw117);
          
TextDrawShowForPlayer(playeridTextdraw118);
          
TextDrawShowForPlayer(playeridTextdraw119);
          
TextDrawShowForPlayer(playeridTextdraw120);
          
TextDrawShowForPlayer(playeridTextdraw121);
          
TextDrawShowForPlayer(playeridTextdraw122);
          
TextDrawShowForPlayer(playeridTextdraw123);
          
TextDrawShowForPlayer(playeridTextdraw124);
          
TextDrawShowForPlayer(playeridTextdraw125);
          
TextDrawShowForPlayer(playeridTextdraw126);
          
TextDrawShowForPlayer(playeridTextdraw127);
          
TextDrawShowForPlayer(playeridTextdraw128);
          
TextDrawShowForPlayer(playeridTextdraw129);
          
TextDrawShowForPlayer(playeridTextdraw130);
          
TextDrawShowForPlayer(playeridTextdraw131);
          
TextDrawShowForPlayer(playeridTextdraw132);
          
TextDrawShowForPlayer(playeridTextdraw133);
          
TextDrawShowForPlayer(playeridTextdraw134);
          
TextDrawShowForPlayer(playeridTextdraw135);
          
TextDrawShowForPlayer(playeridTextdraw136);
          
TextDrawShowForPlayer(playeridTextdraw137);
          
TextDrawShowForPlayer(playeridTextdraw138);
          
TextDrawShowForPlayer(playeridTextdraw139);
          
InMenu[playerid] =0;
          return 
0;
       } 
I've tried in OnPlayerKeyStateChange Do that but its not worked.

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_FIRE))
    {
        if (
InMenu[playerid] == 1)
        {
           
TextDrawHideForPlayer(playeridTextdraw98);
        }
    }
    return 
1;

Reply
#2

Try and replace

Код:
if (PRESSED(KEY_FIRE))

// with

if(newkeys & KEY_FIRE)
Reply
#3

I'm not sure if you want to hide it with a key, or when you click on the part of the textdraw is hidden but if so I think you're wrong the correct public is public OnPlayerClickTextDraw (playerid, Text: clickedid)

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)

    if(
InMenu[playerid] == 1//This would check if the variable is in x
    

       if(
clickedid ==  Textdraw66//In this part I would go the textdraw that I click for example "Textdraw66" You change it by the textdraw that is clickable.
       

          
TextDrawHideForPlayer(playeridTextdraw66); 
          
TextDrawHideForPlayer(playeridTextdraw67); 
          
TextDrawHideForPlayer(playeridTextdraw68); 
          
TextDrawHideForPlayer(playeridTextdraw69); 
          
TextDrawHideForPlayer(playeridTextdraw70); 
          
TextDrawHideForPlayer(playeridTextdraw71); 
          
TextDrawHideForPlayer(playeridTextdraw72); 
          
TextDrawHideForPlayer(playeridTextdraw73); 
          
TextDrawHideForPlayer(playeridTextdraw74); 
          
TextDrawHideForPlayer(playeridTextdraw75); 
          
TextDrawHideForPlayer(playeridTextdraw76); 
          
TextDrawHideForPlayer(playeridTextdraw77); 
          
TextDrawHideForPlayer(playeridTextdraw78); 
          
TextDrawHideForPlayer(playeridTextdraw79); 
          
TextDrawHideForPlayer(playeridTextdraw80); 
          
TextDrawHideForPlayer(playeridTextdraw81); 
          
TextDrawHideForPlayer(playeridTextdraw82); 
          
TextDrawHideForPlayer(playeridTextdraw83); 
          
TextDrawHideForPlayer(playeridTextdraw84); 
          
TextDrawHideForPlayer(playeridTextdraw85); 
          
TextDrawHideForPlayer(playeridTextdraw86); 
          
TextDrawHideForPlayer(playeridTextdraw87); 
          
TextDrawHideForPlayer(playeridTextdraw88); 
          
TextDrawHideForPlayer(playeridTextdraw89); 
          
TextDrawHideForPlayer(playeridTextdraw90); 
          
TextDrawHideForPlayer(playeridTextdraw91); 
          
TextDrawHideForPlayer(playeridTextdraw92); 
          
TextDrawHideForPlayer(playeridTextdraw93); 
          
TextDrawHideForPlayer(playeridTextdraw94); 
          
TextDrawHideForPlayer(playeridTextdraw95); 
          
TextDrawHideForPlayer(playeridTextdraw96); 
          
TextDrawHideForPlayer(playeridTextdraw97); 
          
TextDrawHideForPlayer(playeridTextdraw98); 
          
TextDrawHideForPlayer(playeridTextdraw99); 
          
TextDrawHideForPlayer(playeridTextdraw100); 
          
TextDrawHideForPlayer(playeridTextdraw101); 
          
TextDrawHideForPlayer(playeridTextdraw102); 
          
TextDrawHideForPlayer(playeridTextdraw103); 
          
TextDrawHideForPlayer(playeridTextdraw104); 
          
TextDrawHideForPlayer(playeridTextdraw105); 
          
TextDrawShowForPlayer(playeridTextdraw106); 
          
TextDrawShowForPlayer(playeridTextdraw107); 
          
TextDrawShowForPlayer(playeridTextdraw108); 
          
TextDrawShowForPlayer(playeridTextdraw109); 
          
TextDrawShowForPlayer(playeridTextdraw110); 
          
TextDrawShowForPlayer(playeridTextdraw111); 
          
TextDrawShowForPlayer(playeridTextdraw112); 
          
TextDrawShowForPlayer(playeridTextdraw113); 
          
TextDrawShowForPlayer(playeridTextdraw114); 
          
TextDrawShowForPlayer(playeridTextdraw115); 
          
TextDrawShowForPlayer(playeridTextdraw116); 
          
TextDrawShowForPlayer(playeridTextdraw117); 
          
TextDrawShowForPlayer(playeridTextdraw118); 
          
TextDrawShowForPlayer(playeridTextdraw119); 
          
TextDrawShowForPlayer(playeridTextdraw120); 
          
TextDrawShowForPlayer(playeridTextdraw121); 
          
TextDrawShowForPlayer(playeridTextdraw122); 
          
TextDrawShowForPlayer(playeridTextdraw123); 
          
TextDrawShowForPlayer(playeridTextdraw124); 
          
TextDrawShowForPlayer(playeridTextdraw125); 
          
TextDrawShowForPlayer(playeridTextdraw126); 
          
TextDrawShowForPlayer(playeridTextdraw127); 
          
TextDrawShowForPlayer(playeridTextdraw128); 
          
TextDrawShowForPlayer(playeridTextdraw129); 
          
TextDrawShowForPlayer(playeridTextdraw130); 
          
TextDrawShowForPlayer(playeridTextdraw131); 
          
TextDrawShowForPlayer(playeridTextdraw132); 
          
TextDrawShowForPlayer(playeridTextdraw133); 
          
TextDrawShowForPlayer(playeridTextdraw134); 
          
TextDrawShowForPlayer(playeridTextdraw135); 
          
TextDrawShowForPlayer(playeridTextdraw136); 
          
TextDrawShowForPlayer(playeridTextdraw137); 
          
TextDrawShowForPlayer(playeridTextdraw138); 
          
TextDrawShowForPlayer(playeridTextdraw139); 
          
InMenu[playerid] =0
          return 
0
       } 
Remember that to enable the Click in textdraw you have to use SelectTextDraw (playerid, 0xFF4040AA);
And to cancel it is CancelSelectTextDraw (playerid);

https://sampwiki.blast.hk/wiki/OnPlayerClickTextDraw
Reply
#4

No guys.. I mean...

I've creating a menu for /cmds Like number 1 > 14 And i've creating if someone typing 1 The textdraws removed and Putting the New Textdraws So its worked like that but The problem still is When i've pressed LMB To Remove Menus its not removing i've not making it if pressing LMB OR KEY_FIRE Remove menu How to i can do it please?
Reply
#5

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE))
    {
        if (InMenu[playerid] == 1)
        {
           TextDrawHideForPlayer(playerid, Textdraw98);
        }
    }
    return 1;
}
Try this one
Reply
#6

Dude its work but what about the number when someone type 1>14 ? I Want if someone type 1 in /cmds and press LMB The menu removed how?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)