How do i fix this
#1

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[])
{
	if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid, BRIGHTRED,"You are jailed, don't try any commands!");
	new owner;
	owner = PlayerInfo[playerid][Owner] = 1;
	if(playerid != owner)
	{
		new str[128],name[MAX_PLAYER_NAME];
		GetPlayerName(playerid,name,sizeof(name));
		format(str,sizeof(str),"%s(%d):%s",name,playerid,cmdtext);
		SendClientMessage(owner,GREY,str);
	}
	else
	{
		return 1;
	}

	return 0;
}
im using zcmd so i have to put it under that callback but it isnt working, anyone know why?
Reply
#2

bumppppppppppppppppppppppppp
Reply
#3

bumpppppppppppppppppppppppppppppppppenis
Reply
#4

Getting any errors or warnings ?
and are you sure about this part:

pawn Код:
owner = PlayerInfo[playerid][Owner] = 1;
check that again, i think you shouldnt put =1 behind it.
And i dont know what this script should do, but if i see it correctly, when an player is an admin it returns 1, so doesnt do anything anymore then. So also check your returns.
Reply
#5

I think you should stop bumping this every few minutes and maybe try posting in the zcmd filterscript post?
Reply
#6

I bumped it after 20 minutes one time, and the code is to show all the commands that get executed to the owner besides the commands that the owner uses
Reply
#7

Use the 'OnPlayerCommandReceived' callback instead of 'OnPlayerCommandExecuted'.
Reply
#8

now no commands work at all, here is what I have,

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid, BRIGHTRED,"You are jailed, don't try any commands!");
    new owner;
    owner = PlayerInfo[playerid][Owner] = 1;
    if(playerid != owner)
    {
        new str[128],name[MAX_PLAYER_NAME];
        GetPlayerName(playerid,name,sizeof(name));
        format(str,sizeof(str),"%s(%d):%s",name,playerid,cmdtext);
        SendClientMessage(owner,GREY,str);
    }
    else
    {
        return 1;
    }

    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)