Gamemod doesn't connect to the database
#1

Well, I think that the problem is that my gamemode doesn't connect to the database.
When I run the samp-server.exe it opens and closes after 1 second.
This is the samp-server log file:

Код:
SA-MP Dedicated Server
----------------------
v0.3a R7, ©2005-2010 SA-MP Team

[22:12:51] filterscripts = ""  (string)
[22:12:51] 
[22:12:51] Server Plugins
[22:12:51] --------------
[22:12:51]  Loading plugin: mysql
[22:12:51] 

  > MySQL plugin R4-2 successfully loaded.

[22:12:51]   Loaded.
[22:12:51]  Loaded 1 plugins.

[22:12:51] 
[22:12:51] Filter Scripts
[22:12:51] ---------------
[22:12:51]   Loaded 0 filter scripts.

[22:12:51] tick
I've downloaded wamp server and via the Nevigate for MYSQL software I logged into the database and executed the database.sql file that I've recieved from the seller when I bought the gamemode.

This is my OnGameModeInit:
Код:
print("tick");
	#if DEBUG 1
		format(debugs,256,"DEBUG | OngameModeInit start.");
		debugLog(debugs);
	#endif
	/*admintext = TextDrawCreate(1.000000,430.000000,"crap");
	TextDrawAlignment(admintext,0);
	TextDrawBackgroundColor(admintext,0x000000ff);
	TextDrawFont(admintext,3);
	TextDrawLetterSize(admintext,0.500000,1.000000);
	TextDrawColor(admintext,0xffffff99);
	TextDrawSetOutline(admintext,1);
	TextDrawSetProportional(admintext,1);
	TextDrawSetShadow(admintext,2);*/
	
	//ShowPlayerMarkers(false);
	SetGameModeText(scriptVersion);
    AddPlayerClass(0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
	mysql_debug(1);
	mysql_connect("192.168.42.1", "Exodus", "Exodus_one", "prawnfuckingcrackers");
 	new string[MAX_STRING1];
	format(String,256,"TRUNCATE TABLE `donated`");
	mysql_query(String);
	format(String,256,"TRUNCATE TABLE `drugpos`");
	mysql_query(String);
	format(String,256,"UPDATE `users` SET  `online`='0'");
	mysql_query(String);
	format(String,256,"UPDATE `objects` SET `state`='0'");
	mysql_query(String);
	carmenu = CreateMenu("Private Car Menu:", 1, 200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(carmenu,0,"Select:");
	AddMenuItem(carmenu,0,"Lock vehicle.");
	AddMenuItem(carmenu,0,"Unlock vehicle.");
	AddMenuItem(carmenu,0,"Purchase locks.");
	AddMenuItem(carmenu,0,"Repaint your vehicle.");
	AddMenuItem(carmenu,0,"Buy a GPS system.");
	AddMenuItem(carmenu,0,"Install Tinted Windows.");
	AddMenuItem(carmenu,0,"Repark your vehicle.");
	AddMenuItem(carmenu,0,"Sell vehicle.");
	semicarmenu=CreateMenu("faction/job Car Menu:", 1, 200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(semicarmenu,0,"Select:");
	AddMenuItem(semicarmenu,0,"Park vehicle.");
	AddMenuItem(semicarmenu,0,"Delete vehicle.");
	lockmenu= CreateMenu("Locks Menu:",2, 200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(lockmenu,0,"Lock Name:");
	SetMenuColumnHeader(lockmenu,1,"Price:");
	for(new i=0;i<sizeof(locks);i++)
	{
	    AddMenuItem(lockmenu,0,locks[i][lockname]);
		format(string,MAX_STRING1,"%d",locks[i][lockprice],100-locks[i][percents]);
		AddMenuItem(lockmenu,1,string);
	}
	carcolor= CreateMenu("Colors Menu:",1,200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(carcolor,0,"Select:");
	AddMenuItem(carcolor,0,"Black");
	AddMenuItem(carcolor,0,"White");
	AddMenuItem(carcolor,0,"Red");
	AddMenuItem(carcolor,0,"Green");
	AddMenuItem(carcolor,0,"Blue");
	AddMenuItem(carcolor,0,"Orange");
	AddMenuItem(carcolor,0,"Purple");
	AddMenuItem(carcolor,0,"Pink");
	new hour,mins,secs;
	gettime(hour,mins,secs);
	AllowAdminTeleport(1); // ray tp
	//new File:hFile;
//---------------------------/eatmenu-------------------------------------------
    eatmenu = CreateMenu("Food", 1, 200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(eatmenu,0,"Food type");
	SetMenuColumnHeader(eatmenu,1,"Price");
	for(new i=0;i<sizeof(foods);i++)
	{
	    AddMenuItem(eatmenu,0,foods[i][fname]);
	    AddMenuItem(eatmenu,1,foods[i][fprice]);
	}
//----------------------------[City Hall menu]----------------------------------
    cityhallmenu = CreateMenu("Employment",  1, 200.0, 100.0, 150.0, 150.0);
    SetMenuColumnHeader(cityhallmenu,0,"Select:");
	for(new i=1;i<sizeof(jobs);i++)
	    AddMenuItem(cityhallmenu, 0, jobs[i][jname]);
//----------------------------[Help Menu----------------------------------------
    helpmenu = CreateMenu("Helps", 1, 200.0, 100.0, 150.0, 150.0);
    new File:hFile=fopen("helps/types.txt",io_read);
    SetMenuColumnHeader(helpmenu,0,"Select:");
	while(fread(hFile,String))
	    AddMenuItem(helpmenu, 0, String);
	fclose(hFile);
	shopmenu1 = CreateMenu("24/7", 2, 200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(shopmenu1,0,"Product:");
	SetMenuColumnHeader(shopmenu1,1,"Price:");
	AddMenuItem(shopmenu1,0,"Cell Phone");
	AddMenuItem(shopmenu1,1,"100$");
	AddMenuItem(shopmenu1,0,"Cell Phone Memory Card");
	AddMenuItem(shopmenu1,1,"500$");
	AddMenuItem(shopmenu1,0,"Phone Book");
	AddMenuItem(shopmenu1,1,"10$");
	AddMenuItem(shopmenu1,0,"Camera");
	AddMenuItem(shopmenu1,1,"100$");
	AddMenuItem(shopmenu1,0,"Scratch Card");
	AddMenuItem(shopmenu1,1,"50$");
	AddMenuItem(shopmenu1,0,"Dice");
	AddMenuItem(shopmenu1,1,"30$");
	AddMenuItem(shopmenu1,0,"Spray color");
	AddMenuItem(shopmenu1,1,"13$");
	AddMenuItem(shopmenu1,0,"Pager");
	AddMenuItem(shopmenu1,1,"50$");
	AddMenuItem(shopmenu1,0,"A shaker");
	AddMenuItem(shopmenu1,1,"120$");
	AddMenuItem(shopmenu1,0,"A small bin");	//instead of condome
	AddMenuItem(shopmenu1,1,"35$");
	AddMenuItem(shopmenu1,0,"A bottle kerosene");
	AddMenuItem(shopmenu1,1,"60$");
	AddMenuItem(shopmenu1,0,"A filter");
	AddMenuItem(shopmenu1,1,"40$");
	shopmenu2 = CreateMenu("24/7", 2, 200.0, 100.0, 150.0, 150.0);	//rayshop
	SetMenuColumnHeader(shopmenu2,0,"Product:");
	SetMenuColumnHeader(shopmenu2,1,"Price:");
	AddMenuItem(shopmenu2,0,"Gas Can");
	AddMenuItem(shopmenu2,1,"150$");
	AddMenuItem(shopmenu2,0,"Oxidizing Agent");
	AddMenuItem(shopmenu2,1,"250$");
	AddMenuItem(shopmenu2,0,"Mask");
	AddMenuItem(shopmenu2,1,"100$");
	AddMenuItem(shopmenu2,0,"Baseball Bat");
	AddMenuItem(shopmenu2,1,"50$");
	AddMenuItem(shopmenu2,0,"A knife");
	AddMenuItem(shopmenu2,1,"150$");
	format(String,256,"SELECT `mid`,`x`,`y`,`z`,`rx`,`ry`,`rz`,`id` FROM `objects`");
	mysql_query(String);
	mysql_store_result();
	while(mysql_fetch_row_default(String))
	{
	    magicstrtok(string,"|",String);
		new mid=strvalEx(string);
		magicstrtok(string,"|","");
		new Float:x=floatstr(string);
	    magicstrtok(string,"|","");
	    new Float:y=floatstr(string);
	    magicstrtok(string,"|","");
	    new Float:z=floatstr(string);
	    magicstrtok(string,"|","");
	    new Float:rx=floatstr(string);
	    magicstrtok(string,"|","");
	    new Float:ry=floatstr(string);
	    magicstrtok(string,"|","");
	    new Float:rz=floatstr(string);
	    new oid=CreateObject(mid,x,y,z,rx,ry,rz);
	    magicstrtok(string,"|","");
	    format(string,MAX_STRING1,"UPDATE `objects` SET `oid`='%d' WHERE `id`='%d'",oid,strvalEx(string));
	    mysql_query(string);
	}
	mysql_free_result();
	AllowInteriorWeapons(1);
    SetNameTagDrawDistance(10.0);
 	//UsePlayerPedAnims();
    DisableInteriorEnterExits();
	format(string,MAX_STRING1,"SELECT `id`,`x`,`y`,`z`,`owner` FROM `houses` WHERE `price`>0");
	mysql_query(string);
	mysql_store_result();
	while(mysql_fetch_row_default(String))
	{
	    magicstrtok(string,"|",String);
		new id=strvalEx(string);
		magicstrtok(string,"|","");
		new Float:x=floatstr(string);
		magicstrtok(string,"|","");
		new Float:y=floatstr(string);
		magicstrtok(string,"|","");
		new Float:z=floatstr(string);
		magicstrtok(string,"|","");
		new pid;
		if(!strcmp(string,"No",true))
			pid=CreatePickup(GREEN_PICKUP,1,x,y,z);
		else
		    pid=CreatePickup(BLUE_PICKUP,1,x,y,z);
		format(String,256,"UPDATE `houses` SET `pid`='%d' WHERE `id`='%d' AND `price`>0",pid,id);
		mysql_query(String);
	}
	mysql_free_result();
	format(string,MAX_STRING1,"SELECT `id`,`x`,`y`,`z`,`owner` FROM `houses` WHERE `price`<0");
	mysql_query(string);
	mysql_store_result();
	while(mysql_fetch_row_default(String))
	{
	    magicstrtok(string,"|",String);
		new id=strvalEx(string);
		magicstrtok(string,"|","");
		new Float:x=floatstr(string);
		magicstrtok(string,"|","");
		new Float:y=floatstr(string);
		magicstrtok(string,"|","");
		new Float:z=floatstr(string);
		magicstrtok(string,"|","");
		new pid;
		pid=CreatePickup(INFO_PICKUP,1,x,y,z);
		format(String,256,"UPDATE `houses` SET `pid`='%d' WHERE `id`='%d' AND `price`<0",pid,id);
		mysql_query(String);
	}
	mysql_free_result();
	for(new i=1;i<sizeof(jobs);i++)
	    CreatePickup(INFO_PICKUP,1,jobs[i][jx],jobs[i][jy],jobs[i][jz]);
	format(string,MAX_STRING1,"SELECT `id`,`x`,`y`,`z` FROM `houses` WHERE `price`='0'");
	mysql_query(string);
	mysql_store_result();
	while(mysql_fetch_row_default(String))
	{
	    magicstrtok(string,"|",String);
		new id=strvalEx(string);
		magicstrtok(string,"|","");
		new Float:x=floatstr(string);
		magicstrtok(string,"|","");
		new Float:y=floatstr(string);
		magicstrtok(string,"|","");
		new Float:z=floatstr(string);
		new pid=CreatePickup(INFO_PICKUP,1,x,y,z);
		format(String,256,"UPDATE `houses` SET `pid`='%d' WHERE `id`='%d'",pid,id);
		mysql_query(String);
	}
	mysql_free_result();
//	UsePlayerPedAnims();
	EnableStuntBonusForAll(0);
	SetTimer("SecTimer",1000,1);
	SetTimer("keepfrizing",1000,1);
	SetTimer("eatgeneretor",45*1000,1);
	SetTimer("moneycheat",1137,1);
//	SetTimer("weaponcheat",1000,1);
	SetTimer("AntiWeaponHack",1000,1);
	SetTimer("Afk",1000,1);
	SetTimer("update",1000*60*5,1);
	SetTimer("recover",MAX_STRING1,1);
	SetTimer("CarSpeed",1000,1);
	// LoadBusiness();
	CV();
	
	for(new i=0; i < MAX_PLAYERS; i++)
	{
		PMAllowed[i] = true;
	}
	#if DEBUG 1
		format(debugs,256,"DEBUG | OngameModeInit end.");
		debugLog(debugs);
	#endif
	return 1;
This is my SQL defines on the top of the script:
Код:
#define SQL_HOST "localhost"
#define SQL_USER "root"
#define SQL_PASS ""
#define SQL_DB "samp"
Could somebody please tell me what am I doing wrong here? I really can't understand..

Thank you.
Reply
#2

It would appear that those SQL defines at the top are doing nothing, since the connect query looks like this

pawn Код:
mysql_connect("192.168.42.1", "Exodus", "Exodus_one", "prawnfuckingcrackers");
It should be

pawn Код:
mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
Make sure you've created a database on your MySQL server called "samp".
Reply
#3

if(mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS)) print("Mysql Connected");
else print("Mysql Failed To Connected");

test the connection, put that under ongamemodeinit.
Reply
#4

Well, my OnGameModeInit code looks like this:
Код:
if(mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS)) print("Mysql Connected");
else print("Mysql Failed To Connected");
	print("tick");
	#if DEBUG 1
		format(debugs,256,"DEBUG | OngameModeInit start.");
		debugLog(debugs);
	#endif
	/*admintext = TextDrawCreate(1.000000,430.000000,"crap");
	TextDrawAlignment(admintext,0);
	TextDrawBackgroundColor(admintext,0x000000ff);
	TextDrawFont(admintext,3);
	TextDrawLetterSize(admintext,0.500000,1.000000);
	TextDrawColor(admintext,0xffffff99);
	TextDrawSetOutline(admintext,1);
	TextDrawSetProportional(admintext,1);
	TextDrawSetShadow(admintext,2);*/
	
	//ShowPlayerMarkers(false);
	SetGameModeText(scriptVersion);
    AddPlayerClass(0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
	mysql_debug(1);
    mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
 	new string[MAX_STRING1];
	format(String,256,"TRUNCATE TABLE `donated`");
	mysql_query(String);
	format(String,256,"TRUNCATE TABLE `drugpos`");
	mysql_query(String);
	format(String,256,"UPDATE `users` SET  `online`='0'");
	mysql_query(String);
	format(String,256,"UPDATE `objects` SET `state`='0'");
	mysql_query(String);
	carmenu = CreateMenu("Private Car Menu:", 1, 200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(carmenu,0,"Select:");
	AddMenuItem(carmenu,0,"Lock vehicle.");
	AddMenuItem(carmenu,0,"Unlock vehicle.");
	AddMenuItem(carmenu,0,"Purchase locks.");
	AddMenuItem(carmenu,0,"Repaint your vehicle.");
	AddMenuItem(carmenu,0,"Buy a GPS system.");
	AddMenuItem(carmenu,0,"Install Tinted Windows.");
	AddMenuItem(carmenu,0,"Repark your vehicle.");
	AddMenuItem(carmenu,0,"Sell vehicle.");
	semicarmenu=CreateMenu("faction/job Car Menu:", 1, 200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(semicarmenu,0,"Select:");
	AddMenuItem(semicarmenu,0,"Park vehicle.");
	AddMenuItem(semicarmenu,0,"Delete vehicle.");
	lockmenu= CreateMenu("Locks Menu:",2, 200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(lockmenu,0,"Lock Name:");
	SetMenuColumnHeader(lockmenu,1,"Price:");
	for(new i=0;i<sizeof(locks);i++)
	{
	    AddMenuItem(lockmenu,0,locks[i][lockname]);
		format(string,MAX_STRING1,"%d",locks[i][lockprice],100-locks[i][percents]);
		AddMenuItem(lockmenu,1,string);
	}
	carcolor= CreateMenu("Colors Menu:",1,200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(carcolor,0,"Select:");
	AddMenuItem(carcolor,0,"Black");
	AddMenuItem(carcolor,0,"White");
	AddMenuItem(carcolor,0,"Red");
	AddMenuItem(carcolor,0,"Green");
	AddMenuItem(carcolor,0,"Blue");
	AddMenuItem(carcolor,0,"Orange");
	AddMenuItem(carcolor,0,"Purple");
	AddMenuItem(carcolor,0,"Pink");
	new hour,mins,secs;
	gettime(hour,mins,secs);
	AllowAdminTeleport(1); // ray tp
	//new File:hFile;
//---------------------------/eatmenu-------------------------------------------
    eatmenu = CreateMenu("Food", 1, 200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(eatmenu,0,"Food type");
	SetMenuColumnHeader(eatmenu,1,"Price");
	for(new i=0;i<sizeof(foods);i++)
	{
	    AddMenuItem(eatmenu,0,foods[i][fname]);
	    AddMenuItem(eatmenu,1,foods[i][fprice]);
	}
//----------------------------[City Hall menu]----------------------------------
    cityhallmenu = CreateMenu("Employment",  1, 200.0, 100.0, 150.0, 150.0);
    SetMenuColumnHeader(cityhallmenu,0,"Select:");
	for(new i=1;i<sizeof(jobs);i++)
	    AddMenuItem(cityhallmenu, 0, jobs[i][jname]);
//----------------------------[Help Menu----------------------------------------
    helpmenu = CreateMenu("Helps", 1, 200.0, 100.0, 150.0, 150.0);
    new File:hFile=fopen("helps/types.txt",io_read);
    SetMenuColumnHeader(helpmenu,0,"Select:");
	while(fread(hFile,String))
	    AddMenuItem(helpmenu, 0, String);
	fclose(hFile);
	shopmenu1 = CreateMenu("24/7", 2, 200.0, 100.0, 150.0, 150.0);
	SetMenuColumnHeader(shopmenu1,0,"Product:");
	SetMenuColumnHeader(shopmenu1,1,"Price:");
	AddMenuItem(shopmenu1,0,"Cell Phone");
	AddMenuItem(shopmenu1,1,"100$");
	AddMenuItem(shopmenu1,0,"Cell Phone Memory Card");
	AddMenuItem(shopmenu1,1,"500$");
	AddMenuItem(shopmenu1,0,"Phone Book");
	AddMenuItem(shopmenu1,1,"10$");
	AddMenuItem(shopmenu1,0,"Camera");
	AddMenuItem(shopmenu1,1,"100$");
	AddMenuItem(shopmenu1,0,"Scratch Card");
	AddMenuItem(shopmenu1,1,"50$");
	AddMenuItem(shopmenu1,0,"Dice");
	AddMenuItem(shopmenu1,1,"30$");
	AddMenuItem(shopmenu1,0,"Spray color");
	AddMenuItem(shopmenu1,1,"13$");
	AddMenuItem(shopmenu1,0,"Pager");
	AddMenuItem(shopmenu1,1,"50$");
	AddMenuItem(shopmenu1,0,"A shaker");
	AddMenuItem(shopmenu1,1,"120$");
	AddMenuItem(shopmenu1,0,"A small bin");	//instead of condome
	AddMenuItem(shopmenu1,1,"35$");
	AddMenuItem(shopmenu1,0,"A bottle kerosene");
	AddMenuItem(shopmenu1,1,"60$");
	AddMenuItem(shopmenu1,0,"A filter");
	AddMenuItem(shopmenu1,1,"40$");
	shopmenu2 = CreateMenu("24/7", 2, 200.0, 100.0, 150.0, 150.0);	//rayshop
	SetMenuColumnHeader(shopmenu2,0,"Product:");
	SetMenuColumnHeader(shopmenu2,1,"Price:");
	AddMenuItem(shopmenu2,0,"Gas Can");
	AddMenuItem(shopmenu2,1,"150$");
	AddMenuItem(shopmenu2,0,"Oxidizing Agent");
	AddMenuItem(shopmenu2,1,"250$");
	AddMenuItem(shopmenu2,0,"Mask");
	AddMenuItem(shopmenu2,1,"100$");
	AddMenuItem(shopmenu2,0,"Baseball Bat");
	AddMenuItem(shopmenu2,1,"50$");
	AddMenuItem(shopmenu2,0,"A knife");
	AddMenuItem(shopmenu2,1,"150$");
	format(String,256,"SELECT `mid`,`x`,`y`,`z`,`rx`,`ry`,`rz`,`id` FROM `objects`");
	mysql_query(String);
	mysql_store_result();
	while(mysql_fetch_row_default(String))
	{
	    magicstrtok(string,"|",String);
		new mid=strvalEx(string);
		magicstrtok(string,"|","");
		new Float:x=floatstr(string);
	    magicstrtok(string,"|","");
	    new Float:y=floatstr(string);
	    magicstrtok(string,"|","");
	    new Float:z=floatstr(string);
	    magicstrtok(string,"|","");
	    new Float:rx=floatstr(string);
	    magicstrtok(string,"|","");
	    new Float:ry=floatstr(string);
	    magicstrtok(string,"|","");
	    new Float:rz=floatstr(string);
	    new oid=CreateObject(mid,x,y,z,rx,ry,rz);
	    magicstrtok(string,"|","");
	    format(string,MAX_STRING1,"UPDATE `objects` SET `oid`='%d' WHERE `id`='%d'",oid,strvalEx(string));
	    mysql_query(string);
	}
	mysql_free_result();
	AllowInteriorWeapons(1);
    SetNameTagDrawDistance(10.0);
 	//UsePlayerPedAnims();
    DisableInteriorEnterExits();
	format(string,MAX_STRING1,"SELECT `id`,`x`,`y`,`z`,`owner` FROM `houses` WHERE `price`>0");
	mysql_query(string);
	mysql_store_result();
	while(mysql_fetch_row_default(String))
	{
	    magicstrtok(string,"|",String);
		new id=strvalEx(string);
		magicstrtok(string,"|","");
		new Float:x=floatstr(string);
		magicstrtok(string,"|","");
		new Float:y=floatstr(string);
		magicstrtok(string,"|","");
		new Float:z=floatstr(string);
		magicstrtok(string,"|","");
		new pid;
		if(!strcmp(string,"No",true))
			pid=CreatePickup(GREEN_PICKUP,1,x,y,z);
		else
		    pid=CreatePickup(BLUE_PICKUP,1,x,y,z);
		format(String,256,"UPDATE `houses` SET `pid`='%d' WHERE `id`='%d' AND `price`>0",pid,id);
		mysql_query(String);
	}
	mysql_free_result();
	format(string,MAX_STRING1,"SELECT `id`,`x`,`y`,`z`,`owner` FROM `houses` WHERE `price`<0");
	mysql_query(string);
	mysql_store_result();
	while(mysql_fetch_row_default(String))
	{
	    magicstrtok(string,"|",String);
		new id=strvalEx(string);
		magicstrtok(string,"|","");
		new Float:x=floatstr(string);
		magicstrtok(string,"|","");
		new Float:y=floatstr(string);
		magicstrtok(string,"|","");
		new Float:z=floatstr(string);
		magicstrtok(string,"|","");
		new pid;
		pid=CreatePickup(INFO_PICKUP,1,x,y,z);
		format(String,256,"UPDATE `houses` SET `pid`='%d' WHERE `id`='%d' AND `price`<0",pid,id);
		mysql_query(String);
	}
	mysql_free_result();
	for(new i=1;i<sizeof(jobs);i++)
	    CreatePickup(INFO_PICKUP,1,jobs[i][jx],jobs[i][jy],jobs[i][jz]);
	format(string,MAX_STRING1,"SELECT `id`,`x`,`y`,`z` FROM `houses` WHERE `price`='0'");
	mysql_query(string);
	mysql_store_result();
	while(mysql_fetch_row_default(String))
	{
	    magicstrtok(string,"|",String);
		new id=strvalEx(string);
		magicstrtok(string,"|","");
		new Float:x=floatstr(string);
		magicstrtok(string,"|","");
		new Float:y=floatstr(string);
		magicstrtok(string,"|","");
		new Float:z=floatstr(string);
		new pid=CreatePickup(INFO_PICKUP,1,x,y,z);
		format(String,256,"UPDATE `houses` SET `pid`='%d' WHERE `id`='%d'",pid,id);
		mysql_query(String);
	}
	mysql_free_result();
//	UsePlayerPedAnims();
	EnableStuntBonusForAll(0);
	SetTimer("SecTimer",1000,1);
	SetTimer("keepfrizing",1000,1);
	SetTimer("eatgeneretor",45*1000,1);
	SetTimer("moneycheat",1137,1);
//	SetTimer("weaponcheat",1000,1);
	SetTimer("AntiWeaponHack",1000,1);
	SetTimer("Afk",1000,1);
	SetTimer("update",1000*60*5,1);
	SetTimer("recover",MAX_STRING1,1);
	SetTimer("CarSpeed",1000,1);
	// LoadBusiness();
	CV();
	
	for(new i=0; i < MAX_PLAYERS; i++)
	{
		PMAllowed[i] = true;
	}
	#if DEBUG 1
		format(debugs,256,"DEBUG | OngameModeInit end.");
		debugLog(debugs);
	#endif
This is my server log:
Код:
SA-MP Dedicated Server
----------------------
v0.3a R7, ©2005-2010 SA-MP Team

[12:01:21] filterscripts = ""  (string)
[12:01:21] 
[12:01:21] Server Plugins
[12:01:21] --------------
[12:01:21]  Loading plugin: mysql
[12:01:21] 

  > MySQL plugin R4-2 successfully loaded.

[12:01:21]   Loaded.
[12:01:21]  Loaded 1 plugins.

[12:01:21] 
[12:01:21] Filter Scripts
[12:01:21] ---------------
[12:01:21]   Loaded 0 filter scripts.

[12:01:21] Mysql Connected
[12:01:21] tick
It does connets to the MYSQL server, but from an unknown reason it shuts the server down right when I start it.

Any ideas?

EDIT: Well, I do realized whats the problem is. I have no scriptfiles folder with my script. I mean I do have one, but without all needed files for the gamemode. The seller has never gave me the files, and he has disapeared.
Reply
#5

Server Shutting down use to be missing scriptfiles.
Reply
#6

Yeah I've realized it, but I have no clue what scriptfiles should I have. I do have the names of the files, but I don't know what should be in the files..
Reply
#7

Its the exodus script, sort of everlast. I used to have it I had the same problem, its bugged in other words.

Edit: I can't really remember maybe I managed to fix it, but I can't remember. Beside that the script is extremely uneffecient.
Reply
#8

Well, I will be really mad if I will find out that I have paid for nothing. I really want to fix these problems, but I just don't know how.

I've managed to set up all the scriptfiles folders and files, but there is another problem, again..

The gamemode still doesn't connect to the MYSQL database. It showed that it does connect, but look at the next problem:
When I ingame, it tells me to /login. Even if I'm not registered, it still tells me to login. It should tell me to go to the ucp bla bla bla.. but no. And when I try to /login, no mater whatt password I use, it drops me in the midle of nowhere, and set my stats all to 0. Same happens when I am registered. I've created an account for myself via the database editor (Nevicat for MySql), and I do have an account, but the same things happens..

This is my /login CMD:
Код:
dcmd_login(playerid, params[])
{
    if(playerinfo[playerid][login])
    {
        SendClientMessage(playerid, COLOR_RED, "Error: You are already logged in!");
        return 1;
	}
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_GREY,"USAGE: /login [password]");
        return 1;
    }
    if(playerinfo[playerid][uid]==-1)
    {
		return SendClientMessage(playerid,COLOR_GREY,"Please, register first!");
	}

	format(stringEX,MAX_STRING1,"`id`='%d'",playerinfo[playerid][uid]);
	mysql_GetStr("users","pass",stringEX);

	if(!strcmp(String,params,false))
	{
		format(stringEX,MAX_STRING1,"Welcome back %s!",playerinfo[playerid][playername]);
   		SendClientMessage(playerid,COLOR_LIGHTYELLOW,stringEX);

		LoadFromMysql(playerid);
      	playerinfo[playerid][login]=4*60;
		playerinfo[playerid][updatereduce]=30;
		getdate(yearEX,monthEX,dayEX);
		gettime(hourEX,minEX,secEX);
		format(queryEX, 256, "UPDATE `users` SET `timestamp`='%d/%d/%d - %d:%d:%d' WHERE `id`='%d' LIMIT 1;",yearEX,monthEX,dayEX,hourEX,minEX,secEX,playerinfo[playerid][uid]);
		mysql_query(queryEX);

		for(new i = 0; i < MAX_PLAYERS+1; i++)
		{
			if(IsPlayerConnected(i))
			{
	    		if(IsPlayerInAnyVehicle(i))
	    		{
					if(tints[GetPlayerVehicleID(i)])
					{
					    if(!playerinfo[playerid][admin])
					    {
		    				ShowPlayerNameTagForPlayer(playerid, i, 0);
						}
						else
						{
						    SetPlayerMarkerForPlayer(playerid, i, COLOR_BLUE);
						}
					}
				}
			}
		}

		TogglePlayerSpectating(playerid, 0);
		AntiHax[playerid][TpX] = 0;
		AntiHax[playerid][TpY] = 0;
		AntiHax[playerid][TpZ] = 0;
		SetSpawnInfo(playerid, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
		SpawnPlayer(playerid);
		AntiHax[playerid][TpX] = 0;
		AntiHax[playerid][TpY] = 0;
		AntiHax[playerid][TpZ] = 0;
		
		SetPlayerSkin(playerid,playerinfo[playerid][skin]);
		SetPlayerScore(playerid,1);
		return 1;
	}
	else
    {
		playerinfo[playerid][Try]++;
		format(stringEX,MAX_STRING1,"Wrong password (%d/3)!",playerinfo[playerid][Try]);
		SendClientMessage(playerid,COLOR_RED,stringEX);
		if(playerinfo[playerid][Try]==3)
		{
			SendClientMessage(playerid,COLOR_RED,"You have tried three times. You have been kicked from the server.");
			Kick(playerid);
		}
		return 1;
	}
}
OnPlayerConnect:
Код:
PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
   	TogglePlayerSpectating(playerid, 1);
    ResetPlayer(playerid);
    
    #if DEBUG 1
    	format(debugs,256,"DEBUG | OnPlayerConnect(%s) start.",playerinfo[playerid][playername2]);
		debugLog(debugs);
	#endif

	GiveMoney(playerid,1000);
	SetPlayerColor(playerid,COLOR_INV);
	GetPlayerIp(playerid,playerinfo[playerid][IP],15);

	new string[MAX_STRING1];
 	format(string,256,"`name`='%s'",playerinfo[playerid][playername2]);
  	mysql_GetInt("users","id", playerinfo[playerid][uid], string);

	for(new i=0;i<11;i++)
	{
		SendClientMessage(playerid,COLOR_LIGHTYELLOW," ");
	}

	if(playerinfo[playerid][uid]==-1)
	{
		GameTextForPlayer(playerid,"Register at: ~n~~y~http://www.ucp.exodus-roleplay.net",500000,5);
		SendClientMessage(playerid,COLOR_LIGHTRED,"Register at: http://www.ucp.exodus-roleplay.net");
		Kick(playerid);
	}
	else
	{
 		SendClientMessage(playerid,COLOR_WHITE,"SERVER: In order to login do /login [password]");
	}

	if(!ValidName(playerinfo[playerid][playername2]))
	{
	    format(string,MAX_STRING1,"SERVER: Format: Firstname_Lastname. Really simple, roleplay name format.");
	    SendClientMessage(playerid,COLOR_RED,string);
		Kick(playerid);
	}
	else
	{
		for(new i=0;i<strlen(playerinfo[playerid][playername]);i++)
		{
	    	if(playerinfo[playerid][playername][i]=='_')
			{
	        	playerinfo[playerid][playername][i]=' ';
			}
		}
	}

	new hour,mins,sec,day,month,year;
	gettime(hour,mins,sec);
	getdate(year,month,day);
	format(string,MAX_STRING1,"%s has joined the server (%d:%d:%d %d/%d/%d %s)",playerinfo[playerid][playername],hour,mins,sec,day,month,year,playerinfo[playerid][IP]);
	Log("inout.txt",string);
	
	PMAllowed[playerid] = true;
	
	#if DEBUG 1
		format(debugs,256,"DEBUG | OnPlayerConnect(%s) end.",playerinfo[playerid][playername2]);
		debugLog(debugs);
	#endif
	return 1;
}
Does someone knows what is the problem now?

Thank you.
Reply
#9

I recommend you talk to a member called Extremo, he was the Developer for Everlast Gaming and is a very very good scripter, PM him about the problem, I'm sure he knows how to fix it!

- Mimic
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)