19.03.2014, 14:10
Okay, so I made a script where I can spy on other people's CMD. The problem is, I have anonymous admins on server. They're not going to be logged in this command, so I want to make a certain admin level to not take any influence in this.
Heres some code:
In the code above I got 2 errors. Invalid expression, assumed zero ... What I'm trying here is to make all admin levels above 19 to be invisible in the /togcmds command, where I spy on command echos.
Here is the command script:
What I basically want is to make this command able to work for all admin levels above 10, which I've done properly here. Nothing is wrong with this code. Now to what I'm asking for: How can I make admin levels above 19 invisible when some admin hit /togcmds.
Heres some code:
Код:
for(new i; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && PlayerTemp[i][admincmdspy] == 1) if(PlayerInfo[playerid][power] < 19) return if(IsPlayerConnected(i) && PlayerTemp[i][admincmdspy] == 0) { format(iStr, sizeof(iStr), "[ CMD ] %s[%d]: %s", PlayerName(playerid), playerid, cmdtext); SendClientMessage(i, COLOR_ORANGE, iStr); } } return 1; }
Here is the command script:
Код:
COMMAND:togcmds(playerid, params[]) { if(PlayerInfo[playerid][power] < 10) return SendClientError(playerid, CANT_USE_CMD); if(PlayerTemp[playerid][admincmdspy] == 0) { SendClientMessage(playerid,COLOR_GREENYELLOW, "[ENABLED] You will now see every command."); PlayerTemp[playerid][admincmdspy] = 1; } else if(PlayerTemp[playerid][admincmdspy] == 1) { SendClientMessage(playerid,COLOR_RED, "[DISABLED] You will nolonger see every command."); PlayerTemp[playerid][admincmdspy] = 0; } return 1; }