SA-MP Forums Archive
Changing "Unknown Command" text y_commands - 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: Changing "Unknown Command" text y_commands (/showthread.php?tid=318764)



Changing "Unknown Command" text y_commands - jameskmonger - 16.02.2012

I am using y_commands, how would I go about changing the "SERVER: Unknown Command" text to something else, of my choice?


Re: Changing "Unknown Command" text y_commands - Konstantinos - 16.02.2012

pawn Код:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
    if( !success )
    {
        format( cmdtext, 128, "Your message!" );
        SendClientMessage( playerid, -1, cmdtext );
    }
    return true;
}



Re: Changing "Unknown Command" text y_commands - jameskmonger - 16.02.2012

I place that in, and still get the message.


Re: Changing "Unknown Command" text y_commands - Konstantinos - 16.02.2012

Weird, it should send the custom message.
pawn Код:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
    if( !success ) return false;
    return true;
}
That should appear the "Server: Unknown Command"


Re: Changing "Unknown Command" text y_commands - jameskmonger - 16.02.2012

Nope. I tried this too:
pawn Код:
public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )
{
    //if( !success ) return false;
    SendClientMessage(playerid, -1, "test");
    return true;
}
So any command I type should print out "test", but it doesn't, I just get "SERVER: Unknown Command"


Re: Changing "Unknown Command" text y_commands - jameskmonger - 17.02.2012

bump


Re: Changing "Unknown Command" text y_commands - Guitar - 17.02.2012

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid, 0xFA5486FA, "Your wrong-command text here!" );
    return 1;
}



Re: Changing "Unknown Command" text y_commands - jameskmonger - 17.02.2012

Doesn't work.


Re: Changing "Unknown Command" text y_commands - iPLEOMAX - 18.02.2012

Is it a filterscript or a gamemode?


Re: Changing "Unknown Command" text y_commands - doreto - 18.02.2012

PHP код:
public OnPlayerCommandPerformed(playeridcmdtext[], success)
{
    if(!
success)
    {
        new 
string[70];
        
format(stringsizeof(string), "Command %s dont exits, Type /cmds for all your commands."cmdtext);//it will say /test dont exits,type /cmds for all your cmds
        
SendClientMessage(playerid,COLOR_REDstring);//color red
    
}
    return 
true;

this shout work