SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 09/06/2014, 11:20 AM   #1
Luca12
Banned
 
Join Date: Jul 2010
Posts: 1,018
Reputation: 6
Default [HELP] tune vehicle

Hello when I go to tuning garage in sf and tune my sultan then I go to LS and in some place I type /savetune and know all tune is saved like rear bumper front bumper spoiler hydraulics and I have set paintjob 1 and I was type /savetune paintjob and paintjob is 1 and when I park my car that paintjob was not stay it was black color of car but it should be paintjob 1 if you know what I mean? Thanks
Luca12 is offline   Reply With Quote
Old 09/06/2014, 12:22 PM   #2
RenovanZ
Gangsta
 
RenovanZ's Avatar
 
Join Date: Jul 2012
Location: Jogjakarta, Indonesia
Posts: 597
Reputation: 32
Default Re: [HELP] tune vehicle

Show you park command, and save tune command.
__________________
__________________________________________________
My Work(s)
__________________________________________________

RenovanZ is offline   Reply With Quote
Old 09/06/2014, 12:26 PM   #3
Luca12
Banned
 
Join Date: Jul 2010
Posts: 1,018
Reputation: 6
Default Re: [HELP] tune vehicle

so basically everything work's fine except paintjob and I don't saving tune in park I saving it comand /savetune and all of that is saved to a vehicle data in mysql.

edit: so the problem is when is car spawned all of tuning are stay like rear bumper hydraulics etc.. but paintjob ddoens't stay instead of paintjob color of vehicle is set


pawn Code:
CMD:savetune(playerid,params[])
{
    new a = PlayerInfo[playerid][vehicle],id;
    if(sscanf(params,"i",id)) return SCM(playerid,COLOR_GRAD2,"{FFAF00}Koristite: {FFFFFF}/savetune [Paintjob (0,1,2)]");
    if(id < 0 || id > 2) return SCM(playerid,COLOR_GRAD2,"{F81414}[Greska!] {C3C3C3}Pogresan ID Paintjoba!");
    new komponenta1 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_SPOILER);
    new komponenta2 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_HOOD);
    new komponenta3 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_ROOF);
    new komponenta4 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_SIDESKIRT);
    new komponenta5 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_LAMPS);
    new komponenta6 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_NITRO);
    new komponenta7 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_EXHAUST);
    new komponenta8 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_WHEELS);
    new komponenta9 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_HYDRAULICS);
    new komponenta10 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_FRONT_BUMPER);
    new komponenta11 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_REAR_BUMPER);
    new komponenta12 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_VENT_RIGHT);
    new komponenta13 = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),CARMODTYPE_VENT_LEFT);
    VInfo[a][vKomponenta1] = komponenta1;
    VInfo[a][vKomponenta2] = komponenta2;
    VInfo[a][vKomponenta3] = komponenta3;
    VInfo[a][vKomponenta4] = komponenta4;
    VInfo[a][vKomponenta5] = komponenta5;
    VInfo[a][vKomponenta6] = komponenta6;
    VInfo[a][vKomponenta7] = komponenta7;
    VInfo[a][vKomponenta8] = komponenta8;
    VInfo[a][vKomponenta9] = komponenta9;
    VInfo[a][vKomponenta10] = komponenta10;
    VInfo[a][vKomponenta11] = komponenta11;
    VInfo[a][vKomponenta12] = komponenta12;
    VInfo[a][vKomponenta13] = komponenta13;
    VInfo[a][vPaintJob] = id; here I save from sscanf id of paintjob
    new query[800];
    mysql_format(mysql,query,800,"UPDATE `vehicles` SET `Paintjob` = '%d',`Komponenta1` = '%d',`Komponenta2` = '%d',`Komponenta3` = '%d',`Komponenta4` = '%d',`Komponenta5` = '%d'",id,komponenta1,komponenta2,komponenta3,komponenta4,komponenta5);
    mysql_tquery(mysql,query,"","");
    mysql_format(mysql,query,800,"UPDATE `vozila` SET `Komponenta6` = '%d',`Komponenta7` = '%d',`Komponenta8` = '%d',`Komponenta9` = '%d',`Komponenta10` = '%d',`Komponenta11` = '%d',`Komponenta12` = '%d',`Komponenta13` = '%d' WHERE `VoziloID` = '%d'",komponenta6,komponenta7,komponenta8,komponenta9,komponenta10,komponenta11,komponenta12,komponenta13,VInfo[a][VoziloID]);
    mysql_tquery(mysql,query,"","");
    return 1;
}

Last edited by Luca12; 09/06/2014 at 02:18 PM.
Luca12 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
Can someone make tutorial how to make vehicle tune saving system ? barts Scripting Help 3 09/01/2014 11:40 AM
Car tune scottygraham1990 Scripting Help 2 02/10/2012 09:40 PM
[FilterScript] [FS] Tune all vehicle model types in one modshop Rafael[BR] Filterscripts 10 22/07/2011 01:39 PM
vehicle tune saving help The_Gangstas Help Archive 0 04/11/2010 07:59 AM
/tune iLcke Help Archive 4 24/06/2010 12:27 PM


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


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