Send message to admins when a player uses a CMD -
Ananisiki - 17.03.2013
^^^^^^^^
Re: Send message to admins when a player uses a CMD -
Nathan_Taylor - 17.03.2013
Need a little more info, what do you mean by "admins"? RCON Admins? Or do you have like a login/register system with admin levels assigned to users? If you are just using RCON Admins, then I would do the following,
pawn Код:
stock SendClientMessageToAdmins(color, message[128])
{
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerAdmin(i)){
SendClientMessage(i, color, message);
}
}
}
And whereever you are doing your command... this example is using ZCMD
pawn Код:
CMD:mycommand(playerid, params[])
{
//whatever the command does
//send message to admins
SendClientMessageToAdmins(-1, "A user used a command, blah blah...");
return 1;
}
Haven't tested it out, should work though.
Re: Send message to admins when a player uses a CMD -
Ananisiki - 17.03.2013
^^^^^^^^
Re: Send message to admins when a player uses a CMD -
Ananisiki - 17.03.2013
^^^^^^^^
Re: Send message to admins when a player uses a CMD -
Don_Cage - 17.03.2013
Please someone correct me if im wrong! but if you have admin levels this is what i THINK you should do, change the stock from this
pawn Код:
stock SendClientMessageToAdmins(color, message[128])
{
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerAdmin(i)){
SendClientMessage(i, color, message);
}
}
}
to this
pawn Код:
stock SendClientMessageToAdmins(color, message[128])
{
for(new i = 0; i < MAX_PLAYERS; i++){
if(PlayerInfo[i][pAdmin] >= 1){
SendClientMessage(i, color, message);
}
}
}
but like i said i can be wrong
Re: Send message to admins when a player uses a CMD -
Ananisiki - 17.03.2013
^^^^^^^^
Re: Send message to admins when a player uses a CMD -
Don_Cage - 17.03.2013
Have you tried to be on rcon admin?
Re: Send message to admins when a player uses a CMD -
Ananisiki - 17.03.2013
^^^^^^^^
Re: Send message to admins when a player uses a CMD -
Don_Cage - 17.03.2013
Should it really be
pawn Код:
SendClientMessageToAdmins(-1, string);
??shouldnt it only be
pawn Код:
SendClientMessageToAdmins(1, string);
Re: Send message to admins when a player uses a CMD -
Zex Tan - 17.03.2013
Try this :
pawn Код:
stock SendMessageToAdmins(color, const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][Admin] >= 1) // You can edit this line depends on your admin system.
SendClientMessage(i, color, string);
}
return 1;
}
Then you can use like this
pawn Код:
CMD:mycommand(playerid, params[])
{
SendMessageToAdmins(-1, "My command Successful"); // -1 is your "Color" and "My command Successful" is your string.
return 1;
}