Vehicle Interiors - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Vehicle Interiors (
/showthread.php?tid=199601)
Vehicle Interiors -
Rokzlive - 16.12.2010
Hey, i need help.
I want to know how to do something...
Ive mapped an "Interior" which is basically just objects in the sky, but it acts as an interior i guess.
I made an office, and its themed to be inside an artic trailor 1, so kinda like mobile construction offices, like that...
I want it so that when you stand next to the trailor and press ~ on keyboard you enter it. I want it so that it remebers what trailor you entered, so that if the trailors moved, you spawn back where the trailor was moved to. I also want it to be non conflicting, like with different vertual worlds or something i dont know how its done. Can someone tell me?
Re: Vehicle Interiors -
The_Gangstas - 16.12.2010
you can;t detect ~ on samp. (i think mods can since they made ~ for texting with T and F6)
Re: Vehicle Interiors -
Rokzlive - 16.12.2010
Well we can use ENTER instead... but still how do i do it? lol.
Re: Vehicle Interiors -
The_Gangstas - 16.12.2010
onplayerkeystatechange, if(newkeys & KEY_SECONDARYATTACK) GetPlayerPos(playerid,BeforeEnterTrailerPos[0],BeforeEnterTrailerPos[1],BeforeEnterTrailerPos[2]);
then setplayerpos and interior inside of the trailer
New Float:BeforeEnterTrailerPos[3]; // Global
oh wait, also it looks like u'll have to define the trailers, if you want to know what trailer you entered. and if it moved. orr do Trailer[playerid] = vehicleid;
then do w/e
you get me?
Re: Vehicle Interiors -
Rokzlive - 16.12.2010
Huh?
Dude can you make like a .pwn example cause you lost me.
Re: Vehicle Interiors -
Haydz - 16.12.2010
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;
}
Re: Vehicle Interiors -
The_Gangstas - 16.12.2010
pawn Код:
new Intrailer[MAX_PLAYERS]=INVALID_VEHICLE_ID; //create the variable,
pawn Код:
if (newkeys & 16 && Intrailer[playerid] != INVALID_VEHICLE_ID)
Intrailer[playerid]=INVALID_VEHICLE_ID;
looks better