[Help] Zcmd
#5

Quote:
Originally Posted by scout322
Посмотреть сообщение
I think it doesnt change anything.. it still works my way too.
Maybe it work for you, but your example is wrong.

Let's say that, all players need to have score greater then 1, ok?

And on the server we will have 2 players: Player X and Player Y.

Your code will be

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
        SendClientMessage(playerid, COLOR_NEWS, "Error: That command does not exist. Refer to /help for server commands.");

     if(GetPlayerScore(playerid) <= 1)
        SendClientMessage(playerid, COLOR_NEWS, "Error: You need to have score greater then 1 to use commands on this server");

    return 1;
}
Now, Player X's level is 2 and Player Y's level is 1.

Each player will execute two commands.

/command1 - require score 2 to use it.
/command2 - doesn't exist.

Player X will execute: /command1 and /command2.

When Player X will execute /command1, he will be ok, no error message.
When Player X will execute /command2, he will receive a message with unknown command.

Player Y will execute: /command1 and /command2.

When Player Y will execute /command1, he will receive a message about the level.
When Player Y will execute /command2, he will receive a message with unknown command and about the level.

So, if you want to avoid this you need to return function with 0 and you need that.
Reply


Messages In This Thread
[Help] Zcmd - by INKISICION - 25.01.2015, 01:29
Re: [Help] Zcmd - by scout322 - 25.01.2015, 01:31
Re: [Help] Zcmd - by WopsS - 25.01.2015, 01:32
Re: [Help] Zcmd - by scout322 - 25.01.2015, 01:33
Re: [Help] Zcmd - by WopsS - 25.01.2015, 01:43
Re: [Help] Zcmd - by INKISICION - 25.01.2015, 01:59

Forum Jump:


Users browsing this thread: 1 Guest(s)