AttachTrailerToVehicl
#1

Hey, I need help with this, i'v looked on the wiki and it helped BUT. I need it so it'll attach a vehicle to whatever vehicle the player is in, please help ASAP.
Reply
#2

pawn Код:
CMD:attachv(playerid,params[])
{
if(!strval(params[0])) return SendClientMessage(playerid, -1, "usage: /attachv [carid]");
AttachTrailerToVehicle(params[0],GetPlayerVehicleID(playerid));
return 1;
}
?
Reply
#3

Hmm, Could you try explaining it so I could try to edit it to what I need? because I need it not in a command, I need it so when a player enters a checkpoint a certain (Id choose) would get attached to the back of their truck.
Reply
#4

AttachTrailerToVehicle(car 1, car 2);

Car 2 = car that you drive

Car 1 = car that you take with you...
Reply
#5

I know, but theres six vehicles the player is able to do the minimission with, how would it be? EX:
pawn Код:
if(Ccp[playerid] == 3)
    {
        new string[128];
        FreezeThenAutoUnfreeze(playerid,5000);
        DisablePlayerCheckpoint(playerid);
        Ccp[playerid] = 4;
        SetPlayerCheckpoint(playerid,2761.4836,-2455.6270,13.5552,3.0);
        format(string,sizeof(string),"HQ: HQ to %s, take this coal and bring it to LS docks.",GetName(playerid));
        SendClientMessage(playerid,COLOR_YELLOW,string);
        return 1;
    }
I want him to get a trailer attached with that.
Reply
#6

checkpoint 1 = attach the vehicle to the car that you're drivin

checkpoint 2 = attach the 2nd vehicle to the car that you attached before...

checkpoint 3 = attach the 3th vehicle to the vehicle from 2nd checkpoint... and keep doing that

idk if is that what you need...
Reply
#7

Nono, what I mean is HOW would I get thetrailer attached to the vehicle? (You helped me earlier, and I need the trailer attached to one of those six)
Scene: Driver drives to the checkpoint, gets froze for 5 seconds then gets a trailer attached to his vehicle(Either one of the six)
Reply
#8

pawn Код:
new TrailerId[6] = {
{1st trailer id},
{2nd trailer id},
{3th trailer id},
{4th trailer id},
{5th trailer id},
{6th trailer id}
};

//onplayerentercheckpoint
TogglePlayerControllable(playerid, false);
SetTimerEx("AttachOneTrailer",5000,false,"i",playerid);

public AttachOneTrailer(playerid)
{
    AttachTrailerToVehicle(TrailerId[Random(random(sizeof(TrailerId))], GetPlayerVehicleID(playerid));//will attach one of those trailers randomly
    TogglePlayerControllable(playerid, true);
    //SendClientMessage
    return 1;
}
like this?
Reply
#9

Thanks for all that but all I needed was
pawn Код:
AttachTrailerToVehicle(TrailerId[Random(random(sizeof(TrailerId))], GetPlayerVehicleID(playerid));//will attach one of those trailers randomly
Because I changed it to
pawn Код:
AttachTrailerToVehicle([ID of trailer], GetPlayerVehicleID(playerid));
So all I really needed was GetPlayerVehicleID(playerid)); :P
Reply
#10

kkkkkk ok then ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)