Como saio de uma textdraw no esc - overlordfy - 22/02/2024
Olá, como posso fazer para um textdraw sair quando eu clico no esc, exemplo: abri uma textdraw de mecanico, quando eu clicar no esc ela tem que fechar.
RE: Como saio de uma textdraw no esc - White_Blue - 22/02/2024
Use a callback OnPlayerClickTextDraw.
Exemplo:
Código PHP: new PlayerText:SuaTextdraw[MAX_PLAYERS];
public OnPlayerClickTextDraw(playerid, Text:clickedid) { if(clickedid == Text:INVALID_TEXT_DRAW) { if(GetPVarInt(playerid, "OlhandoTextdraw")) { PlayerTextDrawHide(playerid, SuaTextdraw[playerid]); DeletePVar(playerid, "OlhandoTextdraw"); CancelSelectTextDraw(playerid); } } return 1; }
public OnPlayerConnect(playerid) { SuaTextdraw[playerid] = CreatePlayerTextDraw(10.000000, 141.000000, "Sua textdraw"); PlayerTextDrawTextSize(SuaTextdraw[playerid], 60.000000, 20.000000); PlayerTextDrawAlignment(SuaTextdraw[playerid], 0); PlayerTextDrawBackgroundColor(SuaTextdraw[playerid], 0x000000ff); PlayerTextDrawFont(SuaTextdraw[playerid], 1); PlayerTextDrawLetterSize(SuaTextdraw[playerid], 0.250000, 1.000000); PlayerTextDrawColor(SuaTextdraw[playerid], 0xffffffff); PlayerTextDrawSetProportional(SuaTextdraw[playerid], true); PlayerTextDrawSetSelectable(SuaTextdraw[playerid], true); return 1; }
CMD:textdraw(playerid) { PlayerTextDrawShow(playerid, SuaTextdraw[playerid]); SetPVarInt(playerid, "OlhandoTextdraw", 1); SelectTextDraw(playerid, 0xFFFFF); return 1; }
RE: Como saio de uma textdraw no esc - overlordfy - 22/02/2024
(22/02/2024 18:26)White_Blue Escreveu: Use a callback OnPlayerClickTextDraw.
Exemplo:
Código PHP: new PlayerText:SuaTextdraw[MAX_PLAYERS];
public OnPlayerClickTextDraw(playerid, Text:clickedid) { if(clickedid == Text:INVALID_TEXT_DRAW) { if(GetPVarInt(playerid, "OlhandoTextdraw")) { PlayerTextDrawHide(playerid, SuaTextdraw[playerid]); DeletePVar(playerid, "OlhandoTextdraw"); CancelSelectTextDraw(playerid); } } return 1; }
public OnPlayerConnect(playerid) { SuaTextdraw[playerid] = CreatePlayerTextDraw(10.000000, 141.000000, "Sua textdraw"); PlayerTextDrawTextSize(SuaTextdraw[playerid], 60.000000, 20.000000); PlayerTextDrawAlignment(SuaTextdraw[playerid], 0); PlayerTextDrawBackgroundColor(SuaTextdraw[playerid], 0x000000ff); PlayerTextDrawFont(SuaTextdraw[playerid], 1); PlayerTextDrawLetterSize(SuaTextdraw[playerid], 0.250000, 1.000000); PlayerTextDrawColor(SuaTextdraw[playerid], 0xffffffff); PlayerTextDrawSetProportional(SuaTextdraw[playerid], true); PlayerTextDrawSetSelectable(SuaTextdraw[playerid], true); return 1; }
CMD:textdraw(playerid) { PlayerTextDrawShow(playerid, SuaTextdraw[playerid]); SetPVarInt(playerid, "OlhandoTextdraw", 1); SelectTextDraw(playerid, 0xFFFFF); return 1; }
Mn qual e a key da tecla esc ?
RE: Como saio de uma textdraw no esc - White_Blue - 22/02/2024
(22/02/2024 19:19)overlordfy Escreveu: (22/02/2024 18:26)White_Blue Escreveu: Use a callback OnPlayerClickTextDraw.
Exemplo:
Código PHP: new PlayerText:SuaTextdraw[MAX_PLAYERS];
public OnPlayerClickTextDraw(playerid, Text:clickedid) { if(clickedid == Text:INVALID_TEXT_DRAW) { if(GetPVarInt(playerid, "OlhandoTextdraw")) { PlayerTextDrawHide(playerid, SuaTextdraw[playerid]); DeletePVar(playerid, "OlhandoTextdraw"); CancelSelectTextDraw(playerid); } } return 1; }
public OnPlayerConnect(playerid) { SuaTextdraw[playerid] = CreatePlayerTextDraw(10.000000, 141.000000, "Sua textdraw"); PlayerTextDrawTextSize(SuaTextdraw[playerid], 60.000000, 20.000000); PlayerTextDrawAlignment(SuaTextdraw[playerid], 0); PlayerTextDrawBackgroundColor(SuaTextdraw[playerid], 0x000000ff); PlayerTextDrawFont(SuaTextdraw[playerid], 1); PlayerTextDrawLetterSize(SuaTextdraw[playerid], 0.250000, 1.000000); PlayerTextDrawColor(SuaTextdraw[playerid], 0xffffffff); PlayerTextDrawSetProportional(SuaTextdraw[playerid], true); PlayerTextDrawSetSelectable(SuaTextdraw[playerid], true); return 1; }
CMD:textdraw(playerid) { PlayerTextDrawShow(playerid, SuaTextdraw[playerid]); SetPVarInt(playerid, "OlhandoTextdraw", 1); SelectTextDraw(playerid, 0xFFFFF); return 1; }
Mn qual e a key da tecla esc ?
Não existe.
As teclas disponíveis podem ser vistas na imagem abaixo:
Fonte: http://sampextremeoficial.blogspot.com/2016/08/key-keys-samp.html
RE: Como saio de uma textdraw no esc - overlordfy - 23/02/2024
(22/02/2024 20:44)White_Blue Escreveu: (22/02/2024 19:19)overlordfy Escreveu: (22/02/2024 18:26)White_Blue Escreveu: Use a callback OnPlayerClickTextDraw.
Exemplo:
Código PHP: new PlayerText:SuaTextdraw[MAX_PLAYERS];
public OnPlayerClickTextDraw(playerid, Text:clickedid) { if(clickedid == Text:INVALID_TEXT_DRAW) { if(GetPVarInt(playerid, "OlhandoTextdraw")) { PlayerTextDrawHide(playerid, SuaTextdraw[playerid]); DeletePVar(playerid, "OlhandoTextdraw"); CancelSelectTextDraw(playerid); } } return 1; }
public OnPlayerConnect(playerid) { SuaTextdraw[playerid] = CreatePlayerTextDraw(10.000000, 141.000000, "Sua textdraw"); PlayerTextDrawTextSize(SuaTextdraw[playerid], 60.000000, 20.000000); PlayerTextDrawAlignment(SuaTextdraw[playerid], 0); PlayerTextDrawBackgroundColor(SuaTextdraw[playerid], 0x000000ff); PlayerTextDrawFont(SuaTextdraw[playerid], 1); PlayerTextDrawLetterSize(SuaTextdraw[playerid], 0.250000, 1.000000); PlayerTextDrawColor(SuaTextdraw[playerid], 0xffffffff); PlayerTextDrawSetProportional(SuaTextdraw[playerid], true); PlayerTextDrawSetSelectable(SuaTextdraw[playerid], true); return 1; }
CMD:textdraw(playerid) { PlayerTextDrawShow(playerid, SuaTextdraw[playerid]); SetPVarInt(playerid, "OlhandoTextdraw", 1); SelectTextDraw(playerid, 0xFFFFF); return 1; }
Mn qual e a key da tecla esc ?
Não existe.
As teclas disponíveis podem ser vistas na imagem abaixo:
Fonte: http://sampextremeoficial.blogspot.com/2016/08/key-keys-samp.html
entendi amigo, outros servidores conseguem fechar uma textdraw clicando no esc e eu achei que isso era possivel de fazer.
RE: Como saio de uma textdraw no esc - White_Blue - 23/02/2024
(23/02/2024 11:23)overlordfy Escreveu: (22/02/2024 20:44)White_Blue Escreveu: (22/02/2024 19:19)overlordfy Escreveu: (22/02/2024 18:26)White_Blue Escreveu: Use a callback OnPlayerClickTextDraw.
Exemplo:
Código PHP: new PlayerText:SuaTextdraw[MAX_PLAYERS];
public OnPlayerClickTextDraw(playerid, Text:clickedid) { if(clickedid == Text:INVALID_TEXT_DRAW) { if(GetPVarInt(playerid, "OlhandoTextdraw")) { PlayerTextDrawHide(playerid, SuaTextdraw[playerid]); DeletePVar(playerid, "OlhandoTextdraw"); CancelSelectTextDraw(playerid); } } return 1; }
public OnPlayerConnect(playerid) { SuaTextdraw[playerid] = CreatePlayerTextDraw(10.000000, 141.000000, "Sua textdraw"); PlayerTextDrawTextSize(SuaTextdraw[playerid], 60.000000, 20.000000); PlayerTextDrawAlignment(SuaTextdraw[playerid], 0); PlayerTextDrawBackgroundColor(SuaTextdraw[playerid], 0x000000ff); PlayerTextDrawFont(SuaTextdraw[playerid], 1); PlayerTextDrawLetterSize(SuaTextdraw[playerid], 0.250000, 1.000000); PlayerTextDrawColor(SuaTextdraw[playerid], 0xffffffff); PlayerTextDrawSetProportional(SuaTextdraw[playerid], true); PlayerTextDrawSetSelectable(SuaTextdraw[playerid], true); return 1; }
CMD:textdraw(playerid) { PlayerTextDrawShow(playerid, SuaTextdraw[playerid]); SetPVarInt(playerid, "OlhandoTextdraw", 1); SelectTextDraw(playerid, 0xFFFFF); return 1; }
Mn qual e a key da tecla esc ?
Não existe.
As teclas disponíveis podem ser vistas na imagem abaixo:
Fonte: http://sampextremeoficial.blogspot.com/2016/08/key-keys-samp.html
entendi amigo, outros servidores conseguem fechar uma textdraw clicando no esc e eu achei que isso era possivel de fazer.
É possível de fazer, acabei de explicar acima como.
|