The online racing simulator
[Solved] Get nickname infront / behind me
Hi

Im trying to get nickname for player infront or behind me.
i tried using this code :
$other = getplayerinfo($UNameBehind("Nickname"));
and also tried :
$me = getplayerinfo($PlayerA);
$other = getplayerinfo($PlayerB);

but it does work.Can u guys help me
Have a look at the code I use for my Pitboard.
This will show you the following:

Get a value from the player in front of you: GetPlayerVar( GetCurrentPlayerVar( "UNameBefore" ),"SectorSplit" . $splitnumber )

Get a value from the player behind you: GetPlayerVar( GetCurrentPlayerVar( "UNameBehind" ),"SectorSplit" . $splitnumber )
Thank you,I will have a look at it. Smile
Hi

It does not seem to work here is my code and screen shot:

Sub myTwin($argv $msg)
$me = GetCurrentPlayerVar("NickName");
$behind = GetPlayerVar( GetCurrentPlayerVar( "UNameBehind");
$front = GetPlayerVar( GetCurrentPlayerVar( "UNameBefore" );

globalMsg( langEngine( "%{main_twin}%" , $me,$behind));
EndSub
Attached images
Untitled.png
I'm not sure, but I don't think these UNameBefore/UNameBehind will work in a sub like that, as i'm sure they need a split/sector/lap Event to trigger, such as Event OnSpbSplit1( $userName ).

Maybe you could try with the distance done Event (Event OnDistDone)? If it does work, don't make it every single meter, but try every 10, 25, or 50?

Alternatively, maybe using Nodes, Zones or InSim circles in AutoX mode as the triggers?
You could be right there sinanju.
Other way to go around that issue is to set the names you want to retrieve values from, using other events.
Quote from sinanju :I'm not sure, but I don't think these UNameBefore/UNameBehind will work in a sub like that, as i'm sure they need a split/sector/lap Event to trigger, such as Event OnSpbSplit1( $userName ).

Maybe you could try with the distance done Event (Event OnDistDone)? If it does work, don't make it every single meter, but try every 10, 25, or 50?

Alternatively, maybe using Nodes, Zones or InSim circles in AutoX mode as the triggers?

I will try that aswell,Thank you
This thread is closed

FGED GREDG RDFGDR GSFDG