SA-MP Forums Archive
How can i make tow truck to tow cars?! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How can i make tow truck to tow cars?! (/showthread.php?tid=90719)



How can i make tow truck to tow cars?! - Martin_White - 09.08.2009

As the title says :P


Re: How can i make tow truck to tow cars?! - MadeMan - 09.08.2009

https://sampwiki.blast.hk/wiki/AttachTrailerToVehicle

Just add vehicle IDs instead trailerid.


Re: How can i make tow truck to tow cars?! - Martin_White - 09.08.2009

Lol, what if it is not a special car id? all cars, i mean..


Re: How can i make tow truck to tow cars?! - MadeMan - 09.08.2009

What is a special car id?


Re: How can i make tow truck to tow cars?! - Martin_White - 09.08.2009

Anyways it is not working

pawn Код:
if(strcmp(cmd, "/towcar", true) == 0)
    {
      AttachTrailerToVehicle(525, 525);
        return 1;
    }



Re: How can i make tow truck to tow cars?! - MadeMan - 09.08.2009

1. Tow trucks can't tow themselves.

2. You need vehicleid's not modelid's.


Re: How can i make tow truck to tow cars?! - Martin_White - 09.08.2009

1. These are vehicle ids

2. Tow trucks can tow themselves

3. I've seen this on another server

4. The owner do not want to give me the /towtruck command he has.

5. Someone else help me!


Re: How can i make tow truck to tow cars?! - MadeMan - 09.08.2009

Quote:
Originally Posted by Martin_White
5. Someone else help me!
As you wish


Re: How can i make tow truck to tow cars?! - Martin_White - 09.08.2009

Quote:
Originally Posted by MadeMan
As you wish
You know why i am saying this? because you're not helping me, you are just infracting me


Re: How can i make tow truck to tow cars?! - MadeMan - 09.08.2009

pawn Код:
if(strcmp(cmdtext, "/towcar", true) == 0)
{
    if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
    {
        new Float:pos[6];
        GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        new vehid = GetPlayerVehicleID(playerid);
        for (new vid=1; vid <= MAX_VEHICLES && GetVehicleModel(vid); vid++)
        {
            if(vid == vehid) continue;
            GetVehiclePos(vid, pos[3], pos[4], pos[5]);
            if (floatabs(pos[0]-pos[3]) < 7.0 && floatabs(pos[1]-pos[4]) < 7.0 && floatabs(pos[2]-pos[5]) < 7.0)
            {
                AttachTrailerToVehicle(vid, vehid);
                break;
            }
        }
    }
    return 1;
}