Read comds problem? please help
#1

man this is my read cmds by which admins can read cmds for admin onlly

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new playname[MAX_PLAYER_NAME], ircCommand[256];
	GetPlayerName(playerid, playname, sizeof(playname));
	format(ircCommand, sizeof(ircCommand), "02[%i] 07%s: %s", playerid, playname, cmdtext);
	IRC_GroupSay(gGroupID2, IRC_CHANNEL, ircCommand);

	new string[256];
	new idx;
	string = strtok(cmdtext, idx);
 //================ [ Read Comamands ] ===========================//
	if(ServerInfo[ReadCmds] == 1)
	{
		format(string, sizeof(string), "*** %s (%d) typed: %s", pName(playerid),playerid,cmdtext);
		for(new i = 0; i < MAX_PLAYERS; i++) {
			if(IsPlayerConnected(i)) {
				if( (PlayerInfo[i][Level] > PlayerInfo[playerid][Level]) && (PlayerInfo[i][Level] > 1) && (i != playerid) ) {
					SendClientMessage(i, grey, string);
				}
			}
		}
	}
}
but it wont show
Reply
#2

Are you sure that ServerInfo[ReadCmds] is set to 1?

However

Код:
	if(ServerInfo[ReadCmds] == 1)
	{
		format(string, sizeof(string), "*** %s (%d) typed: %s", pName(playerid),playerid,cmdtext);
		for(new i = 0; i < MAX_PLAYERS; i++) {
			if(IsPlayerConnected(i)) {
				if(IsPlayerAdmin(playerid)) {
					SendClientMessage(i, grey, string);
				}
			}
		}
	}
this should show the message to RCON ADMINS, however if you have a serverside admin system use post here your variable (if you don't know which just post here an admin command like /kick or /ban)
Reply
#3

yes it setted to 1 first it was commented then i uncommented it
Reply
#4

pawn Код:
if(ServerInfo[ReadCmds] == 1)
{
    format(string, sizeof(string), "*** %s (%d) typed: %s", pName(playerid),playerid,cmdtext);
   
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(playerid == i) continue;
            if(PlayerInfo[i][Level] > PlayerInfo[playerid][Level]) SendClientMessage(i, grey, string);
        }
    }
}
If that doesn't work then one of the variables you're using to check things (i.e. in the if-statements) is not set to the proper value.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)