I Got A New Problem
#1

Hello,

I Have A LOF Gamemode And I Create Database And i Fill To The Gamemode pwn. But When I Start The Server It is Showing "The Server Didn't Respond" here is the picture,



This is The Server LOG File,

Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3x, ©2005-2013 SA-MP Team

[12:42:18] filterscripts = ""  (string)
[12:42:18] 
[12:42:18] Server Plugins
[12:42:18] --------------
[12:42:18]  Loading plugin: streamer
[12:42:18] 

*** Streamer Plugin v2.6.1 by Incognito loaded ***

[12:42:18]   Loaded.
[12:42:18]  Loading plugin: sscanf
[12:42:18] 

[12:42:18]  ===============================

[12:42:18]       sscanf plugin loaded.     

[12:42:18]    © 2009 Alex "******" Cole

[12:42:18]    0.3d-R2 500 Players "dnee"

[12:42:18]  ===============================

[12:42:18]   Loaded.
[12:42:18]  Loading plugin: mysql
[12:42:18] 

  > MySQL plugin R5 successfully loaded.

[12:42:18]   Loaded.
[12:42:18]  Loaded 3 plugins.

[12:42:18] 
[12:42:18] Filterscripts
[12:42:18] ---------------
[12:42:18]   Loaded 0 filterscripts.

[12:42:18] [MYSQL]: Connection to `lof_database` succesful!
[12:42:18] ** 33	<->	Airline Vehicles loaded from	<->	MySQL		   **
[12:42:19] ** 109	<->	Vehicles loaded from	<->	MySQL		   **
[12:42:19] 
----------------------------------
[12:42:19]  Life of Pilot = Come And Fly With Us. 
[12:42:19] ----------------------------------

[12:42:19] Number of vehicle models: 118
This is my Server cfg.file

Код:
echo Executing Server Config...
lanmode 0
hostname Life of Pilot = Come And Fly With Us.
weburl lifeisyourpilot.freetzi.com
mapname San Andreas
language English
rcon_password ayyash
maxplayers 100
port 7777
maxnpc 0
rcon 0
announce 1
query 1
gamemode0 LoF
filterscripts 
plugins streamer sscanf mysql
onfoot_rate 40
incar_rate 40
weapon_rate 40
stream_distance 300.0
stream_rate 1000
I Don't Know Why i can't Connect To Server Please Someone Help me Please
Reply
#2

Update your samp version, currently its 0.3x.
Reply
#3

Quote:
Originally Posted by PGaming
Посмотреть сообщение
Update your samp version, currently its 0.3x.
How To Update For 0.3.7 version Please tell me or Showing Me A ******* Video Please
Reply
#4

just download this:
http://files.sa-mp.com/samp037_svr_R2-1-1_win32.zip

then copy samp-server.exe samp-announce.exe samp-npc.exe and paste them in the gamemode file, and start it and it should work.
Reply
#5

Hello!

Download the 0.3.7 Windows Server on this page:
http://www.sa-mp.com/download.php

After that you put your gamemode, filterscripts, includes and other important things in this new folder.
You should compile your script again and try to start it.
Reply
#6

Everything's outdated. Plugins, server files and etc etc.
Reply
#7

Quote:
Originally Posted by RyderX
Посмотреть сообщение
just download this:
http://files..com/samp037_svr_R2-1-1_win32.zip

then copy samp-.exe samp-announce.exe samp-npc.exe and paste them in the gamemode file, and start it and it should work.
Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

Download the 0.3.7 Windows on this page:
http://www..com/download.php

After that you put your gamemode, filterscripts, includes and other important things in this new folder.
You should compile your script again and try to start it.
You Too Very Thanks REP+ But I got A problem When i Register It is Showing Type The Password Again When i Type for 2times it is showing please login invalid password here is the picture,







My Gamemode Login And Register Scripts here,

