The online racing simulator
Players can send private messages to the admin team
Hello. I want players to send messages to admins via chat. But I don't know how to do it. There is actually such a system on the TC server, but when I tried to do this on the lapper, I could not succeed because it detected the command.
could you give any examples like pictures or videos or whatever.

"system on the TC server" is not a good example.
Quote from Bass-Driver :could you give any examples like pictures or videos or whatever.

"system on the TC server" is not a good example.



We were typing !tc to reach the admins. That's what I meant.
In the main codes of the lapper you mentioned, there is an example that those who have the same username as a team can send messages on the same channel, you can edit its codes.
Should something like this, the code has not been tested.

CASE "!a":
IF($argv != "") THEN

#Getlistofplayers
$ListOfPlayers = GetListOfPlayers();
FOREACH ($Player in $ListOfPlayers)

$User = $Player["value"];
###Send message if a user is an admin
IF( UserisAdmin($User) == 1 )THEN
privmsg($User,"-----------------------------------");
privmsg($User,$userName." send a adminmessage");
privmsg($User,$argv);
privmsg($User,"-----------------------------------");
ENDIF

ENDFOREACH
ELSE
privmsg("Message not detected, correct syntax: !a <message>");
ENDIF
BREAK;

Quote from Bass-Driver :Should something like this, the code has not been tested.

CASE "!a":
IF($argv != "") THEN

#Getlistofplayers
$ListOfPlayers = GetListOfPlayers();
FOREACH ($Player in $ListOfPlayers)

$User = $Player["value"];
###Send message if a user is an admin
IF( UserisAdmin($User) == 1 )THEN
privmsg($User,"-----------------------------------");
privmsg($User,$userName." send a adminmessage");
privmsg($User,$argv);
privmsg($User,"-----------------------------------");
ENDIF

ENDFOREACH
ELSE
privmsg("Message not detected, correct syntax: !a <message>");
ENDIF
BREAK;


When I use the command the message goes to all members.
I wrote and admin chat back in the day.
Cannot remember if I ever shared it, but here it is.
Rename the file to *.lpr and make sure to add it to addonsused.lpr

The message that have been written are into a file called "Adminchat.txt" in the current, code but both the location and the name of the file can be changed of course.
To keep track of the messageID, that value is stored in the Lapper database.
The chat can be started using "!adminchat" or "!adchat"
I'm supplying the code as is, so don't ask for changes, new features, etc.
Attached files
adminchat.txt - 3 KB - 31 views
Quote from Yisc[NL :;2075728"]I wrote and admin chat back in the day.
Cannot remember if I ever shared it, but here it is.
Rename the file to *.lpr and make sure to add it to addonsused.lpr

The message that have been written are into a file called "Adminchat.txt" in the current, code but both the location and the name of the file can be changed of course.
To keep track of the messageID, that value is stored in the Lapper database.
The chat can be started using "!adminchat" or "!adchat"
I'm supplying the code as is, so don't ask for changes, new features, etc.

I know this. But that's not actually what I want. Sending messages to admins without opening the panel.

When I send a message with the !a command, the message is dropped. But this falls into the conversation of all players. I tried a few things but it didn't work. It should only fall on the admin team.
Well, you can use my code and strip the GUI out of it.
Shouldn't be too hard to accomplish.
ENDIF
IF( UserisAdmin($User) == 1 )THEN
privmsg($User,"-----------------------------------");
privmsg($User,$userName." send a adminmessage");
privmsg($User,$argv);
privmsg($User,"-----------------------------------");
ENDIF

I think this is the reason for sending messages to everyone. I'm trying to figure out what changes I should make here.
Quote from Yisc[NL :;2075730"]Well, you can use my code and strip the GUI out of it.
Shouldn't be too hard to accomplish.

I tried to edit your file but I got no reaction. Can you help me? In the coding shared by bass driver, the message is sent to everyone. I tried to edit that coding, but it didn't work.
If you checked and understand the code.you see its only sent to admins.
Maybe I am a bit cranky today, but what do you expect?

You came here with a question about something you have seen on a server.
You have not made any effort your self.
You got help from two people that know what they are doing when it comes to Lapper scripts.

First example you try and does not work as you want.
Second example does certainly work, but you want it differently.
Then you make no effort again, but expect help from us/others.

This is not the way to learn things.
Have a go at the code, debug it properly and if you really get stuck, show what you have, what the error is, etc.
Quote from Bass-Driver :If you checked and understand the code.you see its only sent to admins.

The message does not go to the administrators. It appears in everyone. I tried this by creating an admin.txt file, but it still didn't work.
Quote from Yisc[NL :;2075766"]Maybe I am a bit cranky today, but what do you expect?

You came here with a question about something you have seen on a server.
You have not made any effort your self.
You got help from two people that know what they are doing when it comes to Lapper scripts.

First example you try and does not work as you want.
Second example does certainly work, but you want it differently.
Then you make no effort again, but expect help from us/others.

This is not the way to learn things.
Have a go at the code, debug it properly and if you really get stuck, show what you have, what the error is, etc.

Dude, I already did everything you said. The coding you shared works, but I stated that I did not want to use a panel. I wanted something that fell into the gamer chat. I made changes to your coding, but there was no error message or anything. I worked on this for hours last night. You can't tell me you're not trying!
** Best answer **
<?php 
CASE "!t":
IF(
$argv != "") THEN

#Getlistofplayers
$LoP = GetListOfPlayers("U");
FOREACH (
$Player IN $LoP)
$UserName2 = $Player["value"];
$NickName2 = GetPlayerVar($UserName2,"NickName");
UserGroupFromFile( "yetkili", "./yetkili.txt" );
IF (
UserInGroup( yetkili,$UserName2) )
THEN
privmsg
($UserName2,"-----------------------------------");
privmsg($UserName2,$userName." send a adminmessage");
privmsg($UserName2,$argv);
privmsg($UserName2,"-----------------------------------");
ENDIF
ENDFOREACH
ELSE
privmsg("Message not detected, correct syntax: !a <message>");
ENDIF
BREAK;
?>
I haven't tried it but it should work
Quote from arda556 :
<?php 
CASE "!t":
IF(
$argv != "") THEN

#Getlistofplayers
$LoP = GetListOfPlayers("U");
FOREACH (
$Player IN $LoP)
$UserName2 = $Player["value"];
$NickName2 = GetPlayerVar($UserName2,"NickName");
UserGroupFromFile( "yetkili", "./yetkili.txt" );
IF (
UserInGroup( yetkili,$UserName2) )
THEN
privmsg
($UserName2,"-----------------------------------");
privmsg($UserName2,$userName." send a adminmessage");
privmsg($UserName2,$argv);
privmsg($UserName2,"-----------------------------------");
ENDIF
ENDFOREACH
ELSE
privmsg("Message not detected, correct syntax: !a <message>");
ENDIF
BREAK;
?>
I haven't tried it but it should work

Thanks it works. What should I do so that the player can see the message he wrote to the admins?

I solved the problem.

FGED GREDG RDFGDR GSFDG