Hello everyone,
I want to block players while they are joining the track (shift+j) and put a button on their screen. When they click on the button, I want to take the player out of the pit and teleport them to a certain region, but I was not successful.
I can't get the player out of the pit after clicking the button
I want to block players while they are joining the track (shift+j) and put a button on their screen. When they click on the button, I want to take the player out of the pit and teleport them to a certain region, but I was not successful.
<?php
$ReceiveJoinRequest = 1;
# New JoinRequest event
Event OnNewJoinRequest($userName)
# Display custom buttons
openPrivButton("tppanel_1", 85, 86, 30, 6, 1, -1, 33, "^T- - Teleport - - -");
openPrivButton("tppanel_2", 85, 93, 30, 4, 1, -1, 32, "^T^7Test",pitatp);
# Prevent the player from exiting the pit
$Flags = 0;
$X_Axis = 0;
$Y_Axis = 0;
$Z_Axis = 0;
$Heading = 0;
$UCID = GetCurrentPlayerVar("UCID");
$PLID = 0; # Player's unique ID (PLID) must be 0
$JRRAction = 0;
joinrequest($X_Axis, $Y_Axis, $Z_Axis, $Flags, $Heading, $UCID, $PLID, $JRRAction);
EndEvent
# Teleport to Zone 1 subroutine
Sub pitatp($KeyFlags, $id)
# Exits the pit if the current player is a spectator
$UCID = GetCurrentPlayerVar("UCID");
$PLID = GetCurrentPlayerVar("PLID");
$X_Axis = 100; # Region 1 X coordinate
$Y_Axis = 200; # Region 1 Y coordinate
$Z_Axis = 0; # Zone 1 Z coordinate
$Heading = 0; # Start direction
$Flags = 128; # To move the car
$JRRAction = 1; # Accept join request
joinrequest($X_Axis, $Y_Axis, $Z_Axis, $Flags, $Heading, $UCID, $PLID, $JRRAction);
EndSub
?>