20.03.2014, 21:10
simple,
try this
try this
pawn Код:
new bool: spyMsg[MAX_PLAYERS];//global bool var
//make a simplecmd to turn on spying and turn it off again
//example:
YCMD:spy(playerid, params[], help)
{
if (help) return SendClientMessage(playerid, gray, "/spy Is used to spy on players Commands.");
if (APlayerData[i][PlayerLevel] >= 3)
{
if(!spyMsg[playerid])
{
spyMsg[playerid] = true;
SendClientMessage(playerid, white,"Spying has been enabled!");
}
else
{
spyMsg[playerid] = false;
SendClientMessage(playerid, white,"Spying has been disabled!");
}
}
return 1;
}
MessageToAdmins(playerid, command[], text[])
{
new Name[24], Msg[128];
for (new i; i < MAX_PLAYERS; i++)
{
if (APlayerData[i][PlayerLevel] >= 3)
{
if(!spyMsg[playerid]) continue;//if spying isn't true they won't get the msg
GetPlayerName(playerid, Name, sizeof(Name));
format(Msg, 128, "** Player %s(%d) used: %s %s", Name, playerid, command, text);
SendClientMessage(i, 0x808080FF, Msg);
}
}
}