PDA

View Full Version : Admin Hiding detects commands as a unknown CMD


Lorenc_
31/08/2011, 12:21 PM
Hey guys, I made a hide command though after typing up some admin commands seems to me that the commands work though a clientmessage is sent showing: You have entered a invalid command.

Does anyone know the case to this?


public OnPlayerCommandPerformed( playerid, cmdtext [ ], success )
{
if( success == 0 ) return SendError( playerid, "You have entered a invalid command." );
return ( 1 );
}

Darnell
31/08/2011, 12:36 PM
public OnPlayerCommandPerformed( playerid, cmdtext [ ], success )
{
if(!success) return SendError( playerid, "You have entered a invalid command." );
return ( 1 );
}
Try this ?

Lorenc_
31/08/2011, 12:44 PM
public OnPlayerCommandPerformed( playerid, cmdtext [ ], success )
{
if(!success) return SendError( playerid, "You have entered a invalid command." );
return ( 1 );
}
Try this ?

' ! ' = false statement
' == 0 ' = false statement

They're the same, I would guess this is some bug i need to fix soon otherwise I need to remove the feature :(

Naruto_Emilio
31/08/2011, 12:46 PM
are you using return 0; in the end of your commands (if in strcmp).
that would cause the problem too.

Darnell
31/08/2011, 12:46 PM
forward OnPlayerCommandPerformed(playerid, cmdtext[], success);

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) SendClientMessage(playerid, COLOR, "You have entered a invalid command.");
return 1;
}

Try that, won't think it'll help, check if there's return 0; in the end of OnPlayerCommandText if you use strcmp.