SA-MP Forums Archive
Invalid command message? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Invalid command message? (/showthread.php?tid=365658)



Invalid command message? - seanny - 03.08.2012

Is it possible to make an Invalid Command message when using Strcmp as a command base?


Re: Invalid command message? - FalconX - 03.08.2012

Quote:
Originally Posted by seanny
Посмотреть сообщение
Is it possible to make an Invalid Command message when using Strcmp as a command base?
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if ( !strcmp( "/mycommand", cmdtext, true, 10 ) )
    {
        // Do something here
        return 1;
    }
    return SendClientMessage( playerid, -1, "INVALID COMMAND" ); // change return 0; to return SendClientMessage( ... );
}
I guess you want this

Hope this helps?

Regards,
FalconX


Re: Invalid command message? - seanny - 03.08.2012

Quote:
Originally Posted by FalconX
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
    if ( !strcmp( "/mycommand", cmdtext, true, 10 ) )
    {
        // Do something here
        return 1;
    }
    return SendClientMessage( playerid, -1, "INVALID COMMAND" ); // change return 0; to return SendClientMessage( ... );
}
I guess you want this

Hope this helps?

Regards,
FalconX
OK, I'll give it a go.