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.
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;
IF( UserisAdmin($User) == 1 )THEN
privmsg($User,"-----------------------------------");
privmsg($User,$userName." send a adminmessage");
privmsg($User,$argv);
privmsg($User,"-----------------------------------");
ENDIF
<?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;
?>