Help with CAR TOW
#7

http://pawn.pastebin.com/f4b4c5045

Try that. (didn't test)

Put the..
pawn Код:
new Trailer[MAX_VEHICLES] = 0;
..on the top of the script.

When you TOW a car, Trailer[vehicleid] gets the car's ID, and when you press the button again, it checks if Trailer[vehicleid] equals to 0. If it does, script continues, otherwise it detaches the car, sets the Trailer[vehicleid] to 0 and returns 1 to stop the script from proceeding(without the return it will attach the same car again, since Trailer[vehicleid] is 0).

I'd also suggest to replace...
pawn Код:
if ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
...with...
pawn Код:
if (IsPlayerInRangeOfPoint(playerid, 7.0, vX, vY, vZ) && vid != GetPlayerVehicleID(playerid))
Reply


Messages In This Thread
Help with CAR TOW - by Rady - 29.10.2008, 13:38
Re: Help with CAR TOW - by Rady - 29.10.2008, 18:02
Re: Help with CAR TOW - by yugokoral - 29.10.2008, 18:06
Re: Help with CAR TOW - by Rady - 29.10.2008, 20:31
Re: Help with CAR TOW - by Lordkire - 05.11.2008, 13:23
Re: Help with CAR TOW - by alma1305 - 06.01.2010, 17:38
Re: Help with CAR TOW - by CaHbKo - 06.01.2010, 19:03

Forum Jump:


Users browsing this thread: 1 Guest(s)