Код:
public PlayerLogin(playerid,password[])
{
	mysql_reconnect();
	new EscPass[128], EscName[128], Query[128];
	mysql_real_escape_string(PlayerName(playerid), EscName);
	mysql_real_escape_string(password, EscPass);
	format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s' AND `password` = '%s'", EscName, EscPass);
	mysql_query(Query);
	mysql_store_result();
	if(mysql_num_rows() > 0)
	{ // player logged in.
		new line[1250];
		if(mysql_fetch_row(line)) //Fetches the line
  		{
  		    new string2[128];
    		new data[11][128]; //The data strings
      		new data2[56]; //The data variables
      		//new Float:data3[5]; //The data floats
      		sscanf(line, "p<|>s[128]s[128]ds[128]s[128]ddddddddddddddsds[128]ds[128]dddddddddddddddddddds[128]s[128]ds[128]ddddddddds[128]ddddddddd", data[0], data[1], data2[0], data[2], data[3], data2[1], data2[2], data2[3], data2[4], data2[5], data2[6], data2[7], data2[8], data2[9], data2[10], data2[11], data2[12], data2[13], data2[14], data[4], data2[15], data[5], data2[16], data[6], data2[17], data2[18], data2[19],
			  data2[20], data2[21], data2[22], data2[23], data2[24], data2[25], data2[26], data2[27], data2[28], data2[29], data2[30], data2[31], data2[32], data2[33], data2[34], data2[35], data2[36], data[7], data[8], data2[37], data[9], data2[38], data2[39], data2[40], data2[41],data2[42],data2[43],data2[44],data2[45],data2[46],data[10],data2[47], data2[48],data2[49],data2[50],data2[51],data2[52],data2[53],data2[54],data2[55]); //Splits the line with sscanf
			format(string2, sizeof(string2), "%s", data[1]); //PASSWORD
			strmid(PInfo[playerid][Password], string2, 0, strlen(string2), 128); //PASSWORD
			PInfo[playerid][AdminLevel] = data2[0];
			format(string2, sizeof(string2), "%s", data[3]); //last login date+time
			strmid(PInfo[playerid][LastLogin], string2, 0, strlen(string2), 128); //last login date+time
			PInfo[playerid][Banned] = data2[1];
			PInfo[playerid][Money] = data2[2];
			PInfo[playerid][AT400F] = data2[3];
			PInfo[playerid][STUNTF] = data2[4];
			PInfo[playerid][HELIF] = data2[5];
			PInfo[playerid][CARGOF] = data2[6];
			PInfo[playerid][MILITARYF] = data2[7];
			PInfo[playerid][SHAMALF] = data2[8];
			PInfo[playerid][DODOF] = data2[9];
			PInfo[playerid][SKIMMERF] = data2[10];
			PInfo[playerid][Muted] = data2[11];
			PInfo[playerid][HoursPlayed] = data2[12];
			PInfo[playerid][MinsPlayed] = data2[13];
			PInfo[playerid][Warning1] = data2[14];
			format(string2, sizeof(string2), "%s", data[4]);
			strmid(PInfo[playerid][Reason1], string2, 0, strlen(string2), 128);
			PInfo[playerid][Warning2] = data2[15];
			format(string2, sizeof(string2), "%s", data[5]);
			strmid(PInfo[playerid][Reason2], string2, 0, strlen(string2), 128);
			PInfo[playerid][Warning3] = data2[16];
			format(string2, sizeof(string2), "%s", data[6]);
			strmid(PInfo[playerid][Reason3], string2, 0, strlen(string2), 128);
			PInfo[playerid][TotalJobs] = data2[17];
			PInfo[playerid][TotalScore] = data2[18];
			PInfo[playerid][ANDROF] = data2[19];
			PInfo[playerid][BEAGLEF] = data2[20];
			PInfo[playerid][CROPDUSTERF] = data2[21];
			PInfo[playerid][HYDRAF] = data2[22];
			PInfo[playerid][NEVADAF] = data2[23];
			PInfo[playerid][RUSTLERF] = data2[24];
			PInfo[playerid][CARGOBOBF] = data2[25];
			PInfo[playerid][HUNTERF] = data2[26];
			PInfo[playerid][LEVIATHANF] = data2[27];
			PInfo[playerid][MAVERICKF] = data2[28];
			PInfo[playerid][NMAVERICKF] = data2[29];
			PInfo[playerid][PMAVERICKF] = data2[30];
			PInfo[playerid][RAINDANCEF] = data2[31];
			PInfo[playerid][SEASPARROWF] = data2[32];
			PInfo[playerid][SPARROWF] = data2[33];
			PInfo[playerid][Online] = data2[34];
			PInfo[playerid][EarntFromWorking] = data2[35];
			PInfo[playerid][FlightsCompleted] = data2[36];
			format(string2, sizeof(string2), "%s", data[7]);
			strmid(PInfo[playerid][RegisterDate], string2, 0, strlen(string2), 128);
			format(string2, sizeof(string2), "%s", data[8]);
			strmid(PInfo[playerid][Callsign], string2, 0, strlen(string2), 64);
			PInfo[playerid][CallsignSet] = data2[37];
			format(string2, sizeof(string2), "%s", data[9]);
			strmid(PInfo[playerid][Email], string2, 0, strlen(string2), 256);
			PInfo[playerid][MemberID] = data2[38];
			PInfo[playerid][Airline] = data2[39];
			PInfo[playerid][AirlineRank] = data2[40];
			PInfo[playerid][EarntForAirline] = data2[41];
			PInfo[playerid][House1] = data2[42];
			PInfo[playerid][House2] = data2[43];
			PInfo[playerid][FlownDistance] = data2[44];
			PInfo[playerid][AirlineFlights] = data2[45];
			PInfo[playerid][Vip] = data2[46];
			format(string2, sizeof(string2), "%s", data[10]); //last login date+time
			strmid(PInfo[playerid][VIPColour], string2, 0, strlen(string2), 128); //last login date+time
			PInfo[playerid][Tickets] = data2[47];
			PInfo[playerid][sSpawn] = data2[48];
			PInfo[playerid][sSkin] = data2[49];
			PInfo[playerid][sPM] = data2[50];
			PInfo[playerid][sVIPSounds] = data2[51];
			PInfo[playerid][OwnedSkin] = data2[52];
			PInfo[playerid][sGlobalSounds] = data2[53];
			PInfo[playerid][sConnectionMessages] = data2[54];
			PInfo[playerid][sAutoWork] = data2[55];
            mysql_free_result();
        }
        new string[250];
	    //LoadPlayer(playerid);
	    mysql_free_result();
	    SessionStatus[playerid] = 2; //Logged in successfully. Show disconnect messages
		//if(PInfo[playerid][Banned] == 1) { CheckBanned(playerid); }
		PlayerLogged[playerid] = 1;
		SendClientMessage(playerid, COLOR_GREEN, "You have successfully been logged in.");
		SendClientMessage(playerid, COLOR_GREEN, "Please Register In Our lifeisyourpilot.freetzi.com forums because we always changing the server ip address");
		new plrIP[16];
		GetPlayerIp(playerid, plrIP, sizeof(plrIP));
		GivePlayerMoney(playerid, PInfo[playerid][Money]);
		strmid(PInfo[playerid][IP], plrIP, 0, strlen(plrIP), 255);
		if(JustRegistered[playerid] == 0)
		{
			new login[156];
			format(login, sizeof(login), "{1B8AE4}%s (%d) {FFFFFF}has logged into the server.", PlayerName(playerid), playerid);
			for(new i = 0; i <MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
		    		if(PInfo[i][sConnectionMessages] == 0)
		    		{
						SendClientMessage(i, COLOR_YELLOW, login);
					}
				}
			}
		}
		if(PInfo[playerid][AdminLevel] > 0) { format(string, sizeof(string), "You have authorized as a level %d administrator.", PInfo[playerid][AdminLevel]); SendClientMessage(playerid, COLOR_SECURITY, string); }
		if(JustRegistered[playerid] == 0) { format(string, sizeof(string), "{FFFFFF}Welcome back to the Life of Pilot, {1B8AE4}%s {FFFFFF}- {1B8AE4}[Last session: %s | %s]", PlayerName(playerid), PInfo[playerid][IP], PInfo[playerid][LastLogin]); SendClientMessage(playerid, COLOR_MESSAGE, string); }
		UpdateScore(playerid);
		PInfo[playerid][Online] = 1;
		YourOnline(playerid);
		CanAdvertiseAgain[playerid] = 1;
		if(PInfo[playerid][Airline] > 0)
		{
		    format(string,sizeof(string),"AMOTD: %s | Set by: %s", AInfo[PInfo[playerid][Airline]][aMotd], AInfo[PInfo[playerid][Airline]][aMotdSetBy]);
		    SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		new motdstring[256];
		format(motdstring,sizeof(motdstring),"MOTD: %s | Set by: %s", ServerMOTD, ServerMOTDSetBy);
		SendClientMessage(playerid, COLOR_YELLOW, motdstring);
		if(PInfo[playerid][CallsignSet] == 0)
		{
			new msg[64];
			format(msg,sizeof(msg),"LoF");
			strmid(PInfo[playerid][Callsign], msg, 0, strlen(msg), 64);
			PInfo[playerid][CallsignSet] = 1;
		}

	}
	else
	{ // player incorrect password.
		SendClientMessage(playerid, COLOR_SECURITY, "Invalid password. Please try again, or request a password reset on the forums.");
		DisplayDialogForPlayer(playerid, 1);
  		mysql_free_result();
	}
}
public OnGameModeExit()
{
	PlayersOnline = 0;
	OnlineTimer();
	KillTimer(onlinetimer);
    KillTimer(randomtimer);
    mysql_close();
    ExitMapSystem();
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	TogglePlayerControllable(playerid, false);
	SetPlayerPos(playerid,1933.6263,-2399.9102,1201.7321);
	SetPlayerCameraPos(playerid, 1931.7674, -2417.5302, 1205.6908);
	SetPlayerCameraLookAt(playerid, 1931.7674, -2417.5202, 1200.6908);
    if(PlayerLogged[playerid] == 0)
	{
		mysql_reconnect();
		new	Query[90], EscName[MAX_PLAYER_NAME];
		mysql_real_escape_string(PlayerName(playerid), EscName);
		format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", EscName);
		mysql_query(Query);
		mysql_store_result();
		if(mysql_num_rows() != 0)
		{
		    mysql_free_result();
			SendClientMessage(playerid, COLOR_SECURITY, "Please enter your password below to continue.");
	 		DisplayDialogForPlayer(playerid, 1);
	        return 0;
		}
		else
		{
		    mysql_free_result();
			SendClientMessage(playerid, COLOR_SECURITY, "Please enter a password below to register an account.");
	 		DisplayDialogForPlayer(playerid, 2);
	        return 0;
		}
	}
	return 1;
}

