The online racing simulator
not a player event problem
Good afternoon,
After upgrading from 7.0.7.1 to 7.0.7.2 I have encountered several problems in my script that in the previous version did not work. Thats why i opened a new topic here in Bug reports and not in Scripting Help (sorry if I'm wrong).
The error that has appeared to me in the Logs is:
2/18/2021 11:04:48 AM -> Syntax error: in file ".\default.\includes.\radares_e_policia.lpr" at line #962
You can't use openprivButton in this context, not a player event
Function 'oncrossingchecker.\default.\includes.\radares_e_policia.lpr-30' script aborted

The tweaking of the script that I attach here is part of a warning before the radar made by insim circles.
It has given this error "You can't use openprivButton in this context, not a player event" in several other scripts, I just describe this one because it seemed the easiest.
I also noticed that it gives error only in functions using "Priv".
Is there a problem with my script? Remembering that it doesn't always give the error, once in a while ....
Thank you all!


Script:
CatchEvent OnCrossingChecker($userName,$Flags,$Time,$Object,$UserSpeed,$CircleIndex) # Player event
# ID do RADAR
$SR_RADAR05 = 104;

# Radar Limit
$SR_LIMITE05 = 100;

# Warn's ID
$SR_AVISO05 = 114;

$SR_MARGEMRADAR = 7; #margem de erro no radar

#################################################################
################ Contumization pannel ####################
#################################################################
#
$SR_WLLPGERAL = 32; #Cor do fundo #
#
$SR_ColorRadar = 3; #Cor das letras do radar #
$SR_WLLPRadar = 22; #Cor do fundo Radar #
#
$SR_ColorNM = 1; #Mudar cor do numero no aviso #
$SR_WLLPNM = 0; #Cor do fundo dos numeros #
#
$SR_ColorUNT = 7; #Muda a cor das letras das unidades #
$SR_WLLPUNT = 0; #Cor do fundo das unidades #
#
#################################################################

IF ( $CircleIndex == $SR_AVISO05 && $Flags == 0 )

THEN

IF ( $playerRadarZone == 1 )

THEN

openprivButton( "SR_AvisoRadar",170,80,25,15,12,10,$SR_WLLPRadar, "^" . $SR_ColorRadar . "Radar Fixo" );
openprivButton( "SR_AvisoRadarVEL",167,95,30,27,12,10,$SR_WLLPNM, "^" . $SR_ColorNM . $SR_LIMITE05 ); ####################
openprivButton( "SR_AvisoRadarUNT",178,115,8,5,12,10,$SR_WLLPUNT, "^" . $SR_ColorUNT . "km/h" );
openprivButton( "SR_AvisoRadarFND",169,79,27,49,12,10,$SR_WLLPGERAL, "" );

ENDIF

ENDIF

#################################################################

EndCatchEvent

Really odd, i haven't done anything on this event or any "priv" functions.
It should be a player event indeed, because i send the playerinfo with it, beside the $userName argument. It whould be handy if you could reproduce this error.

That means $userName should be empty when this error is being created.

But to "fix" this, use the following functions below.


OpenButton($userName,"SR_AvisoRadar"......);
Privmsg($userName,"text");


FGED GREDG RDFGDR GSFDG