ZCMD Problem
#1

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You aren't login on the server.");
    if(InDealer[playerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You are visiting the dealership.");
    return 1;
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   
    if(!success)
    {
        SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: That command isn't recognized. Please use /n(ewbie) for further help.");
    }
    else
    {
        printf("Player %s %s", Naame[playerid], cmdtext);
        return 1;
    }
    return 1;
}
Why I can use commands if I'm visiting the dealership ? If I type, for example /a <message> I recieved
Quote:

Admin Maurice: message
Error: You are visiting the dealership.

Reply
#2

Hmm, try this:
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You aren't login on the server.");
    if(InDealer[playerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You are visiting the dealership.");
    return 0;
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   
    if(!success)
    {
        SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: That command isn't recognized. Please use /n(ewbie) for further help.");
    }
    else
    {
        printf("Player %s %s", Naame[playerid], cmdtext);
        return 1;
    }
    return 1;
}
Reply
#3

Return 0 in order to deny performing commands.
Reply
#4

Now I don't recieve any error message
Reply
#5

Try This
pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(gPlayerLogged[playerid] == 0)
    {
       SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You aren't login on the server.");
       return 0;
    }
    if(InDealer[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You are visiting the dealership.");
    return 0;
    }
    return 1;
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   
    if(!success)
    {
        SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: That command isn't recognized. Please use /n(ewbie) for further help.");
    }
    else
    {
        printf("Player %s %s", Naame[playerid], cmdtext);
        return 1;
    }
    return 1;
}
Reply
#6

Thank you Ice!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)