need help wich servar command
#1

if someone know pls to tell me if someone wrong command to show on chat example wrong command use/cmds
Reply
#2

Do you mean it should show command's correct usage?
Reply
#3

If you use ZCMD command processor there is a function called OnPlayerCommandPerformed(...)

Just add it to your script.
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) return SendClientMessage(playerid, YourColor,"wrong command use/cmds";
    return 1;
}
If you don't use ZCMD don't even try it 'cause it won't work.
Reply
#4

lol cant found
Quote:

(1456) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandPerformed")

Reply
#5

Quote:
Originally Posted by doreto
Посмотреть сообщение
lol cant found
Do you use ZCMD?
Reply
#6

Quote:

Do you use ZCMD?

what is ZCMD ? i use pawn
Reply
#7

ZCMD is a command system for pawn.

Anyways, what do you exactly want?
Reply
#8

if someone wrong command to show on chat example wrong command use/cmds
Reply
#9

Quote:
Originally Posted by Kase
Посмотреть сообщение
ZCMD is a command system for pawn.

Anyways, what do you exactly want?
He means that if someone writes some non existing command, this will SendClientMessage(playerid,0xFF0000FF,"wrong command use/cmds");

Anyways you can do it like this. (Or just try it - I'm not sure).

Where's your OnPlayerCommandText callback.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}
And now just change this return 0; to return SendClientMessage(playerid,0xFF0000FF,"wrong command use/cmds");
Reply
#10

replace the return 0; at the end of OnPlayerCommandText
with:

pawn Код:
SendClientMessage(playerid, 0xAA3333AA,"This command doesn't exist! Use /cmd");
return 1;
}
//Ah, already said
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)