GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: Rupert - 2012. augusztus 26. - 14:53:54

Cím: Kocsi mentés hiba (mysql)
Írta: Rupert - 2012. augusztus 26. - 14:53:54
Sziasztok..
Nagyon ritkán fordulok ide, most viszont rákényszerültem...
A jármûrendszeremben képtelen vagyok elmenteni az adatokat, mégpedig így:
 

if(VehicleInfo[vehicleid][owner] == regid)
{
        new Float:Pos[4];
GetVehiclePos(vehicleid,Pos[0],Pos[1],Pos[2]);
GetVehicleZAngle(vehicleid,Pos[3]);
VehicleInfo[vehicleid][spawnx] = Pos[0];
VehicleInfo[vehicleid][spawny] = Pos[1];
VehicleInfo[vehicleid][spawnz] = Pos[2];
VehicleInfo[vehicleid][angle] = Pos[3];
format(query,sizeof(query),\"UPDATE `vehicles` SET x = %f, y = %f, z = %f, angle = %f, WHERE `sqlid` = %i\",Pos[0],Pos[1],Pos[2],Pos[3],VehicleInfo[vehicleid][sqlid]);
mysql_query(query);
DestroyVehicle(vehicleid);
CreateVehicle(VehicleInfo[vehicleid][model],VehicleInfo[vehicleid][spawnx],VehicleInfo[vehicleid][spawny],VehicleInfo[vehicleid][spawnz],VehicleInfo[vehicleid][angle],VehicleInfo[vehicleid][color1],VehicleInfo[vehicleid][color2],0);
}

 
Egyszerûen sehogy nem mûködik, próbáltam nem tömbbel, hanem változókkal, enumerációval, stb. Sehogy nem \"updételi\" fel az adatokat.. vélemény?
Cím: Kocsi mentés hiba (mysql)
Írta: Casamiro - 2012. augusztus 26. - 14:57:00
if(VehicleInfo[vehicleid][owner] == regid)
        {
                new Float:Pos[4];
                GetVehiclePos(vehicleid,Pos[0],Pos[1],Pos[2]);
                GetVehicleZAngle(vehicleid,Pos[3]);
                VehicleInfo[vehicleid][spawnx] = Pos[0];
                VehicleInfo[vehicleid][spawny] = Pos[1];
                VehicleInfo[vehicleid][spawnz] = Pos[2];
                VehicleInfo[vehicleid][angle] = Pos[3];
                format(query,sizeof(query),\"UPDATE `vehicles` SET `x` = \'%f\', `y` = \'%f\', `z` = \'%f\', `angle` = \'%f\', WHERE `sqlid` = \'%i\'\",Pos[0],Pos[1],Pos[2],Pos[3],VehicleInfo[vehicleid][sqlid]);
                mysql_query(query);
                DestroyVehicle(vehicleid);
                CreateVehicle(VehicleInfo[vehicleid][model],VehicleInfo[vehicleid][spawnx],VehicleInfo[vehicleid][spawny],VehicleInfo[vehicleid][spawnz],VehicleInfo[vehicleid][angle],VehicleInfo[vehicleid][color1],VehicleInfo[vehicleid][color2],0);
        }
Cím: Kocsi mentés hiba (mysql)
Írta: Rupert - 2012. augusztus 26. - 14:59:20
Kíváncsi vagyok rá.. ha mûködik megeszem az aksim.
Cím: Kocsi mentés hiba (mysql)
Írta: Casamiro - 2012. augusztus 26. - 15:02:26
Nekem emiatt nem mûködött adatfelküldés MySQL -be, bár az PHP volt, de lehet itt is az a gond.
Cím: Kocsi mentés hiba (mysql)
Írta: Rupert - 2012. augusztus 26. - 15:03:30
Nem mûködik.
Cím: Kocsi mentés hiba (mysql)
Írta: Casamiro - 2012. augusztus 26. - 15:05:10
mysql_log.txt mit ír ki?
Szerk.:
if(VehicleInfo[vehicleid][owner] == regid)
        {
                new Float:Pos[4];
                GetVehiclePos(vehicleid,Pos[0],Pos[1],Pos[2]);
                GetVehicleZAngle(vehicleid,Pos[3]);
                VehicleInfo[vehicleid][spawnx] = Pos[0];
                VehicleInfo[vehicleid][spawny] = Pos[1];
                VehicleInfo[vehicleid][spawnz] = Pos[2];
                VehicleInfo[vehicleid][angle] = Pos[3];
                format(query,sizeof(query),\"UPDATE `vehicles` SET `x` = \'%f\', `y` = \'%f\', `z` = \'%f\', `angle` = \'%f\' WHERE `sqlid` = \'%i\'\",Pos[0],Pos[1],Pos[2],Pos[3],VehicleInfo[vehicleid][sqlid]);
                mysql_query(query);
                DestroyVehicle(vehicleid);
                CreateVehicle(VehicleInfo[vehicleid][model],VehicleInfo[vehicleid][spawnx],VehicleInfo[vehicleid][spawny],VehicleInfo[vehicleid][spawnz],VehicleInfo[vehicleid][angle],VehicleInfo[vehicleid][color1],VehicleInfo[vehicleid][color2],0);
        }

Ennek mûködnie kell, az utolsó után nem kell vesszõ
Cím: Kocsi mentés hiba (mysql)
Írta: Rupert - 2012. augusztus 26. - 15:08:10
Te jó ég, 300 óra mire letölti a debug.txt-t.
Cím: Kocsi mentés hiba (mysql)
Írta: Casamiro - 2012. augusztus 26. - 15:09:50
Amit most írtam annak mûködnie kell, nézd meg azt.
Cím: Kocsi mentés hiba (mysql)
Írta: Rupert - 2012. augusztus 26. - 15:11:26
Basszus, tényleg.. az nagy hiba. Köszi, megnézem! :D
E: Nem hiszem el, tényleg jó! Két napja ezzel veszõdtem.. Köszi Casamiro, megy a +! :)
Cím: Kocsi mentés hiba (mysql)
Írta: lackos888 - 2012. augusztus 26. - 15:13:07
Idézetet írta: Casamiro date=1345986310\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"26900\" data-ipsquote-contentclass=\"forums_Topic
mysql_log.txt mit ír ki?
Szerk.:
if(VehicleInfo[vehicleid][owner] == regid)
        {
                new Float:Pos[4];
                GetVehiclePos(vehicleid,Pos[0],Pos[1],Pos[2]);
                GetVehicleZAngle(vehicleid,Pos[3]);
                VehicleInfo[vehicleid][spawnx] = Pos[0];
                VehicleInfo[vehicleid][spawny] = Pos[1];
                VehicleInfo[vehicleid][spawnz] = Pos[2];
                VehicleInfo[vehicleid][angle] = Pos[3];
                format(query,sizeof(query),\"UPDATE `vehicles` SET `x` = \'%f\', `y` = \'%f\', `z` = \'%f\', `angle` = \'%f\' WHERE `sqlid` = \'%i\'\",Pos[0],Pos[1],Pos[2],Pos[3],VehicleInfo[vehicleid][sqlid]);
                mysql_query(query);
                DestroyVehicle(vehicleid);
                CreateVehicle(VehicleInfo[vehicleid][model],VehicleInfo[vehicleid][spawnx],VehicleInfo[vehicleid][spawny],VehicleInfo[vehicleid][spawnz],VehicleInfo[vehicleid][angle],VehicleInfo[vehicleid][color1],VehicleInfo[vehicleid][color2],0);
        }

Ennek mûködnie kell, az utolsó után nem kell vesszõ
 
Én úgy tudtam csak sztringnél-nél kell \' \'.
Edit: Eseteg az sqlid nem valós a scriptben?