29.06.2017, 12:46
Como posso alterar meu sistema de login para um textdraw, tipo, eu tenho o meu sistema que й de dialog e queria passar pra textdraw й possivel? sem alterar minhas variaveis?
new PlayerText:Registro[MAX_PLAYERS];
new PlayerText:LOG_IN[MAX_PLAYERS];
Registro[playerid] = CreatePlayerTextDraw(playerid, X, Y, "REGISTRAR");
LOG_IN[playerid] = CreatePlayerTextDraw(playerid, X, Y, "LOGAR");
PlayerTextDrawSetSelectable(playerid, Registro[playerid], true);
PlayerTextDrawSetSelectable(playerid, LOG_IN[playerid], true); // elas estгo clicaveis
PlayerTextDrawShow(playerid, Registro[playerid]);
//e a cor da textdraw quando a seta passa por cima
SelectTextDraw(playerid, COR_AQUI);
PlayerTextDrawShow(playerid, LOG_IN[playerid]);
SelectTextDraw(playerid, COR_AQUI);
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == Registro[playerid]) //= se o jogador clica na textdraw registro
{
ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_PASSWORD, "REGISTRO", "Digite uma senha:","Registrar","Cancelar");
CancelSelectTextDraw(playerid);
}
if(playertextid == LOG_IN[playerid])
{
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Digite sua senha:","Logar","Cancelar");
CancelSelectTextDraw(playerid); //cancelar ela de ser clicavel
}
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
InterpolateCameraPos(playerid, 1959.262207, 1344.088012, 15.374607, 2035.767089, 1343.863037, 13.413891, 4000);
InterpolateCameraLookAt(playerid, 2035.863403, 1343.389526, 13.957723, 1961.410034, 1344.228637, 15.985651, 3000);
new opening = random(3);
switch(opening)
{
case 0:
{
InterpolateCameraPos(playerid, 163.270141, 2000.135009, 45.123085, 1638.889648, 869.134704, 33.709228, 3000);
InterpolateCameraLookAt(playerid, 167.237121, 1997.091674, 45.091835, 1643.077880, 866.403625, 33.705322, 3000);
}
case 1:
{
InterpolateCameraPos(playerid, 1649.179443, 846.970031, 33.193771, 2040.842529, 1343.225708, 14.425601, 3000);
InterpolateCameraLookAt(playerid, 1654.173095, 847.004516, 32.943874, 2035.847167, 1343.315185, 14.230338, 3000);
}
case 2:
{
InterpolateCameraPos(playerid, 2040.838623, 1343.220825, 14.425786, 1956.434082, 1344.491821, 16.399242, 2000);
InterpolateCameraLookAt(playerid, 2035.863403, 1343.389526, 13.957723, 1961.410034, 1344.228637, 15.985651, 2000);
}
}
//REGISTRO
new String[128], Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof(Nome));
format(String, sizeof(String), CONTAS, Nome);
if(!fexist(String))
{
TextDrawShowForPlayer(playerid, formato);
TextDrawShowForPlayer(playerid, registro);
//TextDrawShowForPlayer(playerid, usebox1);
TextDrawShowForPlayer(playerid, warning1);
TextDrawShowForPlayer(playerid, warning2);
TextDrawShowForPlayer(playerid, warning3);
TextDrawShowForPlayer(playerid, warning4);
TextDrawShowForPlayer(playerid, entrada);
TextDrawShowForPlayer(playerid, warning5);
TextDrawShowForPlayer(playerid, warning6);
TextDrawShowForPlayer(playerid, warning7);
TextDrawShowForPlayer(playerid, nick);
PlayerTextDrawShow(playerid, SenhaRegistro[playerid]);
PlayerTextDrawShow(playerid, GuestLogRegistro[playerid]);
SelectTextDraw(playerid, LARANJA);
//TogglePlayerSpectating(playerid, 1);
//format(String, sizeof(String), "{FFFFFF}Olб {FFA000}%s{FFFFFF} vocк ainda nгo tem uma conta.\nRegistre-se e jogue em nosso servidor\n\nDigite uma senha para registrar:", Nome);
//ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_PASSWORD, "Registro", String, "{FFA000}Registrar", "Cancelar");
}
//LOG-IN
else
{
TextDrawShowForPlayer(playerid, formato);
TextDrawShowForPlayer(playerid, login);
TextDrawShowForPlayer(playerid, bemvindo);
//TextDrawShowForPlayer(playerid, warning1l);
//TextDrawShowForPlayer(playerid, warning2l);
TextDrawShowForPlayer(playerid, entrada);
TextDrawShowForPlayer(playerid, nick);
PlayerTextDrawShow(playerid, logar[playerid]);
SelectTextDraw(playerid, LARANJA);
//TogglePlayerSpectating(playerid, 1);
//format(String, sizeof(String), "{FFFFFF}Olб {FFA000}%s{FFFFFF}%s vocк jб tem uma conta, \nDigite sua senha para continuar:", Nome);
//ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Login", String, "{FFA000}Logar", "Cancelar");
}
return 1;
}