Invalid CMD? (Rep+)
#1

um hi.
could you tell me how to create a script that it will say "Invalid CMD" when i press an invalid cmd? xD i'm a noob plz help
Reply
#2

it says that by default. unless you wanna change the text.
Reply
#3

Quote:
Originally Posted by THE_KNOWN
Посмотреть сообщение
it says that by default. unless you wanna change the text.
my GameMode does not says it.
Reply
#4

what command processor do you use?
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/example", true)) {
        //Something Here
        return 1;
    }
    return SendClientMessage(playerid, -1, "Invalid CMD");
}
Reply
#6

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/example", true)) {
        //Something Here
        return 1;
    }
    return SendClientMessage(playerid, -1, "Invalid CMD");
}
...not everyone uses strcmp directly in OnPlayerCommandText.
Reply
#7

Quote:
Originally Posted by Calgon
Посмотреть сообщение
...not everyone uses strcmp directly in OnPlayerCommandText.
agreed. Thats why I asked for the Command Processor he is using
Reply
#8

pawn Код:
// In ZCMD:

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if (!success) {
        SendClientMessage(playerid, -1, "Invalid CMD");
    }
    return 1;
}

// In Strcmp:

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/example", true)) {
        //Something Here
        return 1;
    }
    return SendClientMessage(playerid, -1, "Invalid CMD");
}
Reply
#9

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/example", true)) {
        //Something Here
        return 1;
    }
    return SendClientMessage(playerid, -1, "Invalid CMD");
}
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(290) : warning 202: number of arguments does not match definition
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(2330) : error 010: invalid function or declaration
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(2332) : error 010: invalid function or declaration
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(2334) : error 010: invalid function or declaration
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(2336) : error 010: invalid function or declaration
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(233 : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#10

Quote:
Originally Posted by JohnDoVaS12345
Посмотреть сообщение
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(290) : warning 202: number of arguments does not match definition
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(2330) : error 010: invalid function or declaration
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(2332) : error 010: invalid function or declaration
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(2334) : error 010: invalid function or declaration
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(2336) : error 010: invalid function or declaration
C:\Users\Giannis\Desktop\SA-MP Server\gamemodes\XtremeGaming.pwn(233 : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

Edit: I use zcmd
That was for strcmp. It was stupid from me, that I didn't ask for command processor.
For ZCMD use OnPlayerCommandPerformed callback
pawn Код:
// In ZCMD:

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if (!success) {
        SendClientMessage(playerid, -1, "Invalid CMD");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)