Can't Figure These Errors Out!!!
#11

HEre is that code:

HTML Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])  //the callback
{
    if (dialogid == 1) //checking dialogid
    {
        if (response == 1) //making sure "Login" was pressed
        {
            if (udb_CheckLogin(ReturnPlayerName(playerid),inputtext)) //checking if it is the players password
            {
		        PlayerInfo[playerid][Jailed] = (dUserINT(ReturnPlayerName(playerid)).("Jailed"));
		        PlayerInfo[playerid][Frozen] = (dUserINT(ReturnPlayerName(playerid)).("Frozen"));
				PLAYERLIST_authed[playerid]=true;
				TogglePlayerControllable(playerid, true);
				PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
				return SendClientMessage(playerid,COLOR_MAIN,"{00ff00}[Server:] {dfebff} Successfully Authorized!");//SystemMsg(playerid,"Successfully authed!");
            }
            else //incorrect password
            {
			    new string[256];
				format(string,sizeof(string),"[!!Warning!!] Failed Login Attempt by %s Detected. Player may be attempting to steal someone's account.",ReturnPlayerName(playerid));
				for(new ra=0; ra<MAX_PLAYERS; ra++){
					if(IsPlayerAdmin(ra) || IsPlayerLAdmin(ra))
					{
						SendClientMessage(ra,COLOR_RED,string);
					}
				}
				ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Invalid Password", "Invalid Password, try again", "Login", "Cancel");
			    return SendClientMessage(playerid,red,"{ff0000}[Warning:] {dfebff} Login Failed!");
            }
        }
        else //pressed "Cancel"
        {
            SendClientMessage(playerid,red,"{00ff00}[Server:] {dfebff} Please use /login [password] or reconnect and try again.");
        }
    }
    else if(dialogid == 2) //namechange dialog
    {
        //ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Name Change", "Incorrect Name, please retry.\nExample: John_Smith or Jane_Smith", "accept", "cancel");
        if (response == 1)
        {
			//new PName[MAX_PLAYER_NAME];
			//GetPlayerName(playerid,PName,sizeof(PName));
		    new namestring = strfind(inputtext, "_", true);
		 	if(namestring == -1)
			{//incorrect name
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Name Change", "Invalid Name, please retry.\nExample: John_Smith or Jane_Smith", "accept", "cancel");
			    return SendClientMessage(playerid,red,"{ff0000}[Error:] {dfebff} Name Change Failed!");
			}
			else
			{//correct name
				PLAYERLIST_authed[playerid]=true;
				TogglePlayerControllable(playerid, true);
				PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
				SetPlayerName(playerid, inputtext);
				OnPlayerConnect(playerid);
				return SendClientMessage(playerid,COLOR_MAIN,"{00ff00}[Server:] {dfebff} Successfully Authorized! Welcome!");//SystemMsg(playerid,"Successfully authed!");

			}
        }
        else //pressed "Cancel"
        {
            SendClientMessage(playerid,red,"{ff0000}[Warning:] {dfebff} Please relog to the server with an RP name. Example: John_Doe or Jane_Doe.");
			PlayerInfo[playerid][TimeX] = 0;
			Kick(playerid);

        }


    }
Reply


Messages In This Thread
Can't Figure These Errors Out!!! - by Sil3nc3 - 25.06.2011, 03:51
Re: Can't Figure These Errors Out!!! - by Laronic - 25.06.2011, 03:53
Re: Can't Figure These Errors Out!!! - by Sil3nc3 - 25.06.2011, 03:54
Re: Can't Figure These Errors Out!!! - by Donya - 25.06.2011, 03:56
Re: Can't Figure These Errors Out!!! - by Sil3nc3 - 25.06.2011, 03:57
Re: Can't Figure These Errors Out!!! - by Laronic - 25.06.2011, 04:02
Re: Can't Figure These Errors Out!!! - by Sil3nc3 - 25.06.2011, 04:04
Re: Can't Figure These Errors Out!!! - by Laronic - 25.06.2011, 04:09
Re: Can't Figure These Errors Out!!! - by Ricop522 - 25.06.2011, 04:11
Re: Can't Figure These Errors Out!!! - by Sil3nc3 - 25.06.2011, 04:14
Re: Can't Figure These Errors Out!!! - by Sil3nc3 - 25.06.2011, 04:20
Re: Can't Figure These Errors Out!!! - by m5industries - 25.06.2011, 04:31
Re: Can't Figure These Errors Out!!! - by Babul - 25.06.2011, 08:19
Re: Can't Figure These Errors Out!!! - by Sil3nc3 - 25.06.2011, 14:40
Re: Can't Figure These Errors Out!!! - by [HiC]TheKiller - 25.06.2011, 14:58
Re: Can't Figure These Errors Out!!! - by Sil3nc3 - 26.06.2011, 01:22
Re: Can't Figure These Errors Out!!! - by [HiC]TheKiller - 26.06.2011, 03:47
Re: Can't Figure These Errors Out!!! - by [DM]Kane - 26.06.2011, 06:58
Re: Can't Figure These Errors Out!!! - by whitedragon - 14.07.2011, 23:13

Forum Jump:


Users browsing this thread: 2 Guest(s)