Checkpoints
#4

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:
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
Reply


Messages In This Thread
Checkpoints - by 6tynine - 28.06.2009, 18:31
Re: Checkpoints - by Moustafa - 28.06.2009, 18:34
Re: Checkpoints - by 6tynine - 28.06.2009, 18:45
Re: Checkpoints - by Cezar - 28.06.2009, 18:53
Re: Checkpoints - by 6tynine - 28.06.2009, 20:15
Re: Checkpoints - by 6tynine - 28.06.2009, 20:54
Re: Checkpoints - by Grim_ - 28.06.2009, 20:55
Re: Checkpoints - by 6tynine - 28.06.2009, 20:58
Re: Checkpoints - by Grim_ - 28.06.2009, 20:58
Re: Checkpoints - by 6tynine - 28.06.2009, 21:00

Forum Jump:


Users browsing this thread: 4 Guest(s)