SA-MP Forums Archive
dialog , Checkpoint? - 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: dialog , Checkpoint? (/showthread.php?tid=563972)



dialog , Checkpoint? - Ritzy2K - 18.02.2015

How do i show up a dialog...as soon as player enter checkpoint and if it is a bit around it not exactly in...please explain me step wise...not just give me the code thanks...

like... a play enter in ammu nation and then enters a checkpoint how do i pop up the gun menu.?


Re: dialog , Checkpoint? - CalvinC - 18.02.2015

Use OnPlayerEnterCheckpoint, and show the dialog there.
If you use multiple checkpoints, you could use variables to check which checkpoint is enabled.
Thereby toggle it when using SetPlayerCheckpoint.


Re: dialog , Checkpoint? - Ritzy2K - 18.02.2015

Okay look...is it possible to maybe minimize code this way... like there are several ammu nations? so for each checkpoint i need make dialog again n again? can i use if - else? man m clueless


Re: dialog , Checkpoint? - Karan007 - 18.02.2015

Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z))
    {
          //Your code here
    }
Where i have put X,Y,Z just put the coordinates and put this code under the callback OnPlayerUpdate.


Re: dialog , Checkpoint? - Ritzy2K - 18.02.2015

whats 3.0 m getting confused D:


Re: dialog , Checkpoint? - CalvinC - 18.02.2015

You could probably do something like this too:
pawn Код:
public OnPlayerConnect(playerid) return SetPlayerCheckpoint(playerid, X, Y, Z, R); // Creates the checkpoint

public OnPlayerEnterCheckpoint(playerid) // When a player enters a checkpoint
{
    if(IsPlayerInRangeOfPoint(playerid, R, X, Y, Z)) // Use the same X, Y, Z and Range as the checkpoint, then it'll check if he's at the same position as it
    { // Thereby if he is, executes the commands beneath
        DisablePlayerCheckpoint(playerid); // Removes the checkpoint (optional)
        ShowPlayerDialog( ... ); // Then show the dialog
    }
    return 1;
}
To check if the player is at the point of the checkpoint you made, didn't think about that.


Re: dialog , Checkpoint? - Ritzy2K - 18.02.2015

i dont want the checkpoint to be removed.. if he goes out he can still come in? and same dialog shows up?


Re: dialog , Checkpoint? - CalvinC - 18.02.2015

Then just remove the DisablePlayerCheckpoint.


Re: dialog , Checkpoint? - Karan007 - 18.02.2015

Quote:
Originally Posted by DopeX
Посмотреть сообщение
whats 3.0 m getting confused D:
It is the highest distance where the player can get into the interior or receive the message.


Re: dialog , Checkpoint? - Ritzy2K - 18.02.2015

oh okay.. thanks anyway.. i dont have access to pawno for now...ill try it...