|
Originally Posted by Thrarod
trailer = CreateVehicl(blahblah)
AttachTrailerToVehicle("trailer" to your vehicle) :S |
now he is 22!!!!!
|
Originally Posted by Steven82
Quote:
OFFTOPIC: Yeah i have helped rodney 3 times now he is 22!!!!! ![]() |
hard huh?
|
Originally Posted by Thrarod
Get your position then get your angle then... Spawn trailer behind that point with use (x-4, y-5, z-2 (example not true)) also those may vary with your angle
hard huh? |
X,Float
Y,Float
Z;
A;|
Important Note: Will only work if both vehicles are streamed in. -> Taken from the SA:MP wiki |
|
Originally Posted by biltong
Both vehicles must be streamed in, IE close to you.
OFFTOPIC: I helped Rodney to get to level 9, 25 and 26 xD suckit |
if(strcmp(cmd, "/transport", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] == 23)
{
if(tr_check[playerid] >= 1)
{
if(PlayerInfo[playerid][pJobTime] == 0)
{
new newcar = GetPlayerVehicleID(playerid);
if(newcar >= 254 && newcar <= 255)
{
if(PlayerToPoint(20.0,playerid,1647.3077,-2112.8350,13.5547))
{ //vlada
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
/*new Float:pA;
GetVehicleZAngle(GetPlayerVehicleID(playerid),pA);*/
new Float:vX,Float:vY,Float:vZ;
new Found=0;
new newtrailer = AddStaticVehicleEx(450,pX,pY,pZ,0.0,-1,-1,0);
while((GetPlayerVehicleID(playerid)<MAX_VEHICLES)&&(!Found))
{
GetVehiclePos(GetPlayerVehicleID(playerid),vX,vY,vZ);
if((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0))
{
Found=1;
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
new gTrailer = GetVehicleTrailer(GetPlayerVehicleID(playerid));
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
DestroyVehicle(gTrailer);
}
AttachTrailerToVehicle(newtrailer,GetPlayerVehicleID(playerid));
SetPlayerCheckpoint(playerid,2431.2773,114.5036,26.4689,20.0);
transportcheck[playerid]=1; tr_check[playerid] = 0;
GameTextForPlayer(playerid,"~r~Transport ~w~the container to the selected destination!",8000,3);
} }
}
else
{
SendClientMessage(playerid, COLOR_GREY,"* You need to be in the working place entrance area to enable the mission.");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY,"* You cannot transport without a transporter vehicle!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY,"* You are already started the your job mission.");
}
}
else
{
format(string, sizeof(string), "* You cannot transport at the moment, please come again in %d minutes.", PlayerInfo[playerid][pJobTime]);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY,"* You are not a transporter.");
}
}
return 1;
}
new trailer; Trailer = AddVehicle(blahblah
if(GetPlayerVehicleID(playerid) == Truck1)
{
//code
AttachTrailerToVehicle(Trailer1,Truck1);
//code
}
new vc = CreateVehicle(trailer,0,0,0,0,0,0,0)
AttachTrailerToVehicle(vc,GetPlayerVehicleID(playerid));
//Towing Stuff
CMD:tow(playerid, params[]) {
if(IsPlayerConnected(playerid)) {
if(IsPlayerInAnyVehicle(playerid)) {
new m = GetVehicleModel(GetPlayerVehicleID(playerid));
if (m == 525 || m == 552) {
if(GetPlayerState(playerid)==2) {
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
new Float:vX,Float:vY,Float:vZ;
new Found=0;
new vid=0;
while((vid<MAX_VEHICLES)&&(!Found)) {
vid++;
GetVehiclePos(vid,vX,vY,vZ);
if ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid))) {
Found=1;
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) {
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
}
else {
AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
}
}
}
if(!Found) {
SendClientMessage(playerid, COLOR_RED, "[ Error ]: There is no car in range.");
}
}
else {
SendClientMessage(playerid, COLOR_RED, "[ Error ]: You need to be the driver!");
return 1;
}
}
else {
SendClientMessage(playerid, COLOR_RED, "[ Error ]: You need to be in a vehicle to do this!");
return 1;
}
}
}
return 1;
}