SA-MP Forums Archive
Help Unknow command - 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: Help Unknow command (/showthread.php?tid=423090)



Help Unknow command - kalanerik99 - 16.03.2013

Hi

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



Re: Help Unknow command - Patrick - 16.03.2013

show us the code?


Re: Help Unknow command - Krakuski - 16.03.2013

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");
}


Re: Help Unknow command - kalanerik99 - 16.03.2013

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


Re: Help Unknow command - kamzaf - 16.03.2013

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");
}



Re: Help Unknow command - kalanerik99 - 16.03.2013

but how can I do that in zcmd


Re: Help Unknow command - Patrick - 16.03.2013

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;
}



Re: Help Unknow command - kamzaf - 16.03.2013

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");

}