Help with vehicle start command - 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: Help with vehicle start command (
/showthread.php?tid=622183)
Help with vehicle start command -
FrGd - 19.11.2016
I wanted the command to work only with the owner of the vehicle
Quote:
CMD:engine(playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if (!IsEngineVehicle(vehicleid))
return SendErrorMessage(playerid, "You are not in any vehicle.");
if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
return SendErrorMessage(playerid, "You can't do this as you're not the driver.");
if (CoreVehicles[vehicleid][vehFuel] < 1)
return SendErrorMessage(playerid, "The fuel tank is empty.");
if (ReturnVehicleHealth(vehicleid) <= 300)
return SendErrorMessage(playerid, "This vehicle is totalled and can't be started.");
switch (GetEngineStatus(vehicleid))
{
case false:
{
SetEngineStatus(vehicleid, true);
ShowPlayerFooter(playerid, "You have ~g~started~w~ the engine!");
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s inserts the key into the ignition and starts the engine.", ReturnName(playerid, 0));
}
case true:
{
SetEngineStatus(vehicleid, false);
ShowPlayerFooter(playerid, "You have ~r~stopped~w~ the engine!");
SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s inserts the key into the ignition and stops the engine.", ReturnName(playerid, 0));
}
}
return 1;
}
|
Re: Help with vehicle start command -
BiosMarcel - 19.11.2016
wrong section ...
We don't know how your script works, we aren't wizards, hire a scripter but don't ask us to script for you
Re: Help with vehicle start command -
GoldenLion - 19.11.2016
It's obviously SCRP. There is a Car_IsOwner function, use it.
Re: Help with vehicle start command -
BiosMarcel - 19.11.2016
Quote:
Originally Posted by GoldenLion
It's obviously SCRP. There is a Car_IsOwner function, use it.
|
I am a 100% sure he still doesn't know how to do it

, which is why i posted my recent reply
Re: Help with vehicle start command -
FrGd - 19.11.2016
I have tried several ways to do this, I did not create the topic before searching, if you do not want to help, there is no problem, my friend.
Re: Help with vehicle start command -
BiosMarcel - 19.11.2016
Sorry, but there is a difference between asking for help and asking someone else to work for you.
If you want to be a scripter, learn it or hire a scripter.
Your 'problem' just shows your lack of interest or even the lack of the ability to understand your own script.