SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 08/05/2012, 08:42 PM   #1
Cyniic
Little Clucker
 
Join Date: Oct 2011
Posts: 4
Reputation: 0
Default Database help.

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.
Cyniic is offline   Reply With Quote
Old 10/05/2012, 03:19 PM   #2
Cyniic
Little Clucker
 
Join Date: Oct 2011
Posts: 4
Reputation: 0
Default Re: Database help.

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.
Cyniic is offline   Reply With Quote
Old 10/05/2012, 03:35 PM   #3
Elysian`
Banned
 
Join Date: Apr 2012
Location: Locating...
Posts: 437
Reputation: 35
Default Re: Database help.

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

We cannot help you if you do not show us any.
Elysian` is offline   Reply With Quote
Old 10/05/2012, 05:01 PM   #4
Cyniic
Little Clucker
 
Join Date: Oct 2011
Posts: 4
Reputation: 0
Default Re: Database help.

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.
Cyniic is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database ID Incognation Help Archive 7 03/05/2011 01:54 PM
MySQL Database Scotto Server Support 4 01/05/2011 09:11 PM
help database/php iJumbo Help Archive 3 06/09/2010 01:36 PM
Creating A Database Falcon Interceptor Everything and Nothing 13 16/07/2010 05:21 AM
DataBase Sascha Help Archive 0 29/04/2010 05:02 PM


All times are GMT. The time now is 12:12 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.