Tow with tractor
#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


Messages In This Thread
Tow with tractor - by lider1241 - 09.09.2013, 19:55
Re: Tow with tractor - by Konstantinos - 09.09.2013, 19:58
Re: Tow with tractor - by FuznesS - 09.09.2013, 22:31

Forum Jump:


Users browsing this thread: 1 Guest(s)