SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 04/11/2010, 07:59 AM   #1
The_Gangstas
Huge Clucker
 
Join Date: Nov 2010
Posts: 482
Reputation: 0
Default vehicle tune saving help

pawn Code:
public OnVehicleMod(playerid,vehicleid,componentid)
{
    if(IsBuyableCar[vehicleid])
    {
        if(strmatch(VehicleSystem[IsBuyableCar[vehicleid]][Owner],Playername(playerid)))
        {
            if(componentid == 0)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune0`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[0]]=componentid;
            }
            else if(componentid == 1)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune1`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[1]]=componentid;
            }
            else if(componentid == 2)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune2`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[2]]=componentid;
            }
            else if(componentid == 3)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune3`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[3]]=componentid;
            }
            else if(componentid == 4)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune4`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[4]]=componentid;
            }
            else if(componentid == 5)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune5`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[5]]=componentid;
            }
            else if(componentid == 6)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune6`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[6]]=componentid;
            }
            else if(componentid == 7)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune7`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[7]]=componentid;
            }
            else if(componentid == 8)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune8`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[8]]=componentid;
            }
            else if(componentid == 9)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune9`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[9]]=componentid;
            }
            else if(componentid == 10)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune10`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[10]]=componentid;
            }
            else if(componentid == 11)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune11`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[11]]=componentid;
            }
            else if(componentid == 12)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune12`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[12]]=componentid;
            }
            else if(componentid == 13)
            {
            format(GlobalQuery,sizeof(GlobalQuery),"UPDATE `Vehicles` SET `Tune13`=%d WHERE CarID = %d LIMIT 1",componentid,VehicleSystem[IsBuyableCar[vehicleid]][CarID]);
            print(GlobalQuery);
            mysql_query(GlobalQuery);
            VehicleSystem[IsBuyableCar[vehicleid]][cMod[13]]=componentid;
            }
        }
    }
    return 1;
}

doesnt work S:
The_Gangstas is offline  
 

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
[FilterScript] [FS] Tune all vehicle model types in one modshop Rafael[BR] Filterscripts 10 22/07/2011 01:39 PM
Big problem with saving vehicle ownerships!! sass839 Help Archive 0 06/03/2010 07:47 AM
Good Dini/Dudb tutorial for file saving and info saving for example score ect JoeDaDude Help Archive 2 07/02/2010 09:04 PM
Help Saving Vehicle Mods Globe2009 Help Archive 3 13/11/2009 12:21 AM
vehicle mod saving killar456 Help Archive 3 17/09/2009 07:42 PM


All times are GMT. The time now is 08:54 PM.


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