public OnPlayerConnect(playerid)
{
	PlayersOnline++;
	SessionStatus[playerid] = 1; //Connected. Do not show messages.
	if(GlobalStatus == 2)
	{
	    SendClientMessage(playerid, COLOR_SECURITY, "A MySQL error has occured. Please visit the /forums for further details.");
	    Kick(playerid);
	}
	if(PlayersOnline > ServerMaxPlayers && sTrackPlayers == 1)
	{
	    new msg[256];
	    format(msg,sizeof(msg),"Life of Pilot has reached a new top player count! (Previously %d online players at %s - %s)",ServerMaxPlayers,ServerMaxPlayersDate,ServerMaxPlayersTime);
	    SendClientMessageToAll(COLOR_VIP, msg);
	    ServerMaxPlayers = PlayersOnline;
		new date,month,year;
		getdate(date,month,year);
		new hour,minute,second;
		gettime(hour,minute,second);
		new string[128];
		format(string,sizeof(string),"%d/%d/%d",year,month,date);
		strmid(ServerMaxPlayersDate, string, 0, strlen(string), 128);
		format(string,sizeof(string),"%d:%d:%d",hour,minute,second);
		strmid(ServerMaxPlayersTime, string, 0, strlen(string), 128);
		SaveStuff();
	}
	CheckIPS(playerid);
	PurelySpawned[playerid] = 0;
	ResetMissionData(playerid);
	ResetPlayerData(playerid);
	CheckBanned(playerid);
	RemoveObjectsForPlayer(playerid);
	ResetPlayerData(playerid);
	UpdatePlayerColour(playerid);
	TextDrawShowForPlayer(playerid, Clockzz);
	MapSystemAddPlayer(playerid);
	PlayerPlaySound(playerid, 1187, 0, 0, 0); // Start the music
	if(PlayerLogged[playerid] == 0)
	{
		mysql_reconnect();
		new	Query[90], EscName[MAX_PLAYER_NAME];
		mysql_real_escape_string(PlayerName(playerid), EscName);
		format(Query, sizeof(Query), "SELECT NULL FROM `users` WHERE `username` = '%s'", EscName);
		mysql_query(Query);
		mysql_store_result();
		if(mysql_num_rows() != 0)
		{
		    mysql_free_result();
			SendClientMessage(playerid, COLOR_SECURITY, "Please enter your password below to continue.");
	 		DisplayDialogForPlayer(playerid, 1);
	        return 0;
		}
		else
		{
		    PlayerPlaySound(playerid, 44204, 0, 0, 0);
		    mysql_free_result();
			SendClientMessage(playerid, COLOR_SECURITY, "Please enter a password below to register an account.");
	 		DisplayDialogForPlayer(playerid, 2);
	        return 0;
		}
 	}
	return 1;
}
Код:
 if(dialogid == 1) //LOGIN
    {
		if(PlayerLogged[playerid] == 1)
		{
			SendClientMessage(playerid, COLOR_YELLOW, "You are already logged in !");
			return 1;
		}
		if(response)
		{
		    if(!strlen(inputtext))
		    {
		        DisplayDialogForPlayer(playerid, 1); //login
				SendClientMessage(playerid, COLOR_YELLOW, "You must enter a password !");
				return 1;
			}
			if(strlen(inputtext) >= 50)
			{
			    DisplayDialogForPlayer(playerid, 1); //login
				SendClientMessage(playerid, COLOR_YELLOW, "That password is too long !");
				return 0;
			}
	        new tmppass[64];
	        //Store Player ID & TMP pass in echo to find string used to crash 
	        strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
	        PlayerLogin(playerid,tmppass);
		}
        else
        {
            SessionStatus[playerid] = 3;
            SendClientMessage(playerid, COLOR_SECURITY, "You have decided to quit. You have been kicked."); //login
            Kick(playerid);
        }
    }
    if(dialogid == 2) //REGISTER
    {
        if(PlayerLogged[playerid] == 1)
		{
			SendClientMessage(playerid, COLOR_ERROR, "You are already logged in !");
			return 1;
		}
		if(response)
		{
		    if(strlen(inputtext) >= 50)
			{
			    DisplayDialogForPlayer(playerid, 2); //register
				SendClientMessage(playerid, COLOR_ERROR, "Password is too long !");
				return 0;
			}
		    new sendername[MAX_PLAYER_NAME];
			GetPlayerName(playerid, sendername, sizeof(sendername));
			{
			    if(!strlen(inputtext))
		    	{
			        DisplayDialogForPlayer(playerid, 2); //register
					SendClientMessage(playerid, COLOR_ERROR, "Please enter a password for your account !");
					return 1;
				}
   				mysql_reconnect();
				new Query[90], EscName[MAX_PLAYER_NAME];
				mysql_real_escape_string(PlayerName(playerid), EscName);
				format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", EscName);
				mysql_query(Query);
				mysql_store_result();
				if(mysql_num_rows() != 0)
				{
	    			mysql_free_result();
					SendClientMessage(playerid, COLOR_ERROR, "Name already registered. Please choose a different name !");
					return 1;
				}
				else
				{
					RegisterAccount(playerid,inputtext);
					JustRegistered[playerid] = 1;
					new tPlayers = 0;
					mysql_query("SELECT NULL from `users`");
					mysql_store_result();
					tPlayers = mysql_num_rows();
					mysql_free_result();
					new login[156];
					format(login, sizeof(login), "{1B8AE4}%s (%d) {FFFFFF}has created an account. (%d total accounts)", PlayerName(playerid), playerid, tPlayers);
					for(new i = 0; i <MAX_PLAYERS; i++)
					{
						if(IsPlayerConnected(i))
						{
						    if(PInfo[i][sConnectionMessages] == 0)
						    {
								SendClientMessage(i, COLOR_YELLOW, login);
							}
						}
					}
					SendClientMessage(playerid, COLOR_MESSAGE, "Your account has been successfully registered.");
                    SendClientMessage(playerid, COLOR_MESSAGE, "Please register In Our lifeisyourpilot.freetzi.com Forum because We Always Changing The  IP Address.");
					PlayerLogin(playerid,inputtext);
				    SetPlayerVirtualWorld(playerid, 0);
                	mysql_free_result();
				}
			}
		}
		else
		{
		    DisplayDialogForPlayer(playerid, 2); //register
		}
    }
