SA-MP Forums Archive
ZCMD Problem - 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: ZCMD Problem (/showthread.php?tid=451274)



ZCMD Problem - Mauricee - 16.07.2013

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.




Re: ZCMD Problem - Necip - 16.07.2013

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



AW: ZCMD Problem - BigETI - 16.07.2013

Return 0 in order to deny performing commands.


Re: ZCMD Problem - Mauricee - 16.07.2013

Now I don't recieve any error message


Re: ZCMD Problem - IceBilizard - 16.07.2013

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



Re: ZCMD Problem - Mauricee - 16.07.2013

Thank you Ice!