How to lift cars with the tow truck ?
#1

I saw in a server once where you can lift cars with the tow truck , any idea how to do that ?
Reply
#2

AttachTrailerToVehicle Function with some OnKeyStateChange action. And viola. Working towtruck.

On my server we have towtruck like singleplayer
Reply
#3

Can you give an example of how it should look ?
Reply
#4

OnPlayerKeystatechange

if(newkeys & KEY_FIRE)
{
if(GetPlayerVehicleID(playerid) == Your tow truck id)
{
AttachTraielrToVehicle(...
}
}

also you will need to check which is closest car
Reply
#5

I'm not really used to work with this callback so is this right ?
pawn Код:
if(newkeys & KEY_FIRE)
{
if(GetPlayerVehicleID(playerid) == 525)
{
AttachTrailerToVehicle(5, 1);
}
}
Reply
#6

Quote:
Originally Posted by Bumper
Посмотреть сообщение
I'm not really used to work with this callback so is this right ?
pawn Код:
if(newkeys & KEY_FIRE)
{
if(GetPlayerVehicleID(playerid) == 525)
{
AttachTraielrToVehicle(5, 1);
}
}
AttachTraielrToVehicle(5, 1); Is not spelled correctly.
Reply
#7

yeah..fixed it but what I ment was it correctly ?
Reply
#8

Try this:
http://pastebin.com/yN4xtaBt
It first detects if the player is in a towing truck,then gets the closest vehicle to the player,then checks if the closest vehicle is in distance of less than 10 meters,and then tows the car.
Reply
#9

thanks just tested it and worked purfectly
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)