Tow with tractor
#1

How do i can make that?

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

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

I think: AttachTrailerToVehicle
Reply
#3

Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)