SA-MP Forums Archive
[SOLVED MYSELF] Commands 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED MYSELF] Commands problem (/showthread.php?tid=107890)



[SOLVED MYSELF] Commands problem - JonyAvati - 11.11.2009

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?


Re: [SOLVED MYSELF] Commands problem - Daren_Jacobson - 11.11.2009

change the || to &&