SERVER: Unknown command
#10

Try what I said before:

Quote:
Originally Posted by Merlо
Try it:

pawn Код:
if(strcmp("/levelup", cmdtext, true) == 0)
{
    if(gPlayerLogged[playerid] == 1)
    {
        if(PlayerInfo[playerid][pLevel] == 0)
        {
            if(nauda >= 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "[Info:] Tu nopirki 1 limeni");
                SendClientMessage(playerid, COLOR_WHITE, "[Info:] Tagad tu vari izmantot komandu /count");
                PlayerInfo[playerid][pLevel] = 1;
            }
        }
    }
    else SendClientMessage(playerid, COLOR_WHITE, "[Kluda:] Tev vispirms ir jaielogojas");
    return 1;
}
If it don't resolve, replace all your public OnPlayerCommandText with it:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new idx;
    new string[256];
    new cmd[256];
    new tmp[256];
    cmd = strtok(cmdtext, idx);
    nauda = GetPlayerMoney(playerid);
    if (strcmp(cmd, "/login", true) ==0 )
    {
      if(IsPlayerConnected(playerid))
      {
        new tmppass[64];
            if(gPlayerLogged[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "[Kluda:] Tu jau esi ielogojies.");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "[***:] /login [parole]");
                return 1;
            }
            strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
            Encrypt(tmppass);
            OnPlayerLogin(playerid,tmppass);
        }
        return 1;
    }
    if (strcmp(cmd, "/register", true) ==0 )
    {
      if(IsPlayerConnected(playerid))
      {
        if(gPlayerLogged[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "[Kluda:] Tu jau esi ielogojies.");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "Speletaji/%s.ini", sendername);
            new File: hFile = fopen(string, io_read);
            if (hFile)
            {
                SendClientMessage(playerid, COLOR_GREY, "[Kluda:] Sis niks jau ir aiznemts, izvelies citu.");
                fclose(hFile);
                return 1;
            }
        new tmppass[64];
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "[***:] /register [parole]");
                return 1;
            }
            strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
            Encrypt(tmppass);
            OnPlayerRegister(playerid,tmppass);
        }
        return 1;
    }
    if(strcmp("/levelup", cmdtext, true) == 0)
    {
        if(gPlayerLogged[playerid] == 1)
        {
            if(PlayerInfo[playerid][pLevel] == 0)
            {
                if(nauda >= 1)
                {
                    SendClientMessage(playerid, COLOR_WHITE, "[Info:] Tu nopirki 1 limeni");
                    SendClientMessage(playerid, COLOR_WHITE, "[Info:] Tagad tu vari izmantot komandu /count");
                    PlayerInfo[playerid][pLevel] = 1;
                }
            }
        }
        else SendClientMessage(playerid, COLOR_WHITE, "[Kluda:] Tev vispirms ir jaielogojas");
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
SERVER: Unknown command - by rumbiic - 30.12.2009, 08:11
Re: SERVER: Unknown command - by daalz - 30.12.2009, 08:23
Re: SERVER: Unknown command - by rumbiic - 30.12.2009, 08:35
Re: SERVER: Unknown command - by dice7 - 30.12.2009, 08:43
Re: SERVER: Unknown command - by MerLow - 30.12.2009, 08:48
Re: SERVER: Unknown command - by rumbiic - 30.12.2009, 08:49
Re: SERVER: Unknown command - by dice7 - 30.12.2009, 08:51
Re: SERVER: Unknown command - by rumbiic - 30.12.2009, 08:55
Re: SERVER: Unknown command - by dice7 - 30.12.2009, 09:01
Re: SERVER: Unknown command - by MerLow - 30.12.2009, 09:02

Forum Jump:


Users browsing this thread: 1 Guest(s)