Posts: 311
Threads: 55
Joined: Dec 2009
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
Posts: 178
Threads: 17
Joined: Apr 2010
Reputation:
0
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;
}
Posts: 311
Threads: 55
Joined: Dec 2009
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
Posts: 178
Threads: 17
Joined: Apr 2010
Reputation:
0
hez code gonna make you 26 errors. Unmatched opening bracket.
Posts: 311
Threads: 55
Joined: Dec 2009
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.
Posts: 311
Threads: 55
Joined: Dec 2009
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?