PDA

View Full Version : Tow with tractor


lider1241
09/09/2013, 07:55 PM
How do i can make that?

http://www.youtube.com/watch?v=coPvyUeBMws

what funcitions i should use? or just make it for me? :P

Konstantinos
09/09/2013, 07:58 PM
I think: AttachTrailerToVehicle (http://wiki.sa-mp.com/wiki/AttachTrailerToVehicle)

FuznesS
09/09/2013, 10:31 PM
CMD:tow(playerid, params[])
{
new vehicle, trailerid;
if(sscanf(params,"i", trailerid)) return SendClientMessage(playerid,-1,"USAGE: /tow [trailerid]");
vehicle = GetPlayerVehicleID(playerid);
if(!IsTrailerAttachedToVehicle(vehicle))
{
AttachTrailerToVehicle(trailerid, vehicle);
SendClientMessage(playerid, -1, "You have successfully attached your trailer to your vehicle");
}
return 1;
}
I'm using here sscanf and zcmd, you can change it, but Enjoy.

EDIT: if you don't want with sscanf
CMD:tow(playerid, params[])
{
new vehicle;
if(isnull(params))
return SendClientMessage(playerid, -1, "USAGE: /tow [trailerid]");
vehicle = GetPlayerVehicleID(playerid);
if(!IsTrailerAttachedToVehicle(vehicle))
{
AttachTrailerToVehicle(strval(params), vehicle);
SendClientMessage(playerid, -1, "You have successfully attached your trailer to your vehicle");
}
return 1;
}