The online racing simulator
Show name in button on top of e
Hello, it's me again Smile,

What I want to do is to show the name of the officials joining the server as a button, I can actually do this, but I can show it as a single button, what I want is to have a button in the name of each official joining the server, you can explain more with the following image
+1 button when an authorized person joins the server, -1 button when an authorized person leaves the server, etc.
Attached images
Ekran Görüntüsü (1082).png
You can do that, but have to give each button a unique name, otherwise they will overwrite each other. You could add the nickname of the officials to the button name, so they always will be unique.

*edit*
Thinking about it, you need to have a counter as well, to keep track of how many officials are connected. Based on that counter you have to change the position of the next button, to avoid them getting on top of each other.
Quote from Yisc[NL :;2052049"]You can do that, but have to give each button a unique name, otherwise they will overwrite each other. You could add the nickname of the officials to the button name, so they always will be unique.

*edit*
Thinking about it, you need to have a counter as well, to keep track of how many officials are connected. Based on that counter you have to change the position of the next button, to avoid them getting on top of each other.

Actually, I think of a way to think of a way, but it is long in line, is there a shorter way to do this?
The counter can be used to create a unique button name as well as to alter the position of the buttons.
I am not home, so cannot give exact instructions now, but basically it is like this:

OnLapperStart:
- initialise counter and set it to 0

OnConnect event

If connected player is an official:
- raise counter by one
- open button for that official, when counter is 0, top/bottom position are the default value you gave then, when counter is 1, top/bottom position is default value mines 5 (to show the button above the previous button


OnDisconnect event

If disconnected player is an official
- lower counter by one
- close the button of that official
I followed a path like below but it doesn't seem to be working, I didn't encounter any problem when I looked at the logs.

<?php 
  UserGroupFromFile
"yetkili""./yetkili.txt" );
                IF ( 
UserInGroup"yetkili",$userName) )
                
THEN            
                
IF ( UserIsAdmin ($password)==1)
                
THEN
                
IF($yetkiligrs == 1)
                
THEN
                
IF($yetkiligrs == 0)
                
THEN        
                openGlobalButton
"yetkiligrs",1,195,20,4,1,10,36,"^T^7Moderatör: " .GetCurrentPlayerVar"NickName")."");
                
$yetkiligrs    "1";        
                ENDIF
                
openGlobalButton"yetkiligrs2",1,191,20,4,1,10,36,"^T^7Moderatör: " .GetCurrentPlayerVar"NickName")."");
                
$yetkiligrs    "0";        
                ENDIF    
                ELSE
                
cmdLFS"/kick " $userName );
                
CmdLFS("/msg ".GetCurrentPlayerVar("NickName") ." ^T^3Yetkili ^7DEĞİL ALDIRMAYIN!");        
                ENDIF    
                ENDIF
?>

I don't see any use of a counter.
When using a counter, you can add that to the name of the button to give it a dynamic name.
Like this:

<?php 
openGlobalButton
"yetkiligrs_".$counter,1,195,20,4,1,10,36,"^T^7Moderatör: " .GetCurrentPlayerVar"NickName")."");
?>

The counter should also be used to work out the new top/bottom position of the button.
Like this:


$default_top_bottom=195;
IF ($counter == 0)
THEN
$top_bottom=$default_top_bottom
ELSE
$new_position=$counter*5;
$top_bottom=$default_top_bottom-$new_position;
ENDIF

Then the button should be:

<?php 
openGlobalButton
"yetkiligrs_".$counter,1,$top_bottom,20,4,1,10,36,"^T^7Moderatör: " .GetCurrentPlayerVar"NickName")."");
?>

When thinking about it, using the counter in the name of the button, could cause trouble, when officials disconnect from the server, so it might be better to use there $userName in the name of the button.

Then the button should be:

<?php 
openGlobalButton
"yetkiligrs_".$userName,1,$top_bottom,20,4,1,10,36,"^T^7Moderatör: " .GetCurrentPlayerVar"NickName")."");
?>

I didn't understand much of what you said, it must be the translation, but I tried something using what you wrote and I realized that it creates nested buttons

FGED GREDG RDFGDR GSFDG