Reply
#8

I Am waiting Like A 2 Hours No One Response For My Message please Help
Reply
#9

Quote:
Originally Posted by Ayyash
Посмотреть сообщение
You Too Very Thanks REP+ But I got A problem When i Register It is Showing Type The Password Again When i Type for 2times it is showing please login invalid password here is the picture,







My Gamemode Login And Register Scripts here,

Код:
public PlayerLogin(playerid,password[])
{
	mysql_reconnect();
	new EscPass[128], EscName[128], Query[128];
	mysql_real_escape_string(PlayerName(playerid), EscName);
	mysql_real_escape_string(password, EscPass);
	format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s' AND `password` = '%s'", EscName, EscPass);
	mysql_query(Query);
	mysql_store_result();
	if(mysql_num_rows() > 0)
	{ // player logged in.
		new line[1250];
		if(mysql_fetch_row(line)) //Fetches the line
  		{
  		    new string2[128];
    		new data[11][128]; //The data strings
      		new data2[56]; //The data variables
      		//new Float:data3[5]; //The data floats
      		sscanf(line, "p<|>s[128]s[128]ds[128]s[128]ddddddddddddddsds[128]ds[128]dddddddddddddddddddds[128]s[128]ds[128]ddddddddds[128]ddddddddd", data[0], data[1], data2[0], data[2], data[3], data2[1], data2[2], data2[3], data2[4], data2[5], data2[6], data2[7], data2[8], data2[9], data2[10], data2[11], data2[12], data2[13], data2[14], data[4], data2[15], data[5], data2[16], data[6], data2[17], data2[18], data2[19],
			  data2[20], data2[21], data2[22], data2[23], data2[24], data2[25], data2[26], data2[27], data2[28], data2[29], data2[30], data2[31], data2[32], data2[33], data2[34], data2[35], data2[36], data[7], data[8], data2[37], data[9], data2[38], data2[39], data2[40], data2[41],data2[42],data2[43],data2[44],data2[45],data2[46],data[10],data2[47], data2[48],data2[49],data2[50],data2[51],data2[52],data2[53],data2[54],data2[55]); //Splits the line with sscanf
			format(string2, sizeof(string2), "%s", data[1]); //PASSWORD
			strmid(PInfo[playerid][Password], string2, 0, strlen(string2), 128); //PASSWORD
			PInfo[playerid][AdminLevel] = data2[0];
			format(string2, sizeof(string2), "%s", data[3]); //last login date+time
			strmid(PInfo[playerid][LastLogin], string2, 0, strlen(string2), 128); //last login date+time
			PInfo[playerid][Banned] = data2[1];
			PInfo[playerid][Money] = data2[2];
			PInfo[playerid][AT400F] = data2[3];
			PInfo[playerid][STUNTF] = data2[4];
			PInfo[playerid][HELIF] = data2[5];
			PInfo[playerid][CARGOF] = data2[6];
			PInfo[playerid][MILITARYF] = data2[7];
			PInfo[playerid][SHAMALF] = data2[8];
			PInfo[playerid][DODOF] = data2[9];
			PInfo[playerid][SKIMMERF] = data2[10];
			PInfo[playerid][Muted] = data2[11];
			PInfo[playerid][HoursPlayed] = data2[12];
			PInfo[playerid][MinsPlayed] = data2[13];
			PInfo[playerid][Warning1] = data2[14];
			format(string2, sizeof(string2), "%s", data[4]);
			strmid(PInfo[playerid][Reason1], string2, 0, strlen(string2), 128);
			PInfo[playerid][Warning2] = data2[15];
			format(string2, sizeof(string2), "%s", data[5]);
			strmid(PInfo[playerid][Reason2], string2, 0, strlen(string2), 128);
			PInfo[playerid][Warning3] = data2[16];
			format(string2, sizeof(string2), "%s", data[6]);
			strmid(PInfo[playerid][Reason3], string2, 0, strlen(string2), 128);
			PInfo[playerid][TotalJobs] = data2[17];
			PInfo[playerid][TotalScore] = data2[18];
			PInfo[playerid][ANDROF] = data2[19];
			PInfo[playerid][BEAGLEF] = data2[20];
			PInfo[playerid][CROPDUSTERF] = data2[21];
			PInfo[playerid][HYDRAF] = data2[22];
			PInfo[playerid][NEVADAF] = data2[23];
			PInfo[playerid][RUSTLERF] = data2[24];
			PInfo[playerid][CARGOBOBF] = data2[25];
			PInfo[playerid][HUNTERF] = data2[26];
			PInfo[playerid][LEVIATHANF] = data2[27];
			PInfo[playerid][MAVERICKF] = data2[28];
			PInfo[playerid][NMAVERICKF] = data2[29];
			PInfo[playerid][PMAVERICKF] = data2[30];
			PInfo[playerid][RAINDANCEF] = data2[31];
			PInfo[playerid][SEASPARROWF] = data2[32];
			PInfo[playerid][SPARROWF] = data2[33];
			PInfo[playerid][Online] = data2[34];
			PInfo[playerid][EarntFromWorking] = data2[35];
			PInfo[playerid][FlightsCompleted] = data2[36];
			format(string2, sizeof(string2), "%s", data[7]);
			strmid(PInfo[playerid][RegisterDate], string2, 0, strlen(string2), 128);
			format(string2, sizeof(string2), "%s", data[8]);
			strmid(PInfo[playerid][Callsign], string2, 0, strlen(string2), 64);
			PInfo[playerid][CallsignSet] = data2[37];
			format(string2, sizeof(string2), "%s", data[9]);
			strmid(PInfo[playerid][Email], string2, 0, strlen(string2), 256);
			PInfo[playerid][MemberID] = data2[38];
			PInfo[playerid][Airline] = data2[39];
			PInfo[playerid][AirlineRank] = data2[40];
			PInfo[playerid][EarntForAirline] = data2[41];
			PInfo[playerid][House1] = data2[42];
			PInfo[playerid][House2] = data2[43];
			PInfo[playerid][FlownDistance] = data2[44];
			PInfo[playerid][AirlineFlights] = data2[45];
			PInfo[playerid][Vip] = data2[46];
			format(string2, sizeof(string2), "%s", data[10]); //last login date+time
			strmid(PInfo[playerid][VIPColour], string2, 0, strlen(string2), 128); //last login date+time
			PInfo[playerid][Tickets] = data2[47];
			PInfo[playerid][sSpawn] = data2[48];
			PInfo[playerid][sSkin] = data2[49];
			PInfo[playerid][sPM] = data2[50];
			PInfo[playerid][sVIPSounds] = data2[51];
			PInfo[playerid][OwnedSkin] = data2[52];
			PInfo[playerid][sGlobalSounds] = data2[53];
			PInfo[playerid][sConnectionMessages] = data2[54];
			PInfo[playerid][sAutoWork] = data2[55];
            mysql_free_result();
        }
        new string[250];
	    //LoadPlayer(playerid);
	    mysql_free_result();
	    SessionStatus[playerid] = 2; //Logged in successfully. Show disconnect messages
		//if(PInfo[playerid][Banned] == 1) { CheckBanned(playerid); }
		PlayerLogged[playerid] = 1;
		SendClientMessage(playerid, COLOR_GREEN, "You have successfully been logged in.");
		SendClientMessage(playerid, COLOR_GREEN, "Please Register In Our lifeisyourpilot.freetzi.com forums because we always changing the server ip address");
		new plrIP[16];
		GetPlayerIp(playerid, plrIP, sizeof(plrIP));
		GivePlayerMoney(playerid, PInfo[playerid][Money]);
		strmid(PInfo[playerid][IP], plrIP, 0, strlen(plrIP), 255);
		if(JustRegistered[playerid] == 0)
		{
			new login[156];
			format(login, sizeof(login), "{1B8AE4}%s (%d) {FFFFFF}has logged into the server.", PlayerName(playerid), playerid);
			for(new i = 0; i <MAX_PLAYERS; i++)
			{
				if(IsPlayerConnected(i))
				{
		    		if(PInfo[i][sConnectionMessages] == 0)
		    		{
						SendClientMessage(i, COLOR_YELLOW, login);
					}
				}
			}
		}
		if(PInfo[playerid][AdminLevel] > 0) { format(string, sizeof(string), "You have authorized as a level %d administrator.", PInfo[playerid][AdminLevel]); SendClientMessage(playerid, COLOR_SECURITY, string); }
		if(JustRegistered[playerid] == 0) { format(string, sizeof(string), "{FFFFFF}Welcome back to the Life of Pilot, {1B8AE4}%s {FFFFFF}- {1B8AE4}[Last session: %s | %s]", PlayerName(playerid), PInfo[playerid][IP], PInfo[playerid][LastLogin]); SendClientMessage(playerid, COLOR_MESSAGE, string); }
		UpdateScore(playerid);
		PInfo[playerid][Online] = 1;
		YourOnline(playerid);
		CanAdvertiseAgain[playerid] = 1;
		if(PInfo[playerid][Airline] > 0)
		{
		    format(string,sizeof(string),"AMOTD: %s | Set by: %s", AInfo[PInfo[playerid][Airline]][aMotd], AInfo[PInfo[playerid][Airline]][aMotdSetBy]);
		    SendClientMessage(playerid, COLOR_YELLOW, string);
		}
		new motdstring[256];
		format(motdstring,sizeof(motdstring),"MOTD: %s | Set by: %s", ServerMOTD, ServerMOTDSetBy);
		SendClientMessage(playerid, COLOR_YELLOW, motdstring);
		if(PInfo[playerid][CallsignSet] == 0)
		{
			new msg[64];
			format(msg,sizeof(msg),"LoF");
			strmid(PInfo[playerid][Callsign], msg, 0, strlen(msg), 64);
			PInfo[playerid][CallsignSet] = 1;
		}

	}
	else
	{ // player incorrect password.
		SendClientMessage(playerid, COLOR_SECURITY, "Invalid password. Please try again, or request a password reset on the forums.");
		DisplayDialogForPlayer(playerid, 1);
  		mysql_free_result();
	}
}
public OnGameModeExit()
{
	PlayersOnline = 0;
	OnlineTimer();
	KillTimer(onlinetimer);
    KillTimer(randomtimer);
    mysql_close();
    ExitMapSystem();
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	TogglePlayerControllable(playerid, false);
	SetPlayerPos(playerid,1933.6263,-2399.9102,1201.7321);
	SetPlayerCameraPos(playerid, 1931.7674, -2417.5302, 1205.6908);
	SetPlayerCameraLookAt(playerid, 1931.7674, -2417.5202, 1200.6908);
    if(PlayerLogged[playerid] == 0)
	{
		mysql_reconnect();
		new	Query[90], EscName[MAX_PLAYER_NAME];
		mysql_real_escape_string(PlayerName(playerid), EscName);
		format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", EscName);
		mysql_query(Query);
		mysql_store_result();
		if(mysql_num_rows() != 0)
		{
		    mysql_free_result();
			SendClientMessage(playerid, COLOR_SECURITY, "Please enter your password below to continue.");
	 		DisplayDialogForPlayer(playerid, 1);
	        return 0;
		}
		else
		{
		    mysql_free_result();
			SendClientMessage(playerid, COLOR_SECURITY, "Please enter a password below to register an account.");
	 		DisplayDialogForPlayer(playerid, 2);
	        return 0;
		}
	}
	return 1;
}

