y_commands (OnPlayerCommandPerformed) problem.
#1

Alright so, i`m using y_commands for the gamemode i`m working on. There is one problem, after i updated to the latest YSI with the new y_commands.inc, OnCommandPerformed doesn't work as supposed. It practically returns the error message to any command. All the commands I have return "1", so i`m not sure what is it caused by.

Here is how the callback looks like,
Код:
public OnPlayerCommandPerformed(playerid,cmdtext[],success)
{
    if(!success) return SendClientMessage(playerid,white,"Error message.");
    return 1;
}
Any idea?
Thanks.
Reply
#2

Try this
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(success == 0)
    {
        format(string, sizeof(string), "Error message.");
        SendClientMessage(playerid, white, string);
        return 1;
    }
    return 1;}
Reply
#3

Nope, still the same problem.
But thanks for your help!
Reply
#4

Bump... anyone? At least, i`m pretty sure that the problem is from the actual include. Something makes the OnPlayerCommandPerformed think that the commands do not exist even tho they do.
Reply
#5

So... no one ever experienced this problem?
Bump.
Reply
#6

You'll want to wait for ****** to see this. He knows the system inside out and will be able to help the most. I'm unsure what could cause this and I've never ever had that issue before.

Just for debugging purposes, could you produce an example (perhaps with screenshots and an example command).
Reply
#7

Sure,
OnPlayerCommandPerformed:
Код:
public OnPlayerCommandPerformed(playerid,cmdtext[],success)
{
	if(!success) SendClientMessage(playerid,white,"Error message.");
	return 1;
}
Command:
Код:
YCMD:test(playerid,params[],help)
{
	#pragma unused params
	if(help) return SendClientMessage(playerid,white,"Blahblah !");
	SendClientMessage(playerid,white,"Test message. You will receive some dosh !");
	GivePlayerMoney(playerid,400);
	return 1;
}
Screenshot:


Here you go!
Reply
#8

Well, seems like there's no point on bumping this anymore. I'll just opt out for this feature and wait silently until it's possibly gonna be fixed. Thanks for the above members who tried to help!
Reply
#9

See my tutorial, just copy paste my else condition in your script inside OnPlayerCommandPerformed calleback. I have done it with OnPlayerCommandText, but its same thing with the other callback too.

You have to loop it, see my tutorial in my signature.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)