The online racing simulator
I can't get player information
Hello, I was trying to do something myself about the ban system in the Yis code version.


In order to get the information of the players I have listed, I changed the "ban" button to an information button. But this time I can't pull players' data. If the previous command was

".GetPlayerVar( $argv,"UserName" ) ."

I was doing it as. But I don't know how to do it in buttons. I tried a few steps. The results are as follows.

Sub Ban_player( $KeyFlags,$id )
### Set initial values for left/right and top/bottom coordinates ###
$left_right_ban = 29;
$top_bottom_ban = 50;
### End ###

$mList = GetListOfPlayers("N");
$mCount = arrayCount( $mList );
$plyNum=0;

### Close previously opened buttons during automatic refresh, otherwise changed names or people who left aren't shown ###
FOR ($i=0;$i<=40;$i=$i+1)
closePrivButton ("player_".$i."_number&player_".$i."_nickname&player_".$i."_status&player_".$i."_ban");
ENDFOR

openPrivButton( "ban_screen_bg",$left_right_ban,$top_bottom_ban,142,125,5,-1,16,"");
openPrivButton( "ban_screen_title",$left_right_ban+1,$top_bottom_ban+1,140,5,5,-1,32,"^7Oyuncu Listesi" );
WHILE ($plyNum < $mCount)
$uName = $mList[$plyNum];

openPrivButton ("player_".$plyNum."_number",$left_right_ban+1,$top_bottom_ban+10,5,5,5,-1,32,$plyNum+1);
openPrivButton ("player_".$plyNum."_nickname",$left_right_ban+7,$top_bottom_ban+10,25,5,5,-1,32,GetPlayerVar($uName,"NickName") );

openPrivButton ("player_".$plyNum."_ban",$left_right_ban+33,$top_bottom_ban+10,15,5,5,-1,32,"^1Bilgi",banmenu);

### Raise $top_bottom_ban with 5 before drawing next button
$top_bottom_ban=$top_bottom_ban+5;
### End ###

$plyNum=$plyNum+1;

### When player 20 is reached, change value of $left_right_connected to start next colum. Set $top_bottom_connected to initial value ###
IF ($plyNum == 20)
THEN
$left_right_ban = 100;
$top_bottom_ban = 50;
ENDIF
### End ###
ENDWHILE

openPrivButton( "refresh_ban",69,164,20,5,10,30,32,"^3Yenile (%cpt%)",Ban_player );
openPrivButton( "close_ban",90,164,20,5,10,-1,32,"^3Kapat",close_ban_player );
EndSub

I didn't change their names, but I changed the ban button to player information. So when we click it, it needs to access the player data.




Sub banmenu ( $KeyFlags,$id )

$id = Substr($id,7);
$mList = GetListOfPlayers("N");
$uName = $mList[$id+0];


closePrivButton ("ban_screen_bg&ban_screen_title&refresh_ban&close_ban");
FOR ($i=0;$i<=40;$i=$i+1)
closePrivButton ("player_".$i."_number&player_".$i."_nickname&player_".$i."_status&player_".$i."_ban");
ENDFOR

closePrivButton ("ban_screen_bg&ban_screen_title&refresh_ban&close_ban");
penPrivButton( "modpanelmenu",60,50,70,100,4,-1,32,"");
openPrivButton( "info2",60,52,70,7,4,-1,16,"^7ADMIN PANEL ");
openPrivButton( "modpanelmesaj",60,71,15,5,5,-1,0,"^2Oyuncu K.Adi: ");
openPrivButton( "modpanelmesaj99",67,71,15,5,5,-1,0,"^7". GetPlayerVar ( $uName,"UserName" ) ."");
EndSub

When I use it with this code, it only takes the first player's username. If I do [$id+1], it takes the username of the 2nd player. How can I get players' information respectively? There is no way I haven't tried.
Can anyone help?
So you took Yisc[NL] his code and you mentioned it works.
Now you edit the code and suddenly it doesn't work.

You ask us for help, while you failed editing existing working code.

I won't help you. Because i do not know how the original code looks like. And i do NOT give myself permission to look into or edit his code.
and i'm not interested in comparing your code with Yisc[NL]'s code.

Seems you did not properly understand/debug the code.

Yisc[NL] put his time and effort into this script, so you can it on your server.
Just leave the orginal code/script as it is.
If you want to change something, try to understand the code and build something yourself.

Have a nice day.
The original code is already broken. Anyway, I won't bother with you.
Adam, you should not be so rude. Bass Driver has helped you so many times by now, by giving you the finished code almost everytime. Additiobally, numerous times he mentioned that you have to learn how to properly debug your code, sometines even line by line if possible. This is an integral part of coding, which you seem to always avoid.
I do not want to talk about this topic. Anyway, I solved this problem now. There is no need to share the solution.The original files were incorrect and I corrected the errors.
Quote from RealistAdam :The original code is already broken. Anyway, I won't bother with you.

I've never posted any broken code, so if it is broken for real, the only cause could be newer releases of Lapper, as all code posted by me, was working at the time of posting.
I doubt that newer released of Lapper aren't working with the code, as I would probably have heard about it and tried to fix it.
To cut a long story short, I am done with your attitude and since I think it's too big of a step to give you a ban from the forum, I will from now on close every thread you start in the Lapper section.
Enough is enough.
This thread is closed

FGED GREDG RDFGDR GSFDG