Need help at AttachTrailerToVehicle.
#1

i want to when spawn trailer to attach it, this is code
pawn Код:
if(TakeTruck[playerid] == 1){
        TakeTruckAttach[playerid] = CreateVehicle(450, 379.993804, 2542.577636, 16.539062, 163.325531, 0, 1, -1);
        AttachTrailerToVehicle(TakeTruckAttach[playerid], GetPlayerVehicleID(playerid));
    }
it create that vehicle but it doesn't attach on mine truck.
Reply
#2

From wiki:
Important Note: Will only work if both vehicles are streamed in.
Reply
#3

what they mean with streamed in, i created it and it doesn't attach it, i tried to put attach in onvehiclespawn but still not working
Reply
#4

sorry for double post, but here is what i done in onvehiclespawn
pawn Код:
public OnVehicleSpawn(vehicleid)
{
    new i;
    for(i = 0; i<MAX_PLAYERS; i++){
        if(TakeTruck[i] == 1){
            if(vehicleid == TakeTruckAttach[i]){
                AttachTrailerToVehicle(TakeTruckAttach[i], GetPlayerVehicleID(i));
            }
        }
    }
    return 1;
}
Reply
#5

What it means! is it will only work with the

"https://sampwiki.blast.hk/wiki/AddStaticVehicle" "https://sampwiki.blast.hk/wiki/AddStaticVehicleEx"
Reply
#6

oh, thanks ;]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)