SA-MP Forums Archive
Problem with vehicles - 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: Problem with vehicles (/showthread.php?tid=425097)



Problem with vehicles - Arpatos - 24.03.2013

Hey dudes, i've a little problem with vehicles.

In fact, when i enter in any vehicle, owned or not, i can control and drive with it.

So i wanna make that :
-If it's my vehicle nobody else than me can start the vehicle up
- If it isn't my vehicle, i can enter in the vehicle but not start it up.

Can someone help ? Here is the startup code.

Or pastebin: http://pastebin.com/jUK9e2zi

Quote:

public Startup(playerid, vehicleid)
{
new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
new newcar = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER || engineOn[vehicleid])
{
TogglePlayerControllable(playerid, false);
engineOn[GetPlayerVehicleID(playerid)] = false;
//I do nothing!
}
else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && !vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 107 && newcar != 108 && newcar != 109 && newcar != 110 && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar))
{
engineOn[GetPlayerVehicleID(playerid)] = false;
if(voiturepaslui[playerid] == 1)
{
TogglePlayerControllable(playerid, false);
vehicleEntered[playerid][vehicleid] = false;
engineOn[GetPlayerVehicleID(playerid)] = false;
}
if(CarInfo[vehicleid][cOwned]==0 && IsAnOwnableCar(vehicleid))
{
TogglePlayerControllable(playerid, false);
engineOn[GetPlayerVehicleID(playerid)] = false;
}
else
{
SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Faites /contact pour dйmarrer le vйhicule, /sortir ou F pour sortir, /fermer pour fermer ton vйhicule.");
TogglePlayerControllable(playerid, 0);
vehicleEntered[playerid][vehicleid] = false;
}
}
else if(IsPlayerInAnyVehicle(playerid) && !engineOn[vehicleid] && vehicleEntered[playerid][vehicleid] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && pveh != 510 && pveh != 462 && newcar != 107 && newcar != 108 && newcar != 109 && newcar != 110 && !IsAHarvest(newcar) && !IsADrugHarvest(newcar) && !IsASweeper(newcar))
{
if(voiturepaslui[playerid] == 0)
{
TogglePlayerControllable(playerid, true);
}
if(CarInfo[vehicleid][cOwned]==1 && IsAnOwnableCar(vehicleid))
{
}
else
{
SendClientMessage(playerid, COLOR_LIGHT_BLUE, "Faites /contact pour dйmarrer le vйhicule, /sortir ou F pour sortir, /fermer pour fermer ton vйhicule.");
TogglePlayerControllable(playerid, 0);

}
}
}




Re : Problem with vehicles - Arpatos - 24.03.2013

up help please


Re : Problem with vehicles - Arpatos - 24.03.2013

nobody can ..?


Re: Problem with vehicles - SiDiCeR - 24.03.2013

Wait 24 fucking hours before Triple Bumping..


Re : Problem with vehicles - Arpatos - 25.03.2013

up please


Re: Problem with vehicles - Mando - 25.03.2013

Eyo'
Dont think we will help you with that Spam shit'


Re: Problem with vehicles - LilBob - 25.03.2013

Lol, i just upped the toppic twice, it was at page 3 each time