28.06.2009, 18:53
Let me help you with that.
https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint - SetPlayerCheckpoint definition. Note: A player can only have 1 checkpoint at a time.
And the player to point definition:
----
You'd better use pickups. This way they will remain permanently there, and you can display more than 1. Create a pickup at the entrance using CreatePickup. And use the OnPlayerEnterPickup in combination with PlayerToPoint to set the player's interior.
https://sampwiki.blast.hk/wiki/CreatePickup - CreatePickup Definition
https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup - OnPlayerPickUpPickup Dedinition
https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint - SetPlayerCheckpoint definition. Note: A player can only have 1 checkpoint at a time.
And the player to point definition:
pawn Код:
stock PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx - x);
tempposy = (oldposy - y);
tempposz = (oldposz - z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
return 0;
}
You'd better use pickups. This way they will remain permanently there, and you can display more than 1. Create a pickup at the entrance using CreatePickup. And use the OnPlayerEnterPickup in combination with PlayerToPoint to set the player's interior.
https://sampwiki.blast.hk/wiki/CreatePickup - CreatePickup Definition
https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup - OnPlayerPickUpPickup Dedinition