public OnPlayerConnect(playerid)
{
	PlayersOnline++;
	SessionStatus[playerid] = 1; //Connected. Do not show messages.
	if(GlobalStatus == 2)
	{
	    SendClientMessage(playerid, COLOR_SECURITY, "A MySQL error has occured. Please visit the /forums for further details.");
	    Kick(playerid);
	}
	if(PlayersOnline > ServerMaxPlayers && sTrackPlayers == 1)
	{
	    new msg[256];
	    format(msg,sizeof(msg),"Life of Pilot has reached a new top player count! (Previously %d online players at %s - %s)",ServerMaxPlayers,ServerMaxPlayersDate,ServerMaxPlayersTime);
	    SendClientMessageToAll(COLOR_VIP, msg);
	    ServerMaxPlayers = PlayersOnline;
		new date,month,year;
		getdate(date,month,year);
		new hour,minute,second;
		gettime(hour,minute,second);
		new string[128];
		format(string,sizeof(string),"%d/%d/%d",year,month,date);
		strmid(ServerMaxPlayersDate, string, 0, strlen(string), 128);
		format(string,sizeof(string),"%d:%d:%d",hour,minute,second);
		strmid(ServerMaxPlayersTime, string, 0, strlen(string), 128);
		SaveStuff();
	}
	CheckIPS(playerid);
	PurelySpawned[playerid] = 0;
	ResetMissionData(playerid);
	ResetPlayerData(playerid);
	CheckBanned(playerid);
	RemoveObjectsForPlayer(playerid);
	ResetPlayerData(playerid);
	UpdatePlayerColour(playerid);
	TextDrawShowForPlayer(playerid, Clockzz);
	MapSystemAddPlayer(playerid);
	PlayerPlaySound(playerid, 1187, 0, 0, 0); // Start the music
	if(PlayerLogged[playerid] == 0)
	{
		mysql_reconnect();
		new	Query[90], EscName[MAX_PLAYER_NAME];
		mysql_real_escape_string(PlayerName(playerid), EscName);
		format(Query, sizeof(Query), "SELECT NULL FROM `users` WHERE `username` = '%s'", EscName);
		mysql_query(Query);
		mysql_store_result();
		if(mysql_num_rows() != 0)
		{
		    mysql_free_result();
			SendClientMessage(playerid, COLOR_SECURITY, "Please enter your password below to continue.");
	 		DisplayDialogForPlayer(playerid, 1);
	        return 0;
		}
		else
		{
		    PlayerPlaySound(playerid, 44204, 0, 0, 0);
		    mysql_free_result();
			SendClientMessage(playerid, COLOR_SECURITY, "Please enter a password below to register an account.");
	 		DisplayDialogForPlayer(playerid, 2);
	        return 0;
		}
 	}
	return 1;
}
Код:
 if(dialogid == 1) //LOGIN
    {
		if(PlayerLogged[playerid] == 1)
		{
			SendClientMessage(playerid, COLOR_YELLOW, "You are already logged in !");
			return 1;
		}
		if(response)
		{
		    if(!strlen(inputtext))
		    {
		        DisplayDialogForPlayer(playerid, 1); //login
				SendClientMessage(playerid, COLOR_YELLOW, "You must enter a password !");
				return 1;
			}
			if(strlen(inputtext) >= 50)
			{
			    DisplayDialogForPlayer(playerid, 1); //login
				SendClientMessage(playerid, COLOR_YELLOW, "That password is too long !");
				return 0;
			}
	        new tmppass[64];
	        //Store Player ID & TMP pass in echo to find string used to crash 
	        strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
	        PlayerLogin(playerid,tmppass);
		}
        else
        {
            SessionStatus[playerid] = 3;
            SendClientMessage(playerid, COLOR_SECURITY, "You have decided to quit. You have been kicked."); //login
            Kick(playerid);
        }
    }
    if(dialogid == 2) //REGISTER
    {
        if(PlayerLogged[playerid] == 1)
		{
			SendClientMessage(playerid, COLOR_ERROR, "You are already logged in !");
			return 1;
		}
		if(response)
		{
		    if(strlen(inputtext) >= 50)
			{
			    DisplayDialogForPlayer(playerid, 2); //register
				SendClientMessage(playerid, COLOR_ERROR, "Password is too long !");
				return 0;
			}
		    new sendername[MAX_PLAYER_NAME];
			GetPlayerName(playerid, sendername, sizeof(sendername));
			{
			    if(!strlen(inputtext))
		    	{
			        DisplayDialogForPlayer(playerid, 2); //register
					SendClientMessage(playerid, COLOR_ERROR, "Please enter a password for your account !");
					return 1;
				}
   				mysql_reconnect();
				new Query[90], EscName[MAX_PLAYER_NAME];
				mysql_real_escape_string(PlayerName(playerid), EscName);
				format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", EscName);
				mysql_query(Query);
				mysql_store_result();
				if(mysql_num_rows() != 0)
				{
	    			mysql_free_result();
					SendClientMessage(playerid, COLOR_ERROR, "Name already registered. Please choose a different name !");
					return 1;
				}
				else
				{
					RegisterAccount(playerid,inputtext);
					JustRegistered[playerid] = 1;
					new tPlayers = 0;
					mysql_query("SELECT NULL from `users`");
					mysql_store_result();
					tPlayers = mysql_num_rows();
					mysql_free_result();
					new login[156];
					format(login, sizeof(login), "{1B8AE4}%s (%d) {FFFFFF}has created an account. (%d total accounts)", PlayerName(playerid), playerid, tPlayers);
					for(new i = 0; i <MAX_PLAYERS; i++)
					{
						if(IsPlayerConnected(i))
						{
						    if(PInfo[i][sConnectionMessages] == 0)
						    {
								SendClientMessage(i, COLOR_YELLOW, login);
							}
						}
					}
					SendClientMessage(playerid, COLOR_MESSAGE, "Your account has been successfully registered.");
                    SendClientMessage(playerid, COLOR_MESSAGE, "Please register In Our lifeisyourpilot.freetzi.com Forum because We Always Changing The  IP Address.");
					PlayerLogin(playerid,inputtext);
				    SetPlayerVirtualWorld(playerid, 0);
                	mysql_free_result();
				}
			}
		}
		else
		{
		    DisplayDialogForPlayer(playerid, 2); //register
		}
    }
