Hello. How do i enable Tow Truck in multiplayer? When i try tow it's not working.
It has to be scripted in. Search for a towing script, there is 1 for sure I know that works that has been released.
Bah.
Код:
if (strcmp("/tow", cmdtext, true, 10) == 0)
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 0;
new vehicleid = GetPlayerVehicleID(playerid);
if(IsTrailerAttachedToVehicle(vehicleid))
{
DetachTrailerFromVehicle(vehicleid);
return 1;
}
new Float:x, Float:y, Float:z;
new Float:dist, Float:closedist=8, closestveh;
for(new i=1; i < MAX_VEHICLES; i++)
{
if(i != vehicleid && GetVehiclePos(i, x, y, z))
{
dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
if(dist < closedist)
{
closedist = dist;
closestveh = i;
}
}
}
if(!closestveh) return 1;
AttachTrailerToVehicle(closestveh, vehicleid);
return 1;
}