The online racing simulator
[Solved] No Wrong Way On Cruise Server
I can't seem to find the answer to this anywhere so...

Brief:
I'm making a hotlap server, but has some rpg elements to it for people who are spectating/parking/fooling around in car park.

Objective:
So I'm trying to write a script that pitlanes on wrong way at a certain point (see image for wrong way direction). At the moment, I can RegisterNodeAction and can execute a "pitlane" command, the problem is, I cannot specify a direction...

Script:
RegisterNodeAction( "BL1", 339, ReverseCheck, "" );

Sub ReverseCheck ( $userName, $ZoneID )
IF ( $Mode == "Cruise" )
THEN

GlobalMsg( "Player is Exiting Pits" );
IF ( GetPlayerVar( $userName, $Direction ) != "0" )
THEN

GlobalMsg( "Attempting to Spectate Player for Wrong Way" );
cmdLFS( "/pitlane " . GetPlayerVar( $userName , "UserName") );
HERE I JUST ADD MESSAGES AND FINES
ENDIF
ENDIF
EndSub

Comment:
As you can see there's a problem with indicating the direction, and the manual only says:
"Direction: 0 = positive y-direction."

Solutions?
Are there any other variables I can use? How would you approach this problem?

(And no, I need cruise mod lol)
Attached images
lfs_00000002.jpg
To do some debugging, you could try to output: GetPlayerVar( $userName, $Direction )

Drive the right way and see what value comes out, then drive the wrong way and see if a different value comes out.

If you cannot solve this issue with a correct reading of $Direction, I would solve it be doing a tripple NodeAction.
If players triggers NodeAction1, 2 and 3 he must be driving in the wrong direction and then you can execute the pitlane action.
I can't seem to print out Direction or Heading...

GlobalMsg("Direction: " . ToNum( GetPlayerVar( $userName, "Direction" ) ) "."); #Print User Direction
GlobalMsg("Direction: " . ToNum( GetPlayerVar( $userName, "Heading" ) ) "."); #Print User Direction

I've tried using $ instead of quotes, I've tried without ToNum, just what am i doing wrong.

What are the units of Direction?
** Best answer **
) ) .".");
Ur missing a dot.
THANK YOU SO MUCH IT WORKED LOL. I just had to fix the dot rip.

So at that specific point, the required script:

GlobalMsg("Direction: " . GetPlayerVar( $userName, "Direction" ) . "."); #Print User Direction
GlobalMsg("Direction: " . GetPlayerVar( $userName, "Heading" ) . "."); #Print User Direction
IF ( Round(GetPlayerVar( $userName, "Direction" ), 2) >= 160 && Round(GetPlayerVar( $userName, "Direction" ), 2) <= 240 )
THEN
GlobalMsg( "Calculated Wrong Way Direction" );
cmdLFS( "/pitlane " . GetPlayerVar( $userName , "UserName") );
GlobalMsg( GetPlayerVar( $userName, "NickName") . " ^2 pitlaned for wrong way!");
ENDIF
You can use Insim checkpoints for this, these are placed in the layout editor, and handled in the UCO packet.
This thread is closed

FGED GREDG RDFGDR GSFDG