14.02.2019, 16:29
pawn Код:
if(dialogid == DIALOG_CITYPICK)
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_CITYPICK, DIALOG_STYLE_LIST, "Euphoria", "Los Santos\nRed County\nLas Venturas\nSan Fierro", "Pick", "");
{
switch(listitem)
{
case 0: SetPlayerPos(playerid, 2540.8083,-2115.9592,13.5469);
case 1: SetPlayerPos(playerid, -50.3335,-270.9958,6.6332);
case 2: SetPlayerPos(playerid, 1428.3453,1049.4246,10.8130);
case 3: SetPlayerPos(playerid, -2160.1516,-224.3147,36.0662);
}
}
}
return 1;
}
}
return 1;
}
here is my entire OnDialogResponse callback.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Euphoria","You have entered an invalid password.\nType your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteString(File,"Name",inputtext);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Skin",0);
INI_WriteInt(File,"Score",0);
INI_Close(File);
FirstTimeLoggedIn = 1;
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SendClientMessage(playerid, -1, "NOTICE: You have successfully logged in.");
SendClientMessage(playerid, -1, "SERVER: If you require help please use /help.");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Euphoria","You have entered an incorrect password.\nPlease try again.","Login","Quit");
}
}
if(dialogid == DIALOG_CITYPICK)
{
if(!response) return ShowPlayerDialog(playerid, DIALOG_CITYPICK, DIALOG_STYLE_LIST, "Euphoria", "Los Santos\nRed County\nLas Venturas\nSan Fierro", "Pick", "");
{
switch(listitem)
{
case 0: SetPlayerPos(playerid, 2540.8083,-2115.9592,13.5469);
case 1: SetPlayerPos(playerid, -50.3335,-270.9958,6.6332);
case 2: SetPlayerPos(playerid, 1428.3453,1049.4246,10.8130);
case 3: SetPlayerPos(playerid, -2160.1516,-224.3147,36.0662);
}
}
}
return 1;
}
}
return 1;
}