09.10.2013, 22:22
Hola amigos de sa-mp, les vengo a pedir que me ayuden en algo, bien les explicare lo que pasa estoy haciendo un textdraw clickeable en forma de cajero, donde abran opciones de Retirar,Depositar,Transferir, bueno ahora ya tengo hecho el textdraw y todo, pero cuando uso el comando en el cual me mostrarб los textdraw seria /cajero, coloco el comando dicho anteriormente me lo muestra , intento dar click en retirar y no pasa nada, ahora le paso el codigo para ver que es lo que esta mal, espero que me ayuden. Gracias!!
En los new puse los textdraw
Ahora le explicare lo de retirar este es el textdraw hecho
Ahora en el callback puse asi.
el dialogo que mostrara
Ahora el comando en el cual me mostrar los textdraw.
Ahi esta todo puesto amigos, por cierto el define del dialogo de retirar si lo tengo definido, espero que me ayuden gracias de nuevo
En los new puse los textdraw
pawn Код:
new Text:Pantalla[MAX_PLAYERS];
new Text:CuadroNegroBanco[MAX_PLAYERS];
new Text:Operaciones[MAX_PLAYERS];
new Text:Depositar[MAX_PLAYERS];
new Text:Retirar[MAX_PLAYERS];
new Text:Transferir[MAX_PLAYERS];
new Text:DineroTotal[MAX_PLAYERS];
new Text:Usuario[MAX_PLAYERS];
pawn Код:
Retirar[playerid] = TextDrawCreate(268.000000, 211.000000, "Retirar");
TextDrawBackgroundColor(Retirar[playerid], 255);
TextDrawFont(Retirar[playerid], 2);
TextDrawLetterSize(Retirar[playerid], 0.599999, 4.299999);
TextDrawColor(Retirar[playerid], -1);
TextDrawSetOutline(Retirar[playerid], 1);
TextDrawSetProportional(Retirar[playerid], 1);
TextDrawUseBox(Retirar[playerid], 1);
TextDrawBoxColor(Retirar[playerid], 1471292159);
TextDrawTextSize(Retirar[playerid], 374.000000, 0.000000);
TextDrawSetSelectable(Retirar[playerid], true);
pawn Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(_:clickedid != 65535)//Si el jugador hace click en un textdraw vбlido continua con este mismo.
{
if(clickedid == Retirar[playerid])
{
ShowPlayerDialog(playerid,DIALOGO_RETIRAR, DIALOG_STYLE_INPUT, "{FFFFFF}Banco de Palomino Creek", "{FFFFFF}·Introduzca la cantidad de dinero que desea retirar:", "Retirar", "Cancelar");
CancelSelectTextDraw(playerid);
}
}
return 1;
}
pawn Код:
case DIALOGO_RETIRAR:{
if(response){
if(strval(inputtext) > Informacion[playerid][pBancario]) return ShowPlayerDialog(playerid, CajeroError, DIALOG_STYLE_MSGBOX, "{FFFFFF}Banco Palomino", "{FFFFFF}Se ha producido un error. Ha podido ser causado por:\n\n Que usted no tiene tanto dinero en el banco", "Cerrar", "");
Informacion[playerid][pBancario] -= strval(inputtext);
Informacion[playerid][Dinero] += strval(inputtext);
}
else
{
}
}
pawn Код:
CMD:cajero(playerid, params[]){
//if(EstaEnUnCajero(playerid)){
new string[256];
if(MostrandoCajero[playerid] == 0){
TextDrawShowForPlayer(playerid, Pantalla[playerid]);
TextDrawShowForPlayer(playerid, CuadroNegroBanco[playerid]);
TextDrawShowForPlayer(playerid, Operaciones[playerid]);
TextDrawShowForPlayer(playerid, Depositar[playerid]);
TextDrawShowForPlayer(playerid, Retirar[playerid]);
TextDrawShowForPlayer(playerid, Transferir[playerid]);
format(string, sizeof(string), "Total: ~g~$~w~ %d",Informacion[playerid][pBancario]);
TextDrawSetString(DineroTotal[playerid], Desbug(string));
TextDrawShowForPlayer(playerid, DineroTotal[playerid]);
format(string, sizeof(string), "Usuario: %s",NombreJugador(playerid));
TextDrawSetString(Usuario[playerid], Desbug(string));
TextDrawShowForPlayer(playerid, Usuario[playerid]);
MostrandoCajero[playerid] = 1;
SelectTextDraw(playerid, 0xFF0000FF);
SendClientMessage(playerid, COLOR_SERVER, "[INFO] Para salir del cajero, usa nuevamente '/cajero'.");
return 1;
}
else{
TextDrawHideForPlayer(playerid, Pantalla[playerid]);
TextDrawHideForPlayer(playerid, CuadroNegroBanco[playerid]);
TextDrawHideForPlayer(playerid, Operaciones[playerid]);
TextDrawHideForPlayer(playerid, Depositar[playerid]);
TextDrawHideForPlayer(playerid, Retirar[playerid]);
TextDrawHideForPlayer(playerid, Transferir[playerid]);
TextDrawHideForPlayer(playerid, DineroTotal[playerid]);
TextDrawHideForPlayer(playerid, Usuario[playerid]);
MostrandoCajero[playerid] = 0;
CancelSelectTextDraw(playerid);
return 1;
}
//}else SendClientMessage(playerid, COLOR_BLANCO, "[ERROR] Usted no se encuentra en un cajero automбtico.");
//return 1;
}