Help Unknow command
#1

Hi

Can someone tell me how to make if player will type unknown command it will show him "Unknown command type /c for commands
"
Reply
#2

show us the code?
Reply
#3

public OnPlayerCommandText(playerid,cmdtext[])
{
//What ever you commands are go here
return 1;
//Return 0 returns the message
return SendClientMessage(playerid,-1,"{FF0000}Unknown command {FFFFFF}type /c for commands");
}
Reply
#4

i want if player will type unknown command it will send him the message: Unknown command type /c for commands"
Reply
#5

Quote:
Originally Posted by kalanerik99
Посмотреть сообщение
i want if player will type unknown command it will send him the message: Unknown command type /c for commands"
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return SendClientMessage(playerid,-1,"{FF0000}Unknown command {FFFFFF}type /c for commands");
}
Reply
#6

but how can I do that in zcmd
Reply
#7

Here you go

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
         return SendClientMessage(playerid,-1,"{FF0000}Unknown command {FFFFFF}type /c for commands");
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by pds2012
Посмотреть сообщение
Here you go

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
         return SendClientMessage(playerid,-1,"{FF0000}Unknown command {FFFFFF}type /c for commands");
    }
    return 1;
}
that wont work.

you have to forward it first:
pawn Код:
forward OnPlayerCommandPerformed(playerid, cmdtext[], success)
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid,-1,"{FF0000}Unknown command {FFFFFF}type /c for commands");

}
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)