Help Press [ESC] to close TextDraw
#1

hello everyone - if i want when i press ESC this textdraw will close
sorry for my bad english
https://uphinhnhanh.com/image/3yKV3d
Reply
#2

help meee!!
Reply
#3

PHP код:
if(clickedid == Text:65535) {
TextDrawHideForPlayer(playeridYourTextDrawName);

Reply
#4

on OnPlayerClickPlayerTextDraw
help me
Reply
#5

Under OnPlayerClickTextDraw
Reply
#6

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
PHP код:
if(clickedid == Text:65535) {
TextDrawHideForPlayer(playeridYourTextDrawName);

on OnPlayerClickPlayerTextDraw sir help me
Reply
#7

Oh lol you meant that.

PHP код:
public OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid){
if(
playertextid == PlayerText:65535){
// Hide the textdraws
}

Reply
#8

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
Oh lol you meant that.

PHP код:
public OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid){
if(
playertextid == PlayerText:65535){
// Hide the textdraws
}

lol, it eror
./includes/3M26RP.pwn(110971) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110972) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110973) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110974) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#9

Quote:
Originally Posted by khoinewghost
Посмотреть сообщение
lol, it eror
./includes/3M26RP.pwn(110971) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110972) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110973) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110974) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
How about you post some code? We don't know how you defined your textdraw.
Reply
#10

Quote:
Originally Posted by khoinewghost
Посмотреть сообщение
lol, it eror
./includes/3M26RP.pwn(110971) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110972) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110973) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110974) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Post your code then? We cannot see in your PC from here
Reply
#11

public OnPlayerClickPlayerTextDraw(playerid, PlayerTextlayertextid)
{

if(playertextid == PlayerText:65535)
{
TextDrawHideForPlayer(playerid, DLTextDraws[12]);
TextDrawHideForPlayer(playerid, DLTextDraws[13]);
TextDrawHideForPlayer(playerid, DLTextDraws[14]);
TextDrawHideForPlayer(playerid, DLTextDraws[2]);
}
// Phan thuong hang ngay
if(_layertextid != INVALID_TEXT_DRAW)
{
if(playertextid == DLTextDraws[12][playerid])
{
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
if(PlayerInfo[playerid][DLRewardBox][0] == 1) return SendClientMessage(playerid,-1,"{FF0000}[!] {FFFFFF}Ban da nhan qua trong ngay hom nay roi !");
PlayerInfo[playerid][DLRewardBox][0] = 1;
DLCheck(playerid);
DLRandomRewards(playerid, 1);
CancelSelectTextDraw(playerid);
}
else if(playertextid == DLTextDraws[13][playerid])
{
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
if(PlayerInfo[playerid][DLRewardBox][1] == 1) return SendClientMessage(playerid,-1,"{FF0000}[!] {FFFFFF}Ban da nhan qua trong ngay hom nay roi !");
if(PlayerInfo[playerid][pDonateRank] <= 0) return SendClientMessage(playerid,-1,"{FF0000}[!] {FFFFFF}Ban can co VIP Bronze tro len de co the nhan goi qua nay !");
PlayerInfo[playerid][DLRewardBox][1] = 1;
DLCheck(playerid);
DLRandomRewards(playerid, 2);
CancelSelectTextDraw(playerid);
}
else if(playertextid == DLTextDraws[14][playerid])
{
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
if(PlayerInfo[playerid][DLRewardBox][2] == 1) return SendClientMessage(playerid,-1,"{FF0000}[!] {FFFFFF}Ban da nhan qua trong ngay hom nay roi !");
if(PlayerInfo[playerid][pDonateRank] <= 1) return SendClientMessage(playerid,-1,"{FF0000}[!] {FFFFFF}Ban can co VIP Silver tro len de co the nhan goi qua nay !");
PlayerInfo[playerid][DLRewardBox][2] = 1;
DLCheck(playerid);
DLRandomRewards(playerid, 2);
CancelSelectTextDraw(playerid);
}
else if(playertextid == DLTextDraws[2][playerid])
{
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
new d, m, y;
GetDate_V(d, m, y);
PlayerInfo[playerid][DLDate] = d;
DLTextDraw(playerid, 2);
CancelSelectTextDraw(playerid);
}
}
Reply
#12

TextDrawHideForPlayer needs to be changed to PlayerTextDrawHide

Those are player texts
Reply
#13

Quote:
Originally Posted by willbedie
Посмотреть сообщение
How about you post some code? We don't know how you defined your textdraw.
Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
TextDrawHideForPlayer needs to be changed to PlayerTextDrawHide

Those are player texts
it isn't working @@
./includes/3M26RP.pwn(110971) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110972) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110973) : error 035: argument type mismatch (argument 2)
./includes/3M26RP.pwn(110974) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#14

DLTextDraws[12][playerid] you forgot the [playerid]
Reply
#15

OnPlayerClickPlayerTextDraw doesnt detect ESC do it using OnPlayerClickTextDraw

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid
{
    if(
clickedid == Text:INVALID_TEXT_DRAW)
    {
        
//hide you'r textdraws
        
return 1;
    }
    return 
0

Reply
#16

Really never used the OnPlayerClickPlayerTextDraw public, but I guess
PHP код:
if(clickedid == Text:INVALID_TEXT_DRAW
will not hide player texts.
Only guessing eh
Reply
#17

Quote:
Originally Posted by Lokii
Посмотреть сообщение
OnPlayerClickPlayerTextDraw doesnt detect ESC do it using OnPlayerClickTextDraw

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid
{
    if(
clickedid == Text:INVALID_TEXT_DRAW)
    {
        
//hide you'r textdraws
        
return 1;
    }
    return 
0

it isn't working
Reply
#18

Did you try

PHP код:
public OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid){
if(
playertextid == PlayerText:65535){
TextDrawHideForPlayer(playeridDLTextDraws[12][playerid]);
TextDrawHideForPlayer(playeridDLTextDraws[13][playerid]);
TextDrawHideForPlayer(playeridDLTextDraws[14][playerid]);
TextDrawHideForPlayer(playeridDLTextDraws[2][playerid]);
}

yet?
Reply
#19

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
Did you try

PHP код:
public OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid){
if(
playertextid == PlayerText:65535){
TextDrawHideForPlayer(playeridDLTextDraws[12][playerid]);
TextDrawHideForPlayer(playeridDLTextDraws[13][playerid]);
TextDrawHideForPlayer(playeridDLTextDraws[14][playerid]);
TextDrawHideForPlayer(playeridDLTextDraws[2][playerid]);
}

yet?
yes - but it isn't working
Reply
#20

You should be using

OnPlayerClickTextDraw

instead of

OnPlayerClickPlayerTextDraw

to detect ESC/Cancel events. You should both if you also wanna detect the clicks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)