[SOLVED MYSELF] Commands problem
#1

Description of the problem
When I type any commands, for example !mybag, I dont receive the "mybag" command information, but the "apoints" one, and that happens with every command I got, but not with !register and !login, the "apoints" command is executed even if I type a command that doesnt exist.

This is my OnPlayerCommandText:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx, file[128], tmp[256], tmp2[256];
    cmd = strtok(cmdtext, idx);
    new string[128];
    #include "../data/commands/register.cmd"
    #include "../data/commands/login.cmd"
    #include "../data/commands/apoints.cmd"
    #include "../data/commands/mybag.cmd"
    #include "../data/commands/getvisits.cmd"
    return 0;
}
The command that is executed every time I use a command is the "apoints" command, here's the code :

pawn Код:
if (strcmp("/apoints", cmdtext, true) == 0 || IsLogged[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_YELLOW, "---------------------------------------------------");
        SendClientMessage(playerid, COLOR_LITEBLUE, "AVATI POINTS INFORMATION               ");
        SendClientMessage(playerid, COLOR_YELLOW, "---------------------------------------------------");
        format(string, sizeof(string), "You have got %d APs", GetPlayerApoints(playerid));
        SendClientMessage(playerid, COLOR_LITEBLUE, string);
        SendClientMessage(playerid, COLOR_YELLOW, "---------------------------------------------------");
        return 1;
    }
    if (strcmp("/ap", cmdtext, true) == 0 || IsLogged[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_YELLOW, "---------------------------------------------------");
        SendClientMessage(playerid, COLOR_LITEBLUE, "AVATI POINTS INFORMATION               ");
        SendClientMessage(playerid, COLOR_YELLOW, "---------------------------------------------------");
        format(string, sizeof(string), "You have got %d APs", GetPlayerApoints(playerid));
        SendClientMessage(playerid, COLOR_LITEBLUE, string);
        SendClientMessage(playerid, COLOR_YELLOW, "---------------------------------------------------");
        return 1;
    }
This is on the apoints.cmd file (.cmd because I made it with my command generator);

Can someone tell me why this happens?
Reply
#2

change the || to &&
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)