Quote:
Originally Posted by Mencent
Посмотреть сообщение
PHP код:
public PlayerLogin(playerid,password[])
{
    
mysql_reconnect();
    new 
EscPass[128], EscName[128], Query[128];
    
mysql_real_escape_string(PlayerName(playerid), EscName);
    
mysql_real_escape_string(passwordEscPass);
    
format(Querysizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s' AND `password` = '%s'"EscNameEscPass);
    
mysql_query(Query);
    
mysql_store_result();
    if(
mysql_num_rows() > 0)
    { 
// player logged in.
        
new line[1250];
        if(
mysql_fetch_row(line)) //Fetches the line
        
{
            new 
string2[128];
            new 
data[11][128]; //The data strings
            
new data2[56]; //The data variables
            //new Float:data3[5]; //The data floats
            
sscanf(line"p<|>s[128]s[128]ds[128]s[128]ddddddddddddddsds[128]ds[128]dddddddddddddddddddds[128]s[128]ds[128]ddddddddds[128]ddddddddd"data[0], data[1], data2[0], data[2], data[3], data2[1], data2[2], data2[3], data2[4], data2[5], data2[6], data2[7], data2[8], data2[9], data2[10], data2[11], data2[12], data2[13], data2[14], data[4], data2[15], data[5], data2[16], data[6], data2[17], data2[18], data2[19],
            
data2[20], data2[21], data2[22], data2[23], data2[24], data2[25], data2[26], data2[27], data2[28], data2[29], data2[30], data2[31], data2[32], data2[33], data2[34], data2[35], data2[36], data[7], data[8], data2[37], data[9], data2[38], data2[39], data2[40], data2[41],data2[42],data2[43],data2[44],data2[45],data2[46],data[10],data2[47], data2[48],data2[49],data2[50],data2[51],data2[52],data2[53],data2[54],data2[55]); //Splits the line with sscanf
            
format(string2sizeof(string2), "%s"data[1]); //PASSWORD
            
strmid(PInfo[playerid][Password], string20strlen(string2), 128); //PASSWORD
            
PInfo[playerid][AdminLevel] = data2[0];
            
format(string2sizeof(string2), "%s"data[3]); //last login date+time
            
strmid(PInfo[playerid][LastLogin], string20strlen(string2), 128); //last login date+time
            
PInfo[playerid][Banned] = data2[1];
            
PInfo[playerid][Money] = data2[2];
            
PInfo[playerid][AT400F] = data2[3];
            
PInfo[playerid][STUNTF] = data2[4];
            
PInfo[playerid][HELIF] = data2[5];
            
PInfo[playerid][CARGOF] = data2[6];
            
PInfo[playerid][MILITARYF] = data2[7];
            
PInfo[playerid][SHAMALF] = data2[8];
            
PInfo[playerid][DODOF] = data2[9];
            
PInfo[playerid][SKIMMERF] = data2[10];
            
PInfo[playerid][Muted] = data2[11];
            
PInfo[playerid][HoursPlayed] = data2[12];
            
PInfo[playerid][MinsPlayed] = data2[13];
            
PInfo[playerid][Warning1] = data2[14];
            
format(string2sizeof(string2), "%s"data[4]);
            
strmid(PInfo[playerid][Reason1], string20strlen(string2), 128);
            
PInfo[playerid][Warning2] = data2[15];
            
format(string2sizeof(string2), "%s"data[5]);
            
strmid(PInfo[playerid][Reason2], string20strlen(string2), 128);
            
PInfo[playerid][Warning3] = data2[16];
            
format(string2sizeof(string2), "%s"data[6]);
            
strmid(PInfo[playerid][Reason3], string20strlen(string2), 128);
            
PInfo[playerid][TotalJobs] = data2[17];
            
PInfo[playerid][TotalScore] = data2[18];
            
PInfo[playerid][ANDROF] = data2[19];
            
PInfo[playerid][BEAGLEF] = data2[20];
            
PInfo[playerid][CROPDUSTERF] = data2[21];
            
PInfo[playerid][HYDRAF] = data2[22];
            
PInfo[playerid][NEVADAF] = data2[23];
            
PInfo[playerid][RUSTLERF] = data2[24];
            
PInfo[playerid][CARGOBOBF] = data2[25];
            
PInfo[playerid][HUNTERF] = data2[26];
            
PInfo[playerid][LEVIATHANF] = data2[27];
            
PInfo[playerid][MAVERICKF] = data2[28];
            
PInfo[playerid][NMAVERICKF] = data2[29];
            
PInfo[playerid][PMAVERICKF] = data2[30];
            
PInfo[playerid][RAINDANCEF] = data2[31];
            
PInfo[playerid][SEASPARROWF] = data2[32];
            
PInfo[playerid][SPARROWF] = data2[33];
            
PInfo[playerid][] = data2[34];
            
PInfo[playerid][EarntFromWorking] = data2[35];
            
PInfo[playerid][FlightsCompleted] = data2[36];
            
format(string2sizeof(string2), "%s"data[7]);
            
strmid(PInfo[playerid][RegisterDate], string20strlen(string2), 128);
            
format(string2sizeof(string2), "%s"data[8]);
            
strmid(PInfo[playerid][Callsign], string20strlen(string2), 64);
            
PInfo[playerid][CallsignSet] = data2[37];
            
format(string2sizeof(string2), "%s"data[9]);
            
strmid(PInfo[playerid][Email], string20strlen(string2), 256);
            
PInfo[playerid][MemberID] = data2[38];
            
PInfo[playerid][Airline] = data2[39];
            
PInfo[playerid][AirlineRank] = data2[40];
            
PInfo[playerid][EarntForAirline] = data2[41];
            
PInfo[playerid][House1] = data2[42];
            
PInfo[playerid][House2] = data2[43];
            
PInfo[playerid][FlownDistance] = data2[44];
            
PInfo[playerid][AirlineFlights] = data2[45];
            
PInfo[playerid][Vip] = data2[46];
            
format(string2sizeof(string2), "%s"data[10]); //last login date+time
            
strmid(PInfo[playerid][VIPColour], string20strlen(string2), 128); //last login date+time
            
PInfo[playerid][Tickets] = data2[47];
            
PInfo[playerid][sSpawn] = data2[48];
            
PInfo[playerid][sSkin] = data2[49];
            
PInfo[playerid][sPM] = data2[50];
            
PInfo[playerid][sVIPSounds] = data2[51];
            
PInfo[playerid][OwnedSkin] = data2[52];
            
PInfo[playerid][sGlobalSounds] = data2[53];
            
PInfo[playerid][sConnectionMessages] = data2[54];
            
PInfo[playerid][sAutoWork] = data2[55];
            
mysql_free_result();
        }
        new 
string[250];
        
//LoadPlayer(playerid);
        
mysql_free_result();
        
SessionStatus[playerid] = 2//Logged in successfully. Show disconnect messages
        //if(PInfo[playerid][Banned] == 1) { CheckBanned(playerid); }
        
PlayerLogged[playerid] = 1;
        
SendClientMessage(playeridCOLOR_GREEN"You have successfully been logged in.");
        
SendClientMessage(playeridCOLOR_GREEN"Please Register In Our lifeisyourpilot.freetzi.com forums because we always changing the  ip address");
        new 
plrIP[16];
        
GetPlayerIp(playeridplrIPsizeof(plrIP));
        
GivePlayerMoney(playeridPInfo[playerid][Money]);
        
strmid(PInfo[playerid][IP], plrIP0strlen(plrIP), 255);
        if(
JustRegistered[playerid] == 0)
        {
            new 
login[156];
            
format(loginsizeof(login), "{1B8AE4}%s (%d) {FFFFFF}has logged into the ."PlayerName(playerid), playerid);
            for(new 
0<MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
PInfo[i][sConnectionMessages] == 0)
                    {
                        
SendClientMessage(iCOLOR_YELLOWlogin);
                    }
                }
            }
        }
        if(
PInfo[playerid][AdminLevel] > 0) { format(stringsizeof(string), "You have authorized as a level %d administrator."PInfo[playerid][AdminLevel]); SendClientMessage(playeridCOLOR_SECURITYstring); }
        if(
JustRegistered[playerid] == 0) { format(stringsizeof(string), "{FFFFFF}Welcome back to the Life of Pilot, {1B8AE4}%s {FFFFFF}- {1B8AE4}[Last session: %s | %s]"PlayerName(playerid), PInfo[playerid][IP], PInfo[playerid][LastLogin]); SendClientMessage(playeridCOLOR_MESSAGEstring); }
        
UpdateScore(playerid);
        
PInfo[playerid][] = 1;
        
YourOnline(playerid);
        
CanAdvertiseAgain[playerid] = 1;
        if(
PInfo[playerid][Airline] > 0)
        {
            
format(string,sizeof(string),"AMOTD: %s | Set by: %s"AInfo[PInfo[playerid][Airline]][aMotd], AInfo[PInfo[playerid][Airline]][aMotdSetBy]);
            
SendClientMessage(playeridCOLOR_YELLOWstring);
        }
        new 
motdstring[256];
        
format(motdstring,sizeof(motdstring),"MOTD: %s | Set by: %s"MOTDMOTDSetBy);
        
SendClientMessage(playeridCOLOR_YELLOWmotdstring);
        if(
PInfo[playerid][CallsignSet] == 0)
        {
            new 
msg[64];
            
format(msg,sizeof(msg),"LoF");
            
strmid(PInfo[playerid][Callsign], msg0strlen(msg), 64);
            
PInfo[playerid][CallsignSet] = 1;
        }
        return 
1;//<<<<<-------------
    
}
    else
    { 
// player incorrect password.
        
SendClientMessage(playeridCOLOR_SECURITY"Invalid password. Please try again, or request a password reset on the forums.");
        
DisplayDialogForPlayer(playerid1);
        
mysql_free_result();
    }
    return 
1;

Now I Not Got Warning But if I register it asking again register Before i post Like That Showing Can't Login please help me please
Reply
#10

start with so much shits isn't easy buddy,

better edit bare script and make your own gamemode!

OT: this is a copyed gamemode, create your own if you want help!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)