Database help.
#1

Recently, I implemented a vehicle script into a VX:RP gamemode, however when there is a GMX or samp-server.exe closes, the vehicles do not save into the database file.

If you can help, please PM me, and we'll go from there. Thanks.
Reply
#2

Is no one able to help me with this issue? I have no problem sending code through PMs. It's restricting us from doing updates as every time we do we have to refund everyone for their cars.
Reply
#3

Well show us the code and what saving system are you using?

We cannot help you if you do not show us any.
Reply
#4

Quote:
Originally Posted by Windows32
View Post
Well show us the code and what saving system are you using?

We cannot help you if you do not show us any.
Here's my SaveVehicle stock.

pawn Code:
stock SaveVehicle(sqlid)
{
    new query[1500], idx = GetVIndex(sqlid);
    format(query, sizeof(query), "UPDATE vehicles SET model = '%d' , color1 = '%d' , color2 = '%d' , groupid = '%d' , jobid = '%d' , owner = '%s' , vname = '%s', respawn = '%d', x = '%f', y = '%f', z = '%f', angle = '%f'",
    Veh[idx][Model], Veh[idx][Color1], Veh[idx][Color2], Veh[idx][Group], Veh[idx][Job], Veh[idx][Owner], Veh[idx][VName] ,Veh[idx][Respawn], Veh[idx][vX], Veh[idx][vY], Veh[idx][vZ], Veh[idx][vAngle]);
   
    format(query, sizeof(query), "%s,interior = '%d', virtualworld = '%d', plate = '%s', mod0 = '%d', mod1 = '%d', mod2 = '%d', mod3 = '%d', mod4 = '%d', mod5 = '%d', mod6 = '%d', mod7 = '%d', mod8 = '%d', mod9 = '%d'",
    query ,Veh[idx][vInt], Veh[idx][vVWorld], Veh[idx][Plate], Veh[idx][Mod0], Veh[idx][Mod1], Veh[idx][Mod2], Veh[idx][Mod3], Veh[idx][Mod4], Veh[idx][Mod5], Veh[idx][Mod6], Veh[idx][Mod7], Veh[idx][Mod8], Veh[idx][Mod9]);
   
    format(query, sizeof(query), "%s, mod10 = '%d', mod11 = '%d', mod12 = '%d', mod13 = '%d', paintjob = '%d', weapon1 = '%d', weapon2 = '%d', weapon3 = '%d', vip = '%d', lockstate = '%d', health = '%f', spawnstate = '%d', fuel = '%d'",
    query, Veh[idx][Mod10], Veh[idx][Mod11], Veh[idx][Mod12], Veh[idx][Mod13], Veh[idx][PaintJob], Veh[idx][Weapons][0], Veh[idx][Weapons][1], Veh[idx][Weapons][2], Veh[idx][VIP], Veh[idx][lockState], Veh[idx][vHealth],Veh[idx][spawnState],Veh[idx][Fuel]);
   
    format(query, sizeof(query), "%s WHERE sqlid = '%d'", query ,sqlid);

    db_query(vehicle_db, query);
    return query;
}
It's supposed to save to a local file named 'Vehicles" Which is in a database file format.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)