06.10.2011, 12:01
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.
CMD:attachv(playerid,params[])
{
if(!strval(params[0])) return SendClientMessage(playerid, -1, "usage: /attachv [carid]");
AttachTrailerToVehicle(params[0],GetPlayerVehicleID(playerid));
return 1;
}
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;
}
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;
}
AttachTrailerToVehicle(TrailerId[Random(random(sizeof(TrailerId))], GetPlayerVehicleID(playerid));//will attach one of those trailers randomly
AttachTrailerToVehicle([ID of trailer], GetPlayerVehicleID(playerid));