How can i make tow truck to tow cars?!
#1

As the title says :P
Reply
#2

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

Just add vehicle IDs instead trailerid.
Reply
#3

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

What is a special car id?
Reply
#5

Anyways it is not working

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

1. Tow trucks can't tow themselves.

2. You need vehicleid's not modelid's.
Reply
#7

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!
Reply
#8

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

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
Reply
#10

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)