[+REP]Sending messages to admins.
#10

Quote:
Originally Posted by DarkSkull
Посмотреть сообщение
You can't do that. First you should copy everything from you Filterscript and put it in your Gamemode in the appropriate callbacks. Then only you can use pAdmin.
That is what CallRemoteFunction is used for.

PHP код:
// in filterscript:
FS_SendMessageToAdmins(levelcolor, const string[])
{
    if (!
string[0]) return CallRemoteFunction("SendMessageToAdmins""iis"levelcolor"\1"); // passing "\1" if the string is empty to avoid the server crash
    
return CallRemoteFunction("SendMessageToAdmins""iis"levelcolorstring);
}
// in gamemode:
forward SendMessageToAdmins(levelcolor, const string[]);
public 
SendMessageToAdmins(levelcolor, const string[])
{
    if (
string[0] == '\1') return; // empty string was passed - do nothing
  
    
for (new 0GetPlayerPoolSize(); <= ji++)
    {
        if (!
IsPlayerConnected(i)) continue; 
        if (
/* VARIABLE HERE FOR ADMIN */ >= level)
        {
            
SendClientMessage(icolorstring);
        }
    }

Replace with the array you store the player's admin level and use "i" as index. Calling:
pawn Код:
FS_SendMessageToAdmins(3, -1, "Hi admins");
will call the public function from the gamemode and send the specified message in white to all the admins >= 3 level.
Reply


Messages In This Thread
[+REP]Sending messages to admins. - by StrikerZ - 26.08.2016, 13:48
Re: [+REP]Sending messages to admins. - by F1N4L - 26.08.2016, 13:51
Re: [+REP]Sending messages to admins. - by StrikerZ - 26.08.2016, 14:42
Re: [+REP]Sending messages to admins. - by F1N4L - 26.08.2016, 14:45
Re: [+REP]Sending messages to admins. - by StrikerZ - 26.08.2016, 14:50
Re: [+REP]Sending messages to admins. - by DarkSkull - 26.08.2016, 14:54
Re: [+REP]Sending messages to admins. - by DeeadPool - 26.08.2016, 14:57
Re: [+REP]Sending messages to admins. - by StrikerZ - 26.08.2016, 14:58
Re: [+REP]Sending messages to admins. - by DarkSkull - 26.08.2016, 15:00
Re: [+REP]Sending messages to admins. - by Konstantinos - 26.08.2016, 15:24

Forum Jump:


Users browsing this thread: 1 Guest(s)