#1

How to put my own message instead of SERVER: Unknown command. ??
Reply
#2

after public OnPlayerCommandText(playerid, cmdtext[])
the return:
Quote:

return SendClientMessage(playerid, COLOR_YELLOW, "Your message comes here");
}

edit: nice pic
Reply
#3

Try this: didnt test.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {

        return 1;
    }
    return SendClientMessage(playerid, red, "SERVER: Unknown Command");
}
Reply
#4

i mean when he write any wrng command!!!
Reply
#5

Quote:
Originally Posted by -•♥♠♦♣-•Arshavin•-♥♠♦♣•-
Посмотреть сообщение
i mean when he write any wrng command!!!
Yes they wrote you for that! You didn't even try the code, seeing if it works. The code works perfectly^^. Also, you don't need to put "!!!" because it looks like you're screaming.

If you type /thisisunknowncommand it will show Unknown command in red.
Reply
#6

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
//your commands
//delete the old return
return SendClientMessage(playeridCOLOR_YELLOW"Your message comes here");
 } 
Reply
#7

Quote:
Originally Posted by geerdinho8
Посмотреть сообщение
Try this: didnt test.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {

        return 1;
    }
    return SendClientMessage(playerid, red, "SERVER: Unknown Command");
}
Thanks!
Reply
#8

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {

        return 1;
    }
    return SendClientMessage(playerid, red, "SERVER: Unknown Command");
}
Is wrong ....

It supouse to be

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {

        return 1;
    }
    SendClientMessage(playerid,color,"text");
    return 1;
}
Reply
#9

I tested mine, and it worked..

You're welcome btw.
Reply
#10

Quote:
Originally Posted by Elka_Blazer
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {

        return 1;
    }
    return SendClientMessage(playerid, red, "SERVER: Unknown Command");
}
Is wrong ....

It supouse to be

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {

        return 1;
    }
    SendClientMessage(playerid,color,"text");
    return 1;
}
No! Both is good, and your way is LESS efficient, the first one is better...

It's like this:
pawn Код:
CMD:something( playerid, params[ ] ) {
    return SendClientMessage( playerid, -1, "Lol. " );
}
does the same as this:
pawn Код:
CMD:something( playerid, params[ ] ) {
    SendClientMessage( playerid, -1, "Lol. " );
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)