Unknown command.
#1

How can I fix this:

I added this:
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(!success) SendClientMessage(playerid, COLORWHITE, "That command does not exist. Use {FFFF00}/help{FFFFFF} to see a list of available commands.");
	return 1;
}
in my gamemode which uses zcmd. But I have filterscripts which don't use zcmd but have commands. So the GM reads the commands as performed, but filterscripts send "That command does not exist etc." or even "You are not authorized to use this command" even if i type /ilovechicken. I have removed "that command does not etc etc and you are not authorized to use this command" from all the filterscripts but I still have this problem and I don't know if it can be fixed or not... I'm also a beginner in scripting and I don't know how to convert strcmp to zcmd and move all those filterscripts into my single gamemode. Someone help...
Reply
#2

You need to include the ZCMD in your fs, and also put this in there as well

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(!success) SendClientMessage(playerid, COLORWHITE, "That command does not exist. Use {FFFF00}/help{FFFFFF} to see a list of available commands.");
	return 1;
}
Reply
#3

Quote:
Originally Posted by azzerking
Посмотреть сообщение
You need to include the ZCMD in your fs, and also put this in there as well

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(!success) SendClientMessage(playerid, COLORWHITE, "That command does not exist. Use {FFFF00}/help{FFFFFF} to see a list of available commands.");
	return 1;
}
if I include ZCMD in filterscripts, the strcmp commands don't work anymore but I'm a beginner and don't really know how to convert them properly... especially with the strings etc...
Reply
#4

create the command and copy everything from OnPlayerCommandText where you put if( !strcmp( "/command", text ) ) paste it into the new command.

example
Код:
CMD:yourcommand(playerid, params[]) // the part that is bold is the only thing that needs to change when making a new command
{
    /* your pasted command here */
    return 1;
}

public OnPlayerCommandText( playerid, cmdtext[] )
{
    if( !strcmp( "/help", cmdtext ) )
    {
        // copy anything inbetween this to the command you made above
    }
}
for every strcmp that checks for the text make a new command for.
Reply
#5

Quote:
Originally Posted by azzerking
Посмотреть сообщение
create the command and copy everything from OnPlayerCommandText where you put if( !strcmp( "/command", text ) ) paste it into the new command.

example
Код:
CMD:yourcommand(playerid, params[]) // the part that is bold is the only thing that needs to change when making a new command
{
    /* your pasted command here */
    return 1;
}

public OnPlayerCommandText( playerid, cmdtext[] )
{
    if( !strcmp( "/help", cmdtext ) )
    {
        // copy anything inbetween this to the command you made above
    }
}
for every strcmp that checks for the text make a new command for.
thanks man i even found tutorials on converting strtok etc...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)