SA-MP Forums Archive
Hello I have a question.. (about hotwire mission) - 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: Hello I have a question.. (about hotwire mission) (/showthread.php?tid=380768)



Hello I have a question.. (about hotwire mission) - Scrillex - 26.09.2012

Hello maybe someone can lead me to the point...

I want to make simple hotwire mission.. With random cars.. How can I do it?


Re: Hello I have a question.. (about hotwire mission) - West X - 26.09.2012

You can toggle the status of a vehicle's engine using SetVehicleParamsEx along with GetVehicleParamsEx.
When creating the hotwire command itself, you can use the random function along with a switch statement to simulate the user succeeding or failing.

pawn Код:
switch(random(2))
{
   case 0: // User has failed or succeeded in hot wiring. [Option 1].
   case 1: // Same situation, content would fall in accordingly. [Option 2].
}
If they succeed, toggle the status of the vehicle's engine to true. (Which would obviously turn it on). You can also use GetPlayerState to determine if they are in a vehicle and in the position of driver.

pawn Код:
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You aren't the driver of a vehicle.");



Re: Hello I have a question.. (about hotwire mission) - Scrillex - 26.09.2012

I wanted it more like onld pen:ls system.. Just what the red mark shows on minimap and you just need to pick up and deliver it to some place... After delivery you get like 10k..