Strcmd Help
#1

I have not edited it from /mycommand yet but.

It says "SERVER: Unknown Command"

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext))
	{
		if(!IsPlayerAdmin(playerid))
		{
		    SendClientMessage(playerid, 0xFF0000, "You are not authorised to use this command.");
		}
		else
		{
			SendClientMessage(playerid, 0xFFFF00, "{FFFFFF}RCON ADMIN: {FF0000}INSERT COMMANDS");
		}

	}
	return 1;
}
Also how do I change it from

"SERVER: Unknown command"

To

"[RpF Clan] Command Unreconised.

And Script in a faction
Reply
#2

try with

if (!strcmp("/mycommand", cmdtext))

And about second, there it is:

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if( !success ) return SendClientMessage( playerid,-1,"Command does not exist! Check /commands!");
return 1;
}
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext))
    {
        if(!IsPlayerAdmin(playerid))
        {
            SendClientMessage(playerid, 0xFF0000, "You are not authorised to use this command.");
        }
        else
        {
            SendClientMessage(playerid, 0xFFFF00, "{FFFFFF}RCON ADMIN: {FF0000}INSERT COMMANDS");
        }

    }
    return 1;
}


    return SendClientMessage(playerid,COLOR_Robbers,"[RpF Clan] Command Unreconised.");
}
//
Reply
#4

thanks for the command error but to make the command work failed.

How do I turn it into ZCMD?

EDIT: CHAMP I WILL TRY YOURS
Reply
#5

hez code gonna make you 26 errors. Unmatched opening bracket.
Reply
#6

Quote:
Originally Posted by Champ
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext))
    {
        if(!IsPlayerAdmin(playerid))
        {
            SendClientMessage(playerid, 0xFF0000, "You are not authorised to use this command.");
        }
        else
        {
            SendClientMessage(playerid, 0xFFFF00, "{FFFFFF}RCON ADMIN: {FF0000}INSERT COMMANDS");
        }

    }
    return 1;
}


    return SendClientMessage(playerid,COLOR_Robbers,"[RpF Clan] Command Unreconised.");
}
//
Failed.
Reply
#7

I got

pawn Код:
COMMAND:mycommand(playerid, params[])
{
    if(!IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid, 0xFF0000, "You are not authorised to use this command.");
    }
    else
    {
        SendClientMessage(playerid, 0xFFFF00, "{FFFFFF}RCON ADMIN: {FF0000}INSERT COMMANDS");
    }
}
It shows now but it says underneath unknown command. Maybe a small coding error.

A fix for that is?
Reply
#8

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext))
	{
		if(!IsPlayerAdmin(playerid))
		{
		    SendClientMessage(playerid, 0xFF0000, "You are not authorised to use this command.");
		}
		else
		{
			SendClientMessage(playerid, 0xFFFF00, "{FFFFFF}RCON ADMIN: {FF0000}INSERT COMMANDS");
		}
                return 1;

	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)