SA-MP Forums Archive
Saving Vehicle Modifications - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Saving Vehicle Modifications (/showthread.php?tid=409578)



Saving Vehicle Modifications - Ballu Miaa - 22.01.2013

Dear Members,

I already created a Buyable Vehicle System for my game mode. Now i created 11 Slots for vehicle mods.

Lets say: Vehicle[vehicleid][vMod1] to Vehicle[vehicleid][vMod11]

I dont want to mod the vehicle using transfender , acr wheel angels , etc. Im trying to mod vehicles using a Business now.

What i want to do is: Make a function according to players vehicle model. According to Vehicle it shows the modifications which can be attached and saved. I know there will be a lot of arrays taking part in this function.

Do i need to do this separately for every vehicle model? I mean make a list of valid mods which can be attached to the vehicle and do everything according to it.

Im really confused on how to do it. If anyone can help me ill be really glad! Please dont link me to any other thread.

Regards
Ballu Miaa



Re: Saving Vehicle Modifications - Glad2BeHere - 22.01.2013

first of let me help u by saying there are 13 ..... 1 -13 second u can create a variable to save modes like
pawn Код:
Vehicle[vehicleid][vMod][14] // 0-13
next u gonna need this https://sampwiki.blast.hk/wiki/Car_Component_ID u gonna know which is for which car .... which car can use what

and oh yeah > https://sampwiki.blast.hk/wiki/Componentslots

and i currently looking for which component goes where yet the list should help u with most :/

and also

pawn Код:
// using as an example https://sampwiki.blast.hk/wiki/AddVehicleComponent

new gTAXI;
 
public OnGameModeInit()
{
    gTAXI = AddStaticVehicle(420, -2482.4937, 2242.3936, 4.6225, 179.3656, 6, 1); // Taxi
    return 1;
}
 
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
    {
        if (GetPlayerVehicleID(playerid) == gTAXI)
        {
            AddVehicleComponent(gTAXI, 1010); // Nitro
            SendClientMessage(playerid, 0xFFFFFFAA, "Nitro added to the Taxi.");
            Vehicle[vehicleid][vMod1] = 1010;
        }
    }
    return 1;
}
//my extenstion
OnVehicleSpawn // u need to put the add components on each vehicle....
and this may help as well https://sampwiki.blast.hk/wiki/Saving_car_mods


Re: Saving Vehicle Modifications - Ballu Miaa - 23.01.2013

Some of the links and info you posted bro! That really helped me understanding it. I would try to make myself a system.


By the way tell me one thing. https://sampwiki.blast.hk/wiki/Car_Component_ID

On the above link , in front of some mods it is written "Some Transfender Cars" How to know those transfender cars. Help me make a list of components according to vehicle models bro!

Rep+8 for help!