Checkpoint Entering Interior Problem -
Charalambos26 - 24.05.2015
Hello,
I have this on
oncheckpointenter
Код:
case BAR_CP:
{
SetPlayerInterior(playerid, 11);
SetPlayerPos(playerid, 502.2838, -70.2034, 998.7578);
SetPlayerFacingAngle(playerid, 181.8469);//
return 1;
}
Quote:
Originally Posted by Charalambos26
but this is to difficult for a Scripting Noob like me, or?
|
Does anybody know how to make a no bugging checkpoint?
I want it to be a red checkpoint, but I should only enter it with an command, this will teleport me to a place.
Re: Checkpoint Entering Interior Problem -
Sellize - 24.05.2015
PHP код:
// Uses ZCMD/YCMD
CMD:enter(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z)) // replace x y z with the coordinates of the entrance
{
SetPlayerInterior(playerid, 11);
SetPlayerPos(playerid, 502.2838, -70.2034, 998.7578);
SetPlayerFacingAngle(playerid, 181.8469);
SendClientMessage(playerid, -1, "You have entered the building.");
}
else
{
SendClientMessage(playerid, -1, "You cannot enter anything here.");
}
return 1;
}
Re: Checkpoint Entering Interior Problem -
Charalambos26 - 24.05.2015
Quote:
Originally Posted by Sellize
PHP код:
// Uses ZCMD/YCMD
CMD:enter(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z)) // replace x y z with the coordinates of the entrance
{
SetPlayerInterior(playerid, 11);
SetPlayerPos(playerid, 502.2838, -70.2034, 998.7578);
SetPlayerFacingAngle(playerid, 181.8469);
SendClientMessage(playerid, -1, "You have entered the building.");
}
else
{
SendClientMessage(playerid, -1, "You cannot enter anything here.");
}
return 1;
}
|
+1 rep
Thanks, should I put this on OnPlayercommandtext?
And how to make an exit command?
Re: Checkpoint Entering Interior Problem -
Sellize - 24.05.2015
Quote:
Originally Posted by Charalambos26
+1 rep
Thanks, should I put this on OnPlayercommandtext?
And how to make an exit command?
|
Get the ZCMD include, include it and paste the command in.
Exit command works the same way except check if the player is in the interior and at the exit position and set their position to the entrance
Re: Checkpoint Entering Interior Problem -
Vince - 24.05.2015
That is not at all maintenance friendly. If you have, say, 100 doors like that you're simply not going to copy-paste 100 coordinates beneath each other.
When the player enters a dynamic checkpoint, save that checkpointid to a global player variable. When they leave a dynamic checkpoint, reset that variable. Then, in the command, use IsPlayerInDynamicCheckpoint to establish that they're still in the checkpoint, using the ID you saved earlier. Then switch checkpointid to get the desired position.
This isn't the best way to do it, still, but at least it's better than copying sets of coordinates.
Re: Checkpoint Entering Interior Problem -
Charalambos26 - 24.05.2015
Quote:
Originally Posted by Vince
That is not at all maintenance friendly. If you have, say, 100 doors like that you're simply not going to copy-paste 100 coordinates beneath each other.
When the player enters a dynamic checkpoint, save that checkpointid to a global player variable. When they leave a dynamic checkpoint, reset that variable. Then, in the command, use IsPlayerInDynamicCheckpoint to establish that they're still in the checkpoint, using the ID you saved earlier. Then switch checkpointid to get the desired position.
This isn't the best way to do it, still, but at least it's better than copying sets of coordinates.
|
but this is to difficult for a Scripting Noob like me, or?
Re: Checkpoint Entering Interior Problem -
Charalambos26 - 24.05.2015
Quote:
Originally Posted by Charalambos26
but this is to difficult for a Scripting Noob like me, or?
|
Does anybody know how to make it?
I want it to be a red checkpoint, but I should only enter it with an command, this will teleport me to a place.