Vehicle interior - 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)
+--- Thread: Vehicle interior (
/showthread.php?tid=514011)
Vehicle interior -
luckie12 - 19.05.2014
Hi! im making a interior with MTA SA for my Camper, but how can i make it when i press G at the camper it teleports me to the interior, iknow its something like
Код:
newstate == PLAYER_STATE_PASSENGER
but idk how i can form that in my script, and also when the Driver of the camper moved the camper, and i exit the interior how can i do it that the player spawns at the place of the camper?
-Luckie12
Re: Vehicle interior -
luckie12 - 19.05.2014
:3..
Re: Vehicle interior -
Threshold - 19.05.2014
pawn Код:
//At the top of your script:
new PlayerInCamper[MAX_PLAYERS];
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER)
{
new veh = GetPlayerVehicleID(playerid);
if(GetVehicleModel(veh) == 483) //If player entered a camper
{
//Teleport player to camper interior.
PlayerInCamper[playerid] = veh; //This tells us what vehicle id the player is in, so we can teleport them when they exit.
}
}
return 1;
}
//When the player exits the camper:
PutPlayerInVehicle(playerid, PlayerInCamper[playerid], 1);
RemovePlayerFromVehicle(playerid);
I hope this kind of explains it to you.
Re: Vehicle interior -
luckie12 - 20.05.2014
it doesnt do anything, when i enter the Camper, it wont teleport me, but if i enter the camper, and after that i enter a vehicle, and leave the vehicle, it teleports me to the place where the camper is.
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER)
{
new veh = GetPlayerVehicleID(playerid);
if(GetVehicleModel(veh) == 483) //If player entered a camper
{
SetPlayerPos(playerid, -105.0361,-377.8486,1.4297);
PlayerInCamper[playerid] = veh; //This tells us what vehicle id the player is in, so we can teleport them when they exit.
}
}
return 1;
}
Re: Vehicle interior -
luckie12 - 21.05.2014
...........