Database help.
#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


Messages In This Thread
Database help. - by Cyniic - 08.05.2012, 20:42
Re: Database help. - by Cyniic - 10.05.2012, 15:19
Re: Database help. - by Elysian` - 10.05.2012, 15:35
Re: Database help. - by Cyniic - 10.05.2012, 17:01

Forum Jump:


Users browsing this thread: 2 Guest(s)