[HELP] MySQL Update
#1

Hello ! I'm trying to update a server to a newer MySQL version.

The problem is, when I am trying to compile the gamemode, I get these errors :

I worked so hard on this gamemode, i fixed a lot of bugs, added new things and others, anyway.I want to make this to work, you're my last chance, please.



Error Log

C:\Users\User\Desktop\MySV\gamemodes\MyGM.pwn(840) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(9) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(15) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(19) : error 017: undefined symbol "split"
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(70) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(81) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(94) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(101) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(110) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(117) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(122) : error 017: undefined symbol "split"
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(137) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(164) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(173) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(180) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(185) : error 017: undefined symbol "split"
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(200) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(207) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(212) : error 017: undefined symbol "split"
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(276) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(293) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(300) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(309) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(31 : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(323) : error 017: undefined symbol "split"
C:\Users\User\Desktop\MySV\pawno\include\/IBP/Others/MYSQLload.pwn(360) : error 035: argument type mismatch (argument 1)

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.


There's the lines :


Код:
forward LoadGarages();
public LoadGarages()
{
    new arrCoords[15][64];
    new sql[80], row[512];
    format(sql, sizeof(sql), "SELECT COUNT(*) FROM Garages");
    mysql_query(sql);
    mysql_store_result();
    mysql_fetch_row(row);
    mysql_free_result();
    for (new idx=0; idx<MAX_GARAGES; idx++) {
        format(sql, sizeof(sql), "SELECT * FROM Garages WHERE GarageID=%d", idx);
        mysql_query(sql);
        mysql_store_result();
        if (mysql_num_rows() > 0) {
            mysql_fetch_row(row);
            split(row, arrCoords, '|');
            mysql_free_result();
            Garages[idx][EnterX] = floatstr(arrCoords[1]);
            Garages[idx][EnterY] = floatstr(arrCoords[2]);
            Garages[idx][EnterZ] = floatstr(arrCoords[3]);
            Garages[idx][ExitX] = floatstr(arrCoords[4]);
            Garages[idx][ExitY] = floatstr(arrCoords[5]);
            Garages[idx][ExitZ] = floatstr(arrCoords[6]);
            Garages[idx][EnterAngle] = floatstr(arrCoords[7]);
            Garages[idx][ExitAngle] = floatstr(arrCoords[8]);
            Garages[idx][Owned] = strval(arrCoords[9]);
            strmid(Garages[idx][Owner], arrCoords[10], 0, strlen(arrCoords[10]), 255);
            Garages[idx][Price] = strval(arrCoords[11]);
            Garages[idx][ExitInterior] = strval(arrCoords[12]);
            Garages[idx][Dynamic] = strval(arrCoords[13]);
            Garages[idx][Locked] = strval(arrCoords[14]);

            new string[128];
            if(Garages[idx][Owned] == 0)
			{
                new garagelocation[MAX_ZONE_NAME];
                GetCoords2DZone(Garages[idx][EnterX],Garages[idx][EnterY], garagelocation, MAX_ZONE_NAME);
                format(string, sizeof(string), "[Garage for Sale!]\nAdresa: %d %s\nPret: $%d",idx,garagelocation,Garages[idx][Price]);
                garagetext[idx] = Create3DTextLabel(string,0xbec339ff,Garages[idx][EnterX],Garages[idx][EnterY],Garages[idx][EnterZ],5.0,0, 0);
            } else {
                new garagelocation[MAX_ZONE_NAME];
                GetCoords2DZone(Garages[idx][EnterX],Garages[idx][EnterY], garagelocation, MAX_ZONE_NAME);
                format(string, sizeof(string), "[Garage]\nAdresa: %d %s\nOwner: %s",idx,garagelocation,Garages[idx][Owner]);
                garagetext[idx] = Create3DTextLabel(string,0xbec339ff,Garages[idx][EnterX],Garages[idx][EnterY],Garages[idx][EnterZ],5.0,0, 0);
            }
        }
    }
    mysql_free_result();
    printf("%d Garage incarcate din baza de date", MAX_GARAGES);
    return true;
}

forward SaveGarages(busid);
public SaveGarages(busid)
{
	new query[1024];
	format(query, sizeof(query), "UPDATE Garages SET EnterX=%f,EnterY=%f,EnterZ=%f,ExitX=%f,ExitY=%f,ExitZ=%f,EnterAngle=%f,ExitAngle=%f WHERE GarageID=%d",
	Garages[busid][EnterX],
	Garages[busid][EnterY],
	Garages[busid][EnterZ],
	Garages[busid][ExitX],
	Garages[busid][ExitY],
	Garages[busid][ExitZ],
	Garages[busid][EnterAngle],
	Garages[busid][ExitAngle],
	busid);
	mysql_query(query);
	//printf("Query : %s",query);

	format(query, sizeof(query), "UPDATE Garages SET Owned=%d,Owner='%s',Price=%d,Interior=%d,Dynamic=%d,Open=%d WHERE GarageID=%d",
	Garages[busid][Owned],
	Garages[busid][Owner],
	Garages[busid][Price],
	Garages[busid][ExitInterior],
	Garages[busid][Dynamic],
	Garages[busid][Locked],
	busid);
	mysql_query(query);
	//printf("Query : %s",query);
}

forward SaveFurniture(busid);
public SaveFurniture(busid)
{
	new query[1024];
	format(query, sizeof(query), "UPDATE furniture SET X=%f,Y=%f,Z=%f WHERE ID=%d",
	Furniture[busid][furnitureX],
	Furniture[busid][furnitureY],
	Furniture[busid][furnitureZ],
	busid);
	mysql_query(query);
	
	format(query, sizeof(query), "UPDATE furniture SET RX=%f,RY=%f,RZ=%f WHERE ID=%d",
	Furniture[busid][furnitureRX],
	Furniture[busid][furnitureRY],
	Furniture[busid][furnitureRZ],
	busid);
	mysql_query(query);
}

forward LoadFurniture();
public LoadFurniture()
{
	new arrCoords[28][64];
    new sql[80], row[512];
    format(sql, sizeof(sql), "SELECT COUNT(*) FROM furniture");
    mysql_query(sql);
    mysql_store_result();
    mysql_fetch_row(row);
    mysql_free_result();
	for (new idx=0; idx<5000; idx++)
	{
		format(sql, sizeof(sql), "SELECT * FROM furniture WHERE ID=%d", idx);
        mysql_query(sql);
        mysql_store_result();
		if (mysql_num_rows() > 0)
		{
            mysql_fetch_row(row);
            split(row, arrCoords, '|');
            mysql_free_result();
            Furniture[idx][furnitureHouse] = strval(arrCoords[1]);
            Furniture[idx][furnitureModel] = strval(arrCoords[2]);
            Furniture[idx][furnitureX] = floatstr(arrCoords[3]);
            Furniture[idx][furnitureY] = floatstr(arrCoords[4]);
            Furniture[idx][furnitureZ] = floatstr(arrCoords[5]);
            Furniture[idx][furnitureRX] = floatstr(arrCoords[6]);
            Furniture[idx][furnitureRY] = floatstr(arrCoords[7]);
			Furniture[idx][furnitureRZ] = floatstr(arrCoords[8]);
			Furniture[idx][furnitureInterior] = strval(arrCoords[9]);
			if (Furniture[idx][furnitureModel]!=0)
			{
				new query[1024];
				format(query, sizeof(query), "UPDATE furniture SET ID=%d WHERE ID=%d",furnitureid,idx);
				mysql_query(query);
				Furniture[furnitureid][furnitureHouse] = Furniture[idx][furnitureHouse];
				Furniture[furnitureid][furnitureModel] = Furniture[idx][furnitureModel];
				Furniture[furnitureid][furnitureX] = Furniture[idx][furnitureX];
				Furniture[furnitureid][furnitureY] = Furniture[idx][furnitureY];
				Furniture[furnitureid][furnitureZ] = Furniture[idx][furnitureZ];
				Furniture[furnitureid][furnitureRX] = Furniture[idx][furnitureRX];
				Furniture[furnitureid][furnitureRY] = Furniture[idx][furnitureRY];
				Furniture[furnitureid][furnitureRZ] = Furniture[idx][furnitureRZ];
				Furniture[furnitureid][furnitureInterior] = Furniture[idx][furnitureInterior];
				Furniture[idx][furnitureX] = 0;
				Furniture[idx][furnitureY] = 0;
				Furniture[idx][furnitureZ] = 0;
				Furniture[furnitureid][furnitureObject2]=CreateDynamicObject(Furniture[furnitureid][furnitureModel], Furniture[furnitureid][furnitureX], Furniture[furnitureid][furnitureY], Furniture[furnitureid][furnitureZ], Furniture[furnitureid][furnitureRX], Furniture[furnitureid][furnitureRY], Furniture[furnitureid][furnitureRZ], Furniture[furnitureid][furnitureHouse],Furniture[furnitureid][furnitureInterior]);
				furnitureid++;
			}
		}
	}
	mysql_free_result();
    return true;
}

forward SaveStocuri(busid);
public SaveStocuri(busid)
{
	new query[1024];
	format(query, sizeof(query), "UPDATE stocurimasini SET Stocuri=%d WHERE ID=%d",Stocuri[busid],busid);
	mysql_query(query);
}

forward LoadStocuri();
public LoadStocuri()
{
	new arrCoords[28][64];
    new sql[80], row[512];
    format(sql, sizeof(sql), "SELECT COUNT(*) FROM Houses");
    mysql_query(sql);
    mysql_store_result();
    mysql_fetch_row(row);
    mysql_free_result();
    for (new idx=400; idx<611; idx++)
	{
        format(sql, sizeof(sql), "SELECT * FROM stocurimasini WHERE ID=%d", idx);
        mysql_query(sql);
        mysql_store_result();
        if (mysql_num_rows() > 0)
		{
            mysql_fetch_row(row);
            split(row, arrCoords, '|');
            mysql_free_result();
			Stocuri[idx] = strval(arrCoords[1]);
        }
    }
    mysql_free_result();
    return true;
}

forward LoadHouses();
public LoadHouses()
{
    new arrCoords[28][64];
    new sql[80], row[512];
    format(sql, sizeof(sql), "SELECT COUNT(*) FROM Houses");
    mysql_query(sql);
    mysql_store_result();
    mysql_fetch_row(row);
    mysql_free_result();
    for (new idx=0; idx<MAX_HOUSES; idx++)
	{
        format(sql, sizeof(sql), "SELECT * FROM Houses WHERE HouseID=%d", idx);
        mysql_query(sql);
        mysql_store_result();
        if (mysql_num_rows() > 0)
		{
            mysql_fetch_row(row);
            split(row, arrCoords, '|');
            mysql_free_result();
            Houses[idx][EnterX] = floatstr(arrCoords[1]);
            Houses[idx][EnterY] = floatstr(arrCoords[2]);
            Houses[idx][EnterZ] = floatstr(arrCoords[3]);
            Houses[idx][EnterAngle] = floatstr(arrCoords[4]);
            Houses[idx][ExitX] = floatstr(arrCoords[5]);
            Houses[idx][ExitY] = floatstr(arrCoords[6]);
            Houses[idx][ExitZ] = floatstr(arrCoords[7]);
            strmid(Houses[idx][Owner], arrCoords[8], 0, strlen(arrCoords[8]), 255);
            Houses[idx][Owned] = strval(arrCoords[9]);
            Houses[idx][HousePrice] = strval(arrCoords[10]);
            Houses[idx][ExitInterior] = strval(arrCoords[11]);
            Houses[idx][hGun1] = strval(arrCoords[12]);
            Houses[idx][hGunAmmo1] = strval(arrCoords[13]);
            Houses[idx][hGun2] = strval(arrCoords[14]);
            Houses[idx][hGunAmmo2] = strval(arrCoords[15]);
            Houses[idx][hGun3] = strval(arrCoords[16]);
            Houses[idx][hGunAmmo3] = strval(arrCoords[17]);
            Houses[idx][Money] = strval(arrCoords[18]);
            Houses[idx][Rentable] = strval(arrCoords[19]);
            Houses[idx][RentCost] = strval(arrCoords[20]);
            Houses[idx][PickupID] = strval(arrCoords[21]);
            Houses[idx][hFridge] = strval(arrCoords[22]);
            Houses[idx][hBox] = strval(arrCoords[23]);
            Houses[idx][Drugs] = strval(arrCoords[24]);
            Houses[idx][Dynamic] = strval(arrCoords[25]);
            Houses[idx][Materials] = strval(arrCoords[26]);
            Houses[idx][Locked] = strval(arrCoords[27]);
            //Houses[idx][PickupID] = CreateDynamicCP(Houses[idx][EnterX], Houses[idx][EnterY], Houses[idx][EnterZ], 2.5, -1, -1, -1, 1.2);
            new string[128];
            if(Houses[idx][Owned] == 0)
			{
                new houselocation[MAX_ZONE_NAME];
                GetCoords2DZone(Houses[idx][EnterX],Houses[idx][EnterY], houselocation, MAX_ZONE_NAME);
                format(string, sizeof(string), "[Casa de vanzare]\nAdresa: %d %s\nPret: %d$",idx,houselocation,Houses[idx][HousePrice]);
                housetext2[idx] = Create3DTextLabel(string,COLOR_BLACK,Houses[idx][EnterX],Houses[idx][EnterY],Houses[idx][EnterZ],5.0,0, 0);
                format(string, sizeof(string), "[Casa de vanzare]\nAdresa: %d %s\nPret: %d$",idx,houselocation,Houses[idx][HousePrice]);
                housetext[idx] = Create3DTextLabel(string,0xbec339ff,Houses[idx][EnterX],Houses[idx][EnterY],Houses[idx][EnterZ],5.0,0, 0);
            }
        }
    }
    mysql_free_result();
    printf("%d Case incarcate din baza de date", MAX_HOUSES);
    return true;
}

forward SaveHouses(busid);
public SaveHouses(busid)
{
	new query[1024];
	format(query, sizeof(query), "UPDATE Houses SET EnterX=%f,EnterY=%f,EnterZ=%f,ExitX=%f,ExitY=%f,ExitZ=%f,EnterAngle=%f,Owned=%d,Owner='%s',Price=%d,Interior=%d WHERE HouseID=%d",
	Houses[busid][EnterX],
	Houses[busid][EnterY],
	Houses[busid][EnterZ],
	Houses[busid][ExitX],
	Houses[busid][ExitY],
	Houses[busid][ExitZ],
	Houses[busid][EnterAngle],
	Houses[busid][Owned],
	Houses[busid][Owner],
	Houses[busid][HousePrice],
	Houses[busid][ExitInterior],
	busid);
	mysql_query(query);

	format(query, sizeof(query), "UPDATE Houses SET Gun1=%d,Gun1a=%d,Gun2=%d,Gun2a=%d,Gun3=%d,Gun3a=%d,Money=%d,Rentable=%d,RentCost=%d,PickupID=%d,Seeds=%d,Dynamic=%d,Mats=%d WHERE HouseID=%d",
	Houses[busid][hGun1],
	Houses[busid][hGunAmmo1],
	Houses[busid][hGun2],
	Houses[busid][hGunAmmo2],
	Houses[busid][hGun3],
	Houses[busid][hGunAmmo3],
	Houses[busid][Money],
	Houses[busid][Rentable],
	Houses[busid][RentCost],
	Houses[busid][PickupID],
	Houses[busid][Drugs],
	Houses[busid][Dynamic],
	Houses[busid][Materials],
	busid);
	mysql_query(query);

	format(query, sizeof(query), "UPDATE Houses SET Fridge=%d,Stash=%d,Open=%d WHERE HouseID=%d",
	Houses[busid][hFridge],
	Houses[busid][hBox],
	Houses[busid][Locked],
	busid);
	mysql_query(query);
}

forward LoadBuilding();
public LoadBuilding()
{
	new arrCoords[10][64];
	new sql[80], row[512];
	format(sql, sizeof(sql), "SELECT COUNT(*) FROM Buildings");
	mysql_query(sql);
	mysql_store_result();
	mysql_fetch_row(row);
	totalbuildings = 13;
	mysql_free_result();

	for (new idx=0; idx<totalbuildings; idx++)
	{
	    format(sql, sizeof(sql), "SELECT * FROM Buildings WHERE BuildingID=%d", idx);
	    mysql_query(sql);
	    mysql_store_result();
	    if (mysql_num_rows() > 0)
		{
	        mysql_fetch_row(row);
			split(row, arrCoords, '|');
			mysql_free_result();
			Building[idx][EnterX] = floatstr(arrCoords[1]);
			Building[idx][EnterY] = floatstr(arrCoords[2]);
			Building[idx][EnterZ] = floatstr(arrCoords[3]);
			Building[idx][ExitX] = floatstr(arrCoords[4]);
			Building[idx][ExitY] = floatstr(arrCoords[5]);
			Building[idx][ExitZ] = floatstr(arrCoords[6]);
			strmid(Building[idx][BuildingName], arrCoords[7], 0, strlen(arrCoords[7]), 255);
			Building[idx][ExitInterior] = strval(arrCoords[8]);
			Building[idx][Custom] = strval(arrCoords[9]);

			//Building[idx][PickupID] = CreateStreamPickup(1239, 1, Building[idx][EnterX], Building[idx][EnterY], Building[idx][EnterZ],15);
			CreateDynamicPickup(1239, 1, Building[idx][EnterX], Building[idx][EnterY], Building[idx][EnterZ], -1, -1, -1, 40.0);
		}
	}
	mysql_free_result();
	printf("%d Cladiri incarcate din baza de date", totalbuildings);
	return true;
}

forward SaveBuilding(busid);
public SaveBuilding(busid)
{
	new query[1024];
	format(query, sizeof(query), "UPDATE Buildings SET EnterX=%f,EnterY=%f,EnterZ=%f,ExitX=%f,ExitY=%f,ExitZ=%f,Name='%s',Interior=%d,Custom=%d WHERE BuildingID=%d",
	Building[busid][EnterX],
	Building[busid][EnterY],
	Building[busid][EnterZ],
	Building[busid][ExitX],
	Building[busid][ExitY],
	Building[busid][ExitZ],
	Building[busid][BuildingName],
	Building[busid][ExitInterior],
	Building[busid][Custom],
	busid);
	//printf(" SQL: %s",query);
	mysql_query(query);
}

forward LoadBusiness();
public LoadBusiness()
{
	new arrCoords[19][64];
	new sql[80], row[512];
	format(sql, sizeof(sql), "SELECT COUNT(*) FROM Businesses");
	mysql_query(sql);
	mysql_store_result();
	mysql_fetch_row(row);
	totalbusinesses = 250;
	mysql_free_result();

	for (new idx=0; idx<totalbusinesses; idx++)
	{
	    format(sql, sizeof(sql), "SELECT * FROM Businesses WHERE BusinessID=%d", idx);
	    mysql_query(sql);
	    mysql_store_result();
	    if (mysql_num_rows() > 0)
		{
	        mysql_fetch_row(row);
			split(row, arrCoords, '|');
			mysql_free_result();
			Businesses[idx][EnterX] = floatstr(arrCoords[1]);
			Businesses[idx][EnterY] = floatstr(arrCoords[2]);
			Businesses[idx][EnterZ] = floatstr(arrCoords[3]);
			Businesses[idx][PickupID] = strval(arrCoords[4]);
			Businesses[idx][ExitX] = floatstr(arrCoords[5]);
			Businesses[idx][ExitY] = floatstr(arrCoords[6]);
			Businesses[idx][ExitZ] = floatstr(arrCoords[7]);
			strmid(Businesses[idx][Owner], arrCoords[8], 0, strlen(arrCoords[8]), 255);
			Businesses[idx][ExitInterior] = strval(arrCoords[9]);
			Businesses[idx][Custom] = strval(arrCoords[10]);
			Businesses[idx][BizPrice] = strval(arrCoords[11]);
			Businesses[idx][Owned] = strval(arrCoords[12]);
			strmid(Businesses[idx][BusinessName], arrCoords[13], 0, strlen(arrCoords[13]), 255);
			Businesses[idx][BizType] = strval(arrCoords[14]);
			Businesses[idx][Products] = strval(arrCoords[15]);
			Businesses[idx][Till] = strval(arrCoords[16]);
			Businesses[idx][EntranceCost] = strval(arrCoords[17]);
			Businesses[idx][Locked] = strval(arrCoords[18]);

			if(Businesses[idx][BizPrice] != 0)
			{
				if(Businesses[idx][Owned] == 0)
				{ Businesses[idx][PickupID] = CreateDynamicPickup(1274, 1, Businesses[idx][EnterX], Businesses[idx][EnterY], Businesses[idx][EnterZ], -1, -1, -1, 35.0); }
				else if(Businesses[idx][Owned] == 1)
				{ Businesses[idx][PickupID] = CreateDynamicPickup(1274, 1, Businesses[idx][EnterX], Businesses[idx][EnterY], Businesses[idx][EnterZ], -1, -1, -1, 35.0); }
			}
		}
	}
 	mysql_free_result();
	printf("%d Afaceri incarcate din baza de date", totalbusinesses);
	return true;
}

forward SaveBusinesses(busid);
public SaveBusinesses(busid)
{
	new query[1024];
	format(query, sizeof(query), "UPDATE Businesses SET EnterX=%f,EnterY=%f,EnterZ=%f,ExitX=%f,ExitY=%f,ExitZ=%f,Owner='%s',Interior=%d,Custom=%d,Price=%d,BizName='%s',BizType=%d,Products=%d,Till=%d,EntPrice=%d,Locked=%d WHERE BusinessID=%d",
	Businesses[busid][EnterX],
	Businesses[busid][EnterY],
	Businesses[busid][EnterZ],
	Businesses[busid][ExitX],
	Businesses[busid][ExitY],
	Businesses[busid][ExitZ],
	Businesses[busid][Owner],
	Businesses[busid][ExitInterior],
	Businesses[busid][Custom],
	Businesses[busid][BizPrice],
	Businesses[busid][BusinessName],
	Businesses[busid][BizType],
	Businesses[busid][Products],
	Businesses[busid][Till],
	Businesses[busid][EntranceCost],
	Businesses[busid][Locked],
	busid);
	//printf(" SQL: %s",query);
	mysql_query(query);

	format(query, sizeof(query), "UPDATE Businesses SET PickupID=%d,Owned=%d WHERE BusinessID=%d",
	Businesses[busid][PickupID],
	Businesses[busid][Owned],
	busid);
	//printf(" SQL: %s",query);
	mysql_query(query);
}

forward LoadStores();
public LoadStores()
{
	new arrCoords[16][64];
	new sql[80], row[512];
	format(sql, sizeof(sql), "SELECT COUNT(*) FROM Stores");
	mysql_query(sql);
	mysql_store_result();
	mysql_fetch_row(row);
	totalstores = 2;
	mysql_free_result();

	for (new idx=0; idx<totalstores; idx++)
	{
	    format(sql, sizeof(sql), "SELECT * FROM Stores WHERE StoreID=%d", idx);
	    mysql_query(sql);
	    mysql_store_result();
	    if (mysql_num_rows() > 0)
		{
	        mysql_fetch_row(row);
			split(row, arrCoords, '|');
			mysql_free_result();
			FactionStore[idx][EnterX] = floatstr(arrCoords[1]);
			FactionStore[idx][EnterY] = floatstr(arrCoords[2]);
			FactionStore[idx][EnterZ] = floatstr(arrCoords[3]);
			FactionStore[idx][PickupID] = strval(arrCoords[4]);
			FactionStore[idx][ExitX] = floatstr(arrCoords[5]);
			FactionStore[idx][ExitY] = floatstr(arrCoords[6]);
			FactionStore[idx][ExitZ] = floatstr(arrCoords[7]);
			strmid(FactionStore[idx][Owner], arrCoords[8], 0, strlen(arrCoords[8]), 255);
			FactionStore[idx][EnterInterior] = strval(arrCoords[9]);
			FactionStore[idx][Price] = strval(arrCoords[10]);
			FactionStore[idx][Owned] = strval(arrCoords[11]);
			strmid(FactionStore[idx][StoreName], arrCoords[12], 0, strlen(arrCoords[12]), 255);
			FactionStore[idx][Products] = strval(arrCoords[13]);
			FactionStore[idx][Till] = strval(arrCoords[14]);
			FactionStore[idx][Locked] = strval(arrCoords[15]);


			if(FactionStore[idx][Price] != 0)
			{
				if(FactionStore[idx][Owned] == 0)
				{
					FactionStore[idx][PickupID] = CreateDynamicPickup(1274, 1, FactionStore[idx][EnterX], FactionStore[idx][EnterY], FactionStore[idx][EnterZ], -1, -1, -1, 15.0);
				}
				else if(FactionStore[idx][Owned] == 1)
				{
				    FactionStore[idx][PickupID] = CreateDynamicPickup(1274, 1, FactionStore[idx][EnterX], FactionStore[idx][EnterY], FactionStore[idx][EnterZ], -1, -1, -1, 15.0);
				}
			}
		}
	}
	mysql_free_result();
	printf("%d Magazine incarcate din baza de date", totalstores);
	return true;
}

forward SaveStores(busid);
public SaveStores(busid)
{
	new query[1024];
	format(query, sizeof(query), "UPDATE Stores SET EnterX=%f,EnterY=%f,EnterZ=%f,ExitX=%f,ExitY=%f,ExitZ=%f,Owner='%s' WHERE StoreID=%d",
	FactionStore[busid][EnterX],
	FactionStore[busid][EnterY],
	FactionStore[busid][EnterZ],
	FactionStore[busid][ExitX],
	FactionStore[busid][ExitY],
	FactionStore[busid][ExitZ],
	FactionStore[busid][Owner],
	busid);
	//printf(" SQL: %s",query);
	mysql_query(query);

	format(query, sizeof(query), "UPDATE Stores SET PickupID=%d,Owned=%d WHERE BusinessID=%d",
	FactionStore[busid][PickupID],
	FactionStore[busid][Owned],
	busid);
	//printf(" SQL: %s",query);
	mysql_query(query);
}

forward LoadFactions();
public LoadFactions()
{
	new arrCoords[30][64];
	new sql[80], row[512];
	format(sql, sizeof(sql), "SELECT * FROM Factions");
	mysql_query(sql);
	mysql_store_result();
	mysql_fetch_row(row);
	totalfactions = 18;
	mysql_free_result();

	for (new idx=0; idx<totalfactions; idx++)
	{
	    format(sql, sizeof(sql), "SELECT * FROM Factions WHERE FactionID=%d", idx);
	    mysql_query(sql);
	    mysql_store_result();
	    if (mysql_num_rows() > 0)
		{
	        mysql_fetch_row(row);
			split(row, arrCoords, '|');
			mysql_free_result();
			DynamicFactions[idx][fX] = floatstr(arrCoords[1]);
			DynamicFactions[idx][fY] = floatstr(arrCoords[2]);
			DynamicFactions[idx][fZ] = floatstr(arrCoords[3]);
			DynamicFactions[idx][fType] = strval(arrCoords[4]);
			DynamicFactions[idx][fJoinRank] = strval(arrCoords[5]);
			DynamicFactions[idx][fRankAmount] = strval(arrCoords[6]);
			DynamicFactions[idx][fBank] = strval(arrCoords[7]);
			strmid(DynamicFactions[idx][fName], arrCoords[8], 0, strlen(arrCoords[8]), 255);
			strmid(DynamicFactions[idx][fRank1], arrCoords[9], 0, strlen(arrCoords[9]), 255);
			strmid(DynamicFactions[idx][fRank2], arrCoords[10], 0, strlen(arrCoords[10]), 255);
			strmid(DynamicFactions[idx][fRank3], arrCoords[11], 0, strlen(arrCoords[11]), 255);
			strmid(DynamicFactions[idx][fRank4], arrCoords[12], 0, strlen(arrCoords[12]), 255);
			strmid(DynamicFactions[idx][fRank5], arrCoords[13], 0, strlen(arrCoords[13]), 255);
			strmid(DynamicFactions[idx][fRank6], arrCoords[14], 0, strlen(arrCoords[14]), 255);
			strmid(DynamicFactions[idx][fRank7], arrCoords[15], 0, strlen(arrCoords[15]), 255);
			strmid(DynamicFactions[idx][fRank8], arrCoords[16], 0, strlen(arrCoords[16]), 255);
			strmid(DynamicFactions[idx][fRank9], arrCoords[17], 0, strlen(arrCoords[17]), 255);
			strmid(DynamicFactions[idx][fRank10], arrCoords[18], 0, strlen(arrCoords[18]), 255);
			strmid(DynamicFactions[idx][fRank11], arrCoords[19], 0, strlen(arrCoords[19]), 255);
			strmid(DynamicFactions[idx][fRank12], arrCoords[20], 0, strlen(arrCoords[20]), 255);
			strmid(DynamicFactions[idx][fRank13], arrCoords[21], 0, strlen(arrCoords[21]), 255);
			strmid(DynamicFactions[idx][fRank14], arrCoords[22], 0, strlen(arrCoords[22]), 255);
			strmid(DynamicFactions[idx][fRank15], arrCoords[23], 0, strlen(arrCoords[23]), 255);
			strmid(DynamicFactions[idx][fRank16], arrCoords[24], 0, strlen(arrCoords[24]), 255);
			strmid(DynamicFactions[idx][fRank17], arrCoords[25], 0, strlen(arrCoords[25]), 255);
			strmid(DynamicFactions[idx][fRank18], arrCoords[26], 0, strlen(arrCoords[26]), 255);
			strmid(DynamicFactions[idx][fRank19], arrCoords[27], 0, strlen(arrCoords[27]), 255);
			strmid(DynamicFactions[idx][fRank20], arrCoords[28], 0, strlen(arrCoords[28]), 255);
		}
	}
	mysql_free_result();
	printf("%d Factiuni incarcate din baza de date", totalfactions);
	return true;
}

forward SaveFactions(busid);
public SaveFactions(busid)
{
	new query[1024];
	printf("Saving Faction %d.",busid);
	format(query, sizeof(query), "UPDATE Factions SET fX=%f,fY=%f,fZ=%f,fName='%s',fBank=%d WHERE FactionID=%d",
	DynamicFactions[busid][fX],
	DynamicFactions[busid][fY],
	DynamicFactions[busid][fZ],
	DynamicFactions[busid][fName],
	DynamicFactions[busid][fBank],
	busid);
	mysql_query(query);

	format(query, sizeof(query), "UPDATE Factions SET fRankAmount=%d,fType=%d,fJoinRank=%d,fRank1='%s',fRank2='%s',fRank3='%s' WHERE FactionID=%d",
	DynamicFactions[busid][fRankAmount],
	DynamicFactions[busid][fType],
	DynamicFactions[busid][fJoinRank],
	DynamicFactions[busid][fRank1],
	DynamicFactions[busid][fRank2],
	DynamicFactions[busid][fRank3],
	busid);
	mysql_query(query);

	format(query, sizeof(query), "UPDATE Factions SET fRank4='%s',fRank5='%s',fRank6='%s',fRank7='%s',fRank8='%s',fRank9='%s',fRank10='%s' WHERE FactionID=%d",
	DynamicFactions[busid][fRank4],
	DynamicFactions[busid][fRank5],
	DynamicFactions[busid][fRank6],
	DynamicFactions[busid][fRank7],
	DynamicFactions[busid][fRank8],
	DynamicFactions[busid][fRank9],
	DynamicFactions[busid][fRank10],
	busid);
	mysql_query(query);

	format(query, sizeof(query), "UPDATE Factions SET fRank11='%s',fRank12='%s',fRank13='%s',fRank14='%s',fRank15='%s' WHERE FactionID=%d",
	DynamicFactions[busid][fRank11],
	DynamicFactions[busid][fRank12],
	DynamicFactions[busid][fRank13],
	DynamicFactions[busid][fRank14],
	DynamicFactions[busid][fRank15],
	busid);
	mysql_query(query);

	format(query, sizeof(query), "UPDATE Factions SET fRank16='%s',fRank17='%s',fRank18='%s',fRank19='%s',fRank20='%s' WHERE FactionID=%d",
	DynamicFactions[busid][fRank16],
	DynamicFactions[busid][fRank17],
	DynamicFactions[busid][fRank18],
	DynamicFactions[busid][fRank19],
	DynamicFactions[busid][fRank20],
	busid);
	mysql_query(query);
}
Reply
#2

You can't just replace the plugin and hope everything still functions. Major overhauls include R7, R33 and R40, Meaning you can't just go from R6 straight to R40 or even from R6 to R7 without rewriting the entire script.
Reply
#3

Rewriting just the mysql part, right?

And how can I rewrite it? Where can I find the new functions to rewrite?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)