16.12.2010, 01:32
This is the basic part of what i use on my server. hopefully it shows you what you need to do.
pawn Код:
new Intrailer[MAX_PLAYERS]; //create the variable,
//OnPlayerSpawn
Intrailer[playerid]=0;
//onplayerentervehicle
if (GetVehicleModel(vehicleid) == trailerid && ispassenger == 1) { //change trailer id to the id of the trailer.
SetPlayerPos(playerid,trailerx,trailery,trailerz); //change trailerx, trailery, trailerz to the x,y,z cords for your trailer
Intrailer[playerid]=vehicleid;
SetPlayerVirtualWorld (playerid, vehicleid) ; //credits to retardedwolf for helping with this bit.
}
//OnPlayerKeyStateChange
if (newkeys & 16 && Intrailer[playerid] > 0) //credits to whoever made the shamal interior fliterscript. (can't remember)
{
new Float:X,Float:Y,Float:Z,Float:A;
GetVehiclePos(Intrailer[playerid],X,Y,Z);
GetVehicleZAngle(Intrailer[playerid],A);
X+=(5*floatsin(-floatsub(A,45.0),degrees)),
Y+=(5*floatcos(-floatsub(A,45.0),degrees));
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid,X,Y,floatsub(Z,0.94));
SetPlayerFacingAngle(playerid,A);
Intrailer[playerid]=0;
}