SA-MP Forums Archive
OnPlayerEnterCheckpoint job - 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: OnPlayerEnterCheckpoint job (/showthread.php?tid=629258)



OnPlayerEnterCheckpoint job - Hunud - 23.02.2017

Ok guys hi,

Example: If i have an object box in my hands and i need put it on red checkpoint, how i can do that when i enter in this checkpoint object will be shown on the ground, what i have to do set positions or ? Any example +REP if helped


Re: OnPlayerEnterCheckpoint job - GoldenLion - 23.02.2017

https://sampwiki.blast.hk/wiki/Function:GetPlayerPos
https://sampwiki.blast.hk/wiki/CreateObject


Re: OnPlayerEnterCheckpoint job - Hunud - 23.02.2017

I dont get it!

This is my coo (2066.1118,-1991.9330,13.5469,176.4049)

So now when i enter in this Checkpoint object must be on ground!


Re: OnPlayerEnterCheckpoint job - GoldenLion - 23.02.2017

Subtract like 1.0 from the Y coordinate and create the object at that position.


Re: OnPlayerEnterCheckpoint job - haikalbintang - 28.02.2017

Maybe this is what you want. First of all make some CMD like eh... /job like this one :

PHP код:
CMD:job(playeridparams[])
{
    
SetPVarInt(playerid"Checkpoint"1);
    
SetPlayerCheckpoint(playerid2066.1118,-1991.9330,13.54693.0);

Then if player enter checkpoint at the coordinate, disable the checkpoint like this :

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(
GetPVarInt(playerid"Checkpoint"))
    {
                
//Add another function if you want
        
DisablePlayerCheckpoint(playerid);
        
DeletePVar(playerid"Checkpoint");
    }
    return 
1;