24.02.2011, 03:58
Hola gente!
Bueno, estoy haciendo un sistema de configs. para mi Chatbot, pero tengo el problema de que el OnDialogResponse no funciona.
No se si me explico...
Les dejo el codigo para que lo entiendan mejor
Chaoz, aver si me podes ayudar, vos seguro encontras el problema ajaj.
Yo intente varias cosas y nada me sirvio :S
Bueno, estoy haciendo un sistema de configs. para mi Chatbot, pero tengo el problema de que el OnDialogResponse no funciona.
No se si me explico...
Les dejo el codigo para que lo entiendan mejor
pawn Код:
CMD:cbot(playerid, params[])
{
if(!IsPlayerLuxAdminLevel(playerid, 5) || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, LIGHTBLUE, "Necesitas ser administrador para usar este Comando!");
ShowPlayerDialog(playerid, BotD, DIALOG_STYLE_LIST, "Chatbot Configs", "Habilitar/Deshabilitar\nBloquear Player\nDesbloquear Player\nEnviar mensaje", "Aceptar", "");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == BotD)
{
if(response)
{
if(listitem == 0)
{
SwitchBot();
}
else if(listitem == 1)
{
ShowPlayerDialog(playerid, BotD1, DIALOG_STYLE_INPUT, "Bloquear un Jugador", "", "Aceptar", "Cancelar");
}
else if(listitem == 2)
{
ShowPlayerDialog(playerid, botD2, DIALOG_STYLE_INPUT, "Desbloquear un Jugador", "", "Aceptar", "Cancelar");
}
else if(listitem == 3)
{
ShowPlayerDialog(playerid, BotD3, DIALOG_STYLE_INPUT, "Enviar un texto", "", "Aceptar", "Cancelar");
}
}
}
else if(dialogid == BotD1)
{
if(response)
{
new string[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if(sscanf(inputtext, "d", bbid)) return ShowPlayerDialog(playerid, BotD1, DIALOG_STYLE_INPUT, "Desbloquear un Jugador", "", "Aceptar", "Cancelar");
else
{
if(BBot[bbid] == 0)
{
format(string, sizeof(string), "El jugador %s (%s) no esta bloqueado!", pname, bbid);
SendClientMessage(playerid, LIGHTBLUE, string);
}
else if(BBot[bbid] == 1)
{
BBot[bbid] = 1;
format(string, sizeof(string), "El jugador %s (%s) fue bloqueado!", pname, bbid);
SendClientMessage(playerid, LIGHTBLUE, string);
}
}
}
}
else if(dialogid == BotD2)
{
if(response)
{
new string[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
if(sscanf(inputtext, "d", bbid)) return ShowPlayerDialog(playerid, BotD2, DIALOG_STYLE_INPUT, "Desbloquear un Jugador", "", "Aceptar", "Cancelar");
else
{
format(string, sizeof(string), "El jugador %s (%s) fue desbloqueado!", pname, bbid);
SendClientMessage(playerid, LIGHTBLUE, string);
BBot[bbid] = 0;
}
}
}
else if(dialogid == BotD3)
{
if(response)
{
new string[128];
if(isnull(inputtext)) return ShowPlayerDialog(playerid, BotD3, DIALOG_STYLE_INPUT, "Enviar un texto", "", "Aceptar", "Cancelar");
else if(!isnull(inputtext))
{
format (string, sizeof(string), inputtext);
SendBotMessage(inputtext);
}
}
}
return 1;
}
Yo intente varias cosas y nada me sirvio :S


si hay algun error tene en cuenta q lo hice en un bloc de notas xq no tengo mi pc (N) esta es la de mi viejo y no tengo pawno ni otro similar y 0 ganas de descargarlo
