Trailer Detect
#4

Quote:
Originally Posted by Private200
Посмотреть сообщение
You might also want to use "GetVehiclePos" while at it and the actual trailer model.

PHP код:
CMD:printtrailer(playeridparams[])
{
    new 
string[50], Float:tmpCoords[3], trailerIDvehicleid GetPlayerVehicleID(playerid); // get the id of the vehicle the player is driving
    
trailerID GetVehicleTrailer(vehicleid); // get the ID of the trailer attached to the current vehicle
    
new trailerModel GetVehicleModel(trailerID); // get the model of the trailer
    
GetVehiclePos(trailerIDtmpCoords[0], tmpCoords[1], tmpCoords[2]); // get the position of the trailer
    
format(stringsizeof string"CreateVehicle(%d, %f, %f, %f, 0, -1, -1, 6000000);"trailerModeltmpCoords[0], tmpCoords[1], tmpCoords[2]);
    
SendClientMessageToAll(-1string);
    
SendClientMessage(playerid,-1,"Saved");
    return 
1;

This is fully converted to work with trailers only, thus I renamed it to "printtrailer".

EDIT: I think the trailer position is not fully synced in-game; not sure but worth a try. Someone correct me on this.
Thank you. it worked.
Reply


Messages In This Thread
Trailer Detect - by DerickClark - 22.06.2018, 03:20
Re: Trailer Detect - by Exhibit - 22.06.2018, 12:14
Re: Trailer Detect - by Private200 - 22.06.2018, 13:12
Re: Trailer Detect - by DerickClark - 23.06.2018, 05:08

Forum Jump:


Users browsing this thread: 1 Guest(s)