I need help with dialog..
#5

Here's the whole ondilogresponse:

Quote:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new sendername[MAX_PLAYER_NAME];
new string[128];
if(response)
{
if(dialogid == 12346 || dialogid == 12347)
{
if(strlen(inputtext))
{
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
//Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
else
{
new loginstring[128];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname) );
format(loginstring,sizeof(loginstring),"POGRESNA LOZINKA\nUkucajte tacnu lozinku:",loginname);
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT ,"Prijava vaseg naloga",loginstring,"Prijava","Izlaz");
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 5) { Ban(playerid); }
}
}
if(dialogid == 12345)
{
if(strlen(inputtext))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s.ini", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_YELLOW, "To ime vec koristi neka druga osoba,mozimo vas da izaberete neko drugo.");
fclose(hFile);
return 1;
}
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
//Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
else
{
new regstring[128];
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"Doborodosli, %s\nVi nemate vas nalog.\nRegistrujte se:",regname);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT ,"Registracija vaseg naloga",regstring,"Registruj","Izlaz");
}
}
}
else
{
Kick(playerid);
}
if(dialogid == GPS)
{
if(response)
{
if(listitem == 0) // Burg1
{
SetPlayerCheckpoint(playerid, 1199.1937,-918.5539,43.1205, 3.0);
}
if(listitem == 1) // Burg2
{
SetPlayerCheckpoint(playerid, 793.7313,-1625.1881,13.3828, 3.0);
}
if(listitem == 2) // Banka
{
SetPlayerCheckpoint(playerid, 1462.3324,-1012.3792,26.8438, 3.0);
}
if(listitem == 3) // Auto Skola
{
SetPlayerCheckpoint(playerid, 2045.6823,-1907.9747,13.5469, 3.0);
}
if(listitem == 4) // Ammu-Nation
{
SetPlayerCheckpoint(playerid, 1367.1969,-1279.8051,13.5469, 3.0);
}
if(listitem == 5) // Opstina
{
SetPlayerCheckpoint(playerid, 1481.1489,-1769.3906,18.7958, 3.0);
}
if(listitem == 6) // Hitna Pomoc
{
SetPlayerCheckpoint(playerid, 1178.3746,-1323.2477,14.1169, 3.0);
}
if(listitem == 7) // Policijska Stanica
{
SetPlayerCheckpoint(playerid, 1545.4523,-1675.6234,13.5604, 3.0);
}
}
return 1;
}
return 1;
}

Reply


Messages In This Thread
I need help with dialog.. - by MonkZemun - 27.12.2010, 16:55
Re: I need help with dialog.. - by admantis - 27.12.2010, 16:56
Re: I need help with dialog.. - by MonkZemun - 27.12.2010, 17:01
Re: I need help with dialog.. - by Anthonyx3' - 27.12.2010, 17:02
Re: I need help with dialog.. - by MonkZemun - 27.12.2010, 17:06
Re: I need help with dialog.. - by Anthonyx3' - 27.12.2010, 17:08
Re: I need help with dialog.. - by MonkZemun - 27.12.2010, 17:11
Re: I need help with dialog.. - by Anthonyx3' - 27.12.2010, 17:18
Re: I need help with dialog.. - by MonkZemun - 27.12.2010, 17:25
Re: I need help with dialog.. - by MonkZemun - 27.12.2010, 17:26

Forum Jump:


Users browsing this thread: 1 Guest(s)