[HowTo] Making a working Cruise control
#5

Quote:
Originally Posted by sean5874
I remade an piece by using your advice, if im in a car, and that car dont move, everything is fine. The car dont go in cruise control, cuz the speed is 0. But when i go for a trip, and i do /cc (my cruise control command) the whole server crashes! Below you see my piece of script:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/cc", cmdtext, true, 10) == 0)
	{
		new Float:vX, vY, vZ;
		GetVehicleVelocity(GetPlayerVehicleID(playerid), vX, vY, vZ);
             SetVehicleVelocity(GetPlayerVehicleID(playerid), vX, vY, 0.0); // im not using vZ
		SendClientMessage(playerid, COLOR_RED,"CRUISE CONTROL: Cc is on, use key S to turn it off.");
		return 1;
	}
	return 0;
}
Someone know whats wrong?
You need to reapply the velocity in timer. Also leave the vZ as it is, don't zero it, otherwise car won't go downhill but stay in the air. And you won't be able to make turns with your car. Check the FS in my sig for ready Cruise Control solution.
Reply


Messages In This Thread
[HowTo] Making a working Cruise control - by sean5874 - 15.03.2010, 17:22
Re: [HowTo] Making a working Cruise control - by iLinx - 15.03.2010, 17:50
Re: [HowTo] Making a working Cruise control - by sean5874 - 15.03.2010, 19:07
Re: [HowTo] Making a working Cruise control - by Torran - 15.03.2010, 19:29
Re: [HowTo] Making a working Cruise control - by mick88 - 16.03.2010, 05:47
Re: [HowTo] Making a working Cruise control - by Deat_Itself - 16.03.2010, 08:20

Forum Jump:


Users browsing this thread: 1 Guest(s)