AnyHelp? -
Thanks - 31.10.2017
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(playerid, text[])
{
if(InMenu[playerid] == 1)
{
if(strval(text) == 1)
{
TextDrawHideForPlayer(playerid, Textdraw66);
TextDrawHideForPlayer(playerid, Textdraw67);
TextDrawHideForPlayer(playerid, Textdraw68);
TextDrawHideForPlayer(playerid, Textdraw69);
TextDrawHideForPlayer(playerid, Textdraw70);
TextDrawHideForPlayer(playerid, Textdraw71);
TextDrawHideForPlayer(playerid, Textdraw72);
TextDrawHideForPlayer(playerid, Textdraw73);
TextDrawHideForPlayer(playerid, Textdraw74);
TextDrawHideForPlayer(playerid, Textdraw75);
TextDrawHideForPlayer(playerid, Textdraw76);
TextDrawHideForPlayer(playerid, Textdraw77);
TextDrawHideForPlayer(playerid, Textdraw78);
TextDrawHideForPlayer(playerid, Textdraw79);
TextDrawHideForPlayer(playerid, Textdraw80);
TextDrawHideForPlayer(playerid, Textdraw81);
TextDrawHideForPlayer(playerid, Textdraw82);
TextDrawHideForPlayer(playerid, Textdraw83);
TextDrawHideForPlayer(playerid, Textdraw84);
TextDrawHideForPlayer(playerid, Textdraw85);
TextDrawHideForPlayer(playerid, Textdraw86);
TextDrawHideForPlayer(playerid, Textdraw87);
TextDrawHideForPlayer(playerid, Textdraw88);
TextDrawHideForPlayer(playerid, Textdraw89);
TextDrawHideForPlayer(playerid, Textdraw90);
TextDrawHideForPlayer(playerid, Textdraw91);
TextDrawHideForPlayer(playerid, Textdraw92);
TextDrawHideForPlayer(playerid, Textdraw93);
TextDrawHideForPlayer(playerid, Textdraw94);
TextDrawHideForPlayer(playerid, Textdraw95);
TextDrawHideForPlayer(playerid, Textdraw96);
TextDrawHideForPlayer(playerid, Textdraw97);
TextDrawHideForPlayer(playerid, Textdraw98);
TextDrawHideForPlayer(playerid, Textdraw99);
TextDrawHideForPlayer(playerid, Textdraw100);
TextDrawHideForPlayer(playerid, Textdraw101);
TextDrawHideForPlayer(playerid, Textdraw102);
TextDrawHideForPlayer(playerid, Textdraw103);
TextDrawHideForPlayer(playerid, Textdraw104);
TextDrawHideForPlayer(playerid, Textdraw105);
TextDrawShowForPlayer(playerid, Textdraw106);
TextDrawShowForPlayer(playerid, Textdraw107);
TextDrawShowForPlayer(playerid, Textdraw108);
TextDrawShowForPlayer(playerid, Textdraw109);
TextDrawShowForPlayer(playerid, Textdraw110);
TextDrawShowForPlayer(playerid, Textdraw111);
TextDrawShowForPlayer(playerid, Textdraw112);
TextDrawShowForPlayer(playerid, Textdraw113);
TextDrawShowForPlayer(playerid, Textdraw114);
TextDrawShowForPlayer(playerid, Textdraw115);
TextDrawShowForPlayer(playerid, Textdraw116);
TextDrawShowForPlayer(playerid, Textdraw117);
TextDrawShowForPlayer(playerid, Textdraw118);
TextDrawShowForPlayer(playerid, Textdraw119);
TextDrawShowForPlayer(playerid, Textdraw120);
TextDrawShowForPlayer(playerid, Textdraw121);
TextDrawShowForPlayer(playerid, Textdraw122);
TextDrawShowForPlayer(playerid, Textdraw123);
TextDrawShowForPlayer(playerid, Textdraw124);
TextDrawShowForPlayer(playerid, Textdraw125);
TextDrawShowForPlayer(playerid, Textdraw126);
TextDrawShowForPlayer(playerid, Textdraw127);
TextDrawShowForPlayer(playerid, Textdraw128);
TextDrawShowForPlayer(playerid, Textdraw129);
TextDrawShowForPlayer(playerid, Textdraw130);
TextDrawShowForPlayer(playerid, Textdraw131);
TextDrawShowForPlayer(playerid, Textdraw132);
TextDrawShowForPlayer(playerid, Textdraw133);
TextDrawShowForPlayer(playerid, Textdraw134);
TextDrawShowForPlayer(playerid, Textdraw135);
TextDrawShowForPlayer(playerid, Textdraw136);
TextDrawShowForPlayer(playerid, Textdraw137);
TextDrawShowForPlayer(playerid, Textdraw138);
TextDrawShowForPlayer(playerid, Textdraw139);
InMenu[playerid] =0;
return 0;
}
I've tried in OnPlayerKeyStateChange Do that but its not worked.
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_FIRE))
{
if (InMenu[playerid] == 1)
{
TextDrawHideForPlayer(playerid, Textdraw98);
}
}
return 1;
}
Re: AnyHelp? -
zMason - 31.10.2017
Try and replace
Код:
if (PRESSED(KEY_FIRE))
// with
if(newkeys & KEY_FIRE)
Re: AnyHelp? -
Swankeh - 31.10.2017
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(playerid, Text: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(playerid, Textdraw66);
TextDrawHideForPlayer(playerid, Textdraw67);
TextDrawHideForPlayer(playerid, Textdraw68);
TextDrawHideForPlayer(playerid, Textdraw69);
TextDrawHideForPlayer(playerid, Textdraw70);
TextDrawHideForPlayer(playerid, Textdraw71);
TextDrawHideForPlayer(playerid, Textdraw72);
TextDrawHideForPlayer(playerid, Textdraw73);
TextDrawHideForPlayer(playerid, Textdraw74);
TextDrawHideForPlayer(playerid, Textdraw75);
TextDrawHideForPlayer(playerid, Textdraw76);
TextDrawHideForPlayer(playerid, Textdraw77);
TextDrawHideForPlayer(playerid, Textdraw78);
TextDrawHideForPlayer(playerid, Textdraw79);
TextDrawHideForPlayer(playerid, Textdraw80);
TextDrawHideForPlayer(playerid, Textdraw81);
TextDrawHideForPlayer(playerid, Textdraw82);
TextDrawHideForPlayer(playerid, Textdraw83);
TextDrawHideForPlayer(playerid, Textdraw84);
TextDrawHideForPlayer(playerid, Textdraw85);
TextDrawHideForPlayer(playerid, Textdraw86);
TextDrawHideForPlayer(playerid, Textdraw87);
TextDrawHideForPlayer(playerid, Textdraw88);
TextDrawHideForPlayer(playerid, Textdraw89);
TextDrawHideForPlayer(playerid, Textdraw90);
TextDrawHideForPlayer(playerid, Textdraw91);
TextDrawHideForPlayer(playerid, Textdraw92);
TextDrawHideForPlayer(playerid, Textdraw93);
TextDrawHideForPlayer(playerid, Textdraw94);
TextDrawHideForPlayer(playerid, Textdraw95);
TextDrawHideForPlayer(playerid, Textdraw96);
TextDrawHideForPlayer(playerid, Textdraw97);
TextDrawHideForPlayer(playerid, Textdraw98);
TextDrawHideForPlayer(playerid, Textdraw99);
TextDrawHideForPlayer(playerid, Textdraw100);
TextDrawHideForPlayer(playerid, Textdraw101);
TextDrawHideForPlayer(playerid, Textdraw102);
TextDrawHideForPlayer(playerid, Textdraw103);
TextDrawHideForPlayer(playerid, Textdraw104);
TextDrawHideForPlayer(playerid, Textdraw105);
TextDrawShowForPlayer(playerid, Textdraw106);
TextDrawShowForPlayer(playerid, Textdraw107);
TextDrawShowForPlayer(playerid, Textdraw108);
TextDrawShowForPlayer(playerid, Textdraw109);
TextDrawShowForPlayer(playerid, Textdraw110);
TextDrawShowForPlayer(playerid, Textdraw111);
TextDrawShowForPlayer(playerid, Textdraw112);
TextDrawShowForPlayer(playerid, Textdraw113);
TextDrawShowForPlayer(playerid, Textdraw114);
TextDrawShowForPlayer(playerid, Textdraw115);
TextDrawShowForPlayer(playerid, Textdraw116);
TextDrawShowForPlayer(playerid, Textdraw117);
TextDrawShowForPlayer(playerid, Textdraw118);
TextDrawShowForPlayer(playerid, Textdraw119);
TextDrawShowForPlayer(playerid, Textdraw120);
TextDrawShowForPlayer(playerid, Textdraw121);
TextDrawShowForPlayer(playerid, Textdraw122);
TextDrawShowForPlayer(playerid, Textdraw123);
TextDrawShowForPlayer(playerid, Textdraw124);
TextDrawShowForPlayer(playerid, Textdraw125);
TextDrawShowForPlayer(playerid, Textdraw126);
TextDrawShowForPlayer(playerid, Textdraw127);
TextDrawShowForPlayer(playerid, Textdraw128);
TextDrawShowForPlayer(playerid, Textdraw129);
TextDrawShowForPlayer(playerid, Textdraw130);
TextDrawShowForPlayer(playerid, Textdraw131);
TextDrawShowForPlayer(playerid, Textdraw132);
TextDrawShowForPlayer(playerid, Textdraw133);
TextDrawShowForPlayer(playerid, Textdraw134);
TextDrawShowForPlayer(playerid, Textdraw135);
TextDrawShowForPlayer(playerid, Textdraw136);
TextDrawShowForPlayer(playerid, Textdraw137);
TextDrawShowForPlayer(playerid, Textdraw138);
TextDrawShowForPlayer(playerid, Textdraw139);
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
Re: AnyHelp? -
Thanks - 31.10.2017
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?
Re: AnyHelp? -
Lucases - 31.10.2017
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
Re: AnyHelp? -
Thanks - 02.11.2017
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?