SA-MP Forums Archive
Problem CreateVehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem CreateVehicle (/showthread.php?tid=595042)



Problem CreateVehicle - Opeal - 27.11.2015

I have code like this.

Код:
enum vInfo
{
	vOwner[24],
	vModel,
	vId,
	Float:vPosX,
        Float:vPosY,
        Float:vPosZ,
        Float:vPosA,
}
new VehicleInfo		[MAX_PLAYERS][vInfo];
new OwnedVehicle       [MAX_VEHICLES];
Код:
stock LoadVehicleData(playerid)
{
    new savingstring[20];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    format(query, sizeof(query), "SELECT * FROM `vehicles` WHERE `owner` = '%s'", pName);
    mysql_query(query);
    mysql_store_result();
    while(mysql_fetch_row_format(query,"|"))
    {
		mysql_fetch_field_row(VehicleInfo[playerid][vOwner], "owner");
		mysql_fetch_field_row(savingstring, "vid"); VehicleInfo[playerid][vId] = strval(savingstring);
		mysql_fetch_field_row(savingstring, "model"); VehicleInfo[playerid][vModel] = strval(savingstring);
		mysql_fetch_field_row(savingstring, "posx"); VehicleInfo[playerid][vPosX] = strval(savingstring);
		mysql_fetch_field_row(savingstring, "posy"); VehicleInfo[playerid][vPosY] = strval(savingstring);
		mysql_fetch_field_row(savingstring, "posz"); VehicleInfo[playerid][vPosZ] = strval(savingstring);
		mysql_fetch_field_row(savingstring, "posa"); VehicleInfo[playerid][vPosA] = strval(savingstring);
	}
	mysql_free_result();
	OwnedVehicle[playerid] = CreateVehicle(VehicleInfo[playerid][vModel],VehicleInfo[playerid][vPosX],VehicleInfo[playerid][vPosY],VehicleInfo[playerid][vPosZ],VehicleInfo[playerid][vPosA],-1,-1,300);
	return 1;
}
and i have 3 rows in my database, but only one of last entry that can CreateVehicle.
Any one can help me?
Please ...


Re: Problem CreateVehicle - iKarim - 27.11.2015

outdated MySQL plugin / include, update to latest MySQL plugin, and I will help you.


Re: Problem CreateVehicle - Opeal - 27.11.2015

Quote:
Originally Posted by PawnHunter
Посмотреть сообщение
outdated MySQL plugin / include, update to latest MySQL plugin, and I will help you.
before, I've tried to update mysql plugin to R39, but my mysql_log are very large by itself. So i downgrade again to R5


Re: Problem CreateVehicle - J0sh... - 27.11.2015

You know you can delete that log, right?
And you can make it so it only shows the errors...


Re: Problem CreateVehicle - Opeal - 27.11.2015

Quote:
Originally Posted by Jamester
Посмотреть сообщение
You know you can delete that log, right?
And you can make it so it only shows the errors...
OK, i will try ..
Wait ...