Well, the unknown command message is shown when the OnPlayerCommandText callback returns 0, so do you return 0 anywhere in your OnPlayerCommandText function? Also, in ZCMD do you return a value at the end of each command to prevent the script from continuing to the end of the OnPlayerCommandText callback?
I'm not really sure how ZCMD works as I've never used it, but I assume that's where the issues lies, you should probably check out the documentation for it, if there is any. |
public OnPlayerCommandReceived(playerid, cmdtext[])
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
CMD:kick(playerid, params[])
{
if (P_DATA[ playerid ][ P_Level ] < 4)return SendError( playerid, "You are not allowed to use this command"),SendClientMessage(playerid, COLOR_WHITE, "REASON: Low level!");
if (P_DATA[ playerid ][ P_LoggedIN ] == 0)return SendError( playerid, "Please login to use this command!");
if ( sscanf( params, "us", params[ 0 ] ,params[ 1 ]) )return SendUsage( playerid, "/kick <id> [reason]" );
if ( !IsPlayerConnected( params[ 0 ] ) )return SendError( playerid, "Player is not connected!");
if (P_DATA[ params[ 0 ] ][ P_Level ] > P_DATA[ playerid ][ P_Level ])return SendError( playerid, "You have no rights to use admin commands on higher admins!");
if( params[ 0 ] == playerid )return SendError( playerid, "You can't kick yourself!");
FormMessageForAllEx(playerid,COLOR_GREEN, "Administrator %s kicked %s from the server! [Reason: %s]",PlayerName2( playerid ), PlayerName2( params[ 0 ] ), params[ 1 ]);
FormMessage( params[ 0 ], COLOR_GREEN, "4 %s kicked you! [Reason: %s ]",PlayerName2( playerid ), params[ 1 ]);
FormMessage( playerid, COLOR_GREEN, "You have kicked %s [Reason: %s]",PlayerName2( params[ 0 ] ), params[ 1 ]);
Kick( params[ 0 ] );
return 1;
}
CMD:ban(playerid, params[])
{
if (P_DATA[ playerid ][ P_Level ] < 4)return SendError( playerid, "You are not allowed to use this command"),SendClientMessage(playerid, COLOR_WHITE, "REASON: Low level!");
if (P_DATA[ playerid ][ P_LoggedIN ] == 0)return SendError( playerid, "Please login to use this command!");
if ( sscanf( params, "us", params[ 0 ] ,params[ 1 ]) )return SendUsage( playerid, "/ban <id> [reason]" );
if ( !IsPlayerConnected( params[ 0 ] ) )return SendError( playerid, "Player is not connected!");
if (P_DATA[ params[ 0 ] ][ P_Level ] > P_DATA[ playerid ][ P_Level ])return SendError( playerid, "You have no rights to use admin commands on higher admins!");
if (P_DATA[ params[ 0 ] ][ P_Level ] > P_DATA[ playerid ][ P_Level ])return SendError( playerid, "You have no rights to use admin commands on higher admins!");
/*if( params[ 0 ] == playerid )
return SendError( playerid, "You can't ban yourself!");*/
FormMessageForAllEx(playerid,COLOR_GREEN, "Administrator %s banned %s from the server! [Reason: %s]",PlayerName2( playerid ), PlayerName2( params[ 0 ] ), params[ 1 ]);
FormMessage( params[ 0 ], COLOR_GREEN, "Administrator %s banned you! [Reason: %s ]",PlayerName2( playerid ), params[ 1 ]);
FormMessage( playerid, COLOR_GREEN, "You have banned %s [Reason: %s]",PlayerName2( params[ 0 ] ), params[ 1 ]);
new gP_FILE[ 256 ];
format( gP_FILE, 256, "Administration/Users/%s.ini", PlayerName2( params[ 0 ] ));
new
INI:pACC = INI_Open( gP_FILE );
INI_WriteInt(pACC, "BANNED", 1 );
INI_Close( pACC );
Ban( params[ 0 ] );
return 1;
}
enum P_ENUM_DATA
{
bool:P_Super,
bool:P_vStats,
P_LoggedIN,
P_Registered,
P_MSGS,
P_CMDS,
P_Kills,
P_Deaths,
P_PMS,
P_LoginFails,
P_Cookies,
//list goes on...
new P_DATA [ MAX_PLAYERS ][ P_ENUM_DATA ] ;
OnPlayerCommandPerformed(playerid, cmdtext[], success)