Command Problem
#1

Hmm i am making a DM GM, but yesterday all commands work, and today when i open server for test it again, i type /help and nothing happen, if i type /asffgshadshdfhdhfdf the server dont say unknow command please HELP.


I searched already and dont founded anithing.

Here is my OnplayerCommandText:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx, file[128], tmp[256], tmp2[256];
    cmd = strtok(cmdtext, idx);
    if (strcmp("/register", cmdtext, true, 10) == 0)
    {
      new name[MAX_PLAYER_NAME];
      tmp = strtok(cmdtext, idx);
      GetPlayerName(playerid, name, sizeof(name));
      if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /register [password]");
      format(file,sizeof(file),"%s.ini",name);
      if(!fexist(file))
            {
              dini_Create(file);
              dini_IntSet(file, "Password", udb_hash(tmp));
              dini_IntSet(file,"AdminLevel", 0);
              dini_IntSet(file,"Cash", 0);
              SendClientMessage(playerid, 0xFFFFFFFF, "[System]: Account Created!");
              PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
              GetPlayerName(playerid, name, sizeof(name));
              printf("%s has registered a account!", name);
            }
            else
            {
                SendClientMessage(playerid, 0xAA3333AA, " Account Already Found In Database");
                PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
            }
        return 1;
    }
    if (strcmp("/Kill", cmdtext, true, 10) == 0)
    {
    SetPlayerHealth(playerid,0);
    return 1;
    }
    if (strcmp("/Capture", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInPlace(playerid,2239.024,-1721.339, 2512.828, -1638.437))
          {
          if(gTeam[playerid] == TEAM_BALLAS)
            {
            GangZoneFlashForAll(Groove,TEAM_BALLAS_COLOUR);
            SetTimer("DominarBallasGroove",60000,false);
            }
            else if(gTeam[playerid] == TEAM_GROOVE)
              {
              GangZoneFlashForAll(Groove,TEAM_GROOVE_COLOUR);
              SetTimer("DominarGrooveGroove",60000,false);
              }
          }
        else if(IsPlayerInPlace(playerid,2282.1401,2425.7576,3.4692,357.7160))
          {
          if(gTeam[playerid] == TEAM_BALLAS)
            {
            GangZoneFlashForAll(Groove,TEAM_BALLAS_COLOUR);
            SetTimer("DominarBallasBallas",60000,false);
            }
            else if(gTeam[playerid] == TEAM_GROOVE)
              {
              GangZoneFlashForAll(Groove,TEAM_GROOVE_COLOUR);
              SetTimer("DominarGrooveBallas",60000,false);
              }
          }

        return 1;
    }
    if (strcmp("/Login", cmdtext, true, 10) == 0)
    {
        new PlayerName[24];
        tmp = strtok(cmdtext, idx);
        if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /login [password]");
        new name[MAX_PLAYER_NAME];
        if(IsLogged[playerid] == 1)
        {
            SendClientMessage(playerid, 0xFFFFFFFF, "You already are logged in!");
            return 1;
        }
        else
        {
            GetPlayerName(playerid, name, sizeof(name));
            format(file,sizeof(file),"%s.ini",name);
            if(fexist(file))
            {
            tmp2 = dini_Get(file, "Password");
            if(udb_hash(tmp) != strval(tmp2))
            {
                  SendClientMessage(playerid, 0xFFFFFFFF, "Login Failed!");
                  GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
                  printf("%s has failed to login", name);
            }
            else
            {
                IsLogged[playerid] = 1;
                SetPlayerMoney(playerid, dini_Int(file, "Cash"));
                PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
                SendClientMessage(playerid, 0xFFFFFFFF, "[System]: Account Logged into!");
                }
            }
        }
        return 1;
    }
    if (strcmp("/help", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, 0xFFFF00AA, "---------------------------------- HELP ----------------------------------");
        SendClientMessage(playerid, 0xFFFFFFFF, " */Commands (/cmds) -- Here you can see ALL NORMAL COMMANDS");
        SendClientMessage(playerid, 0xFFFFFFFF, " */Team Commands (/tc) -- Here you can see team commands.");
        SendClientMessage(playerid, 0xFFFFFFFF, " */Shop -- Here you can see SHOP help");
        SendClientMessage(playerid, 0xFFFFFFFF, " */Capture Help  (/ch) -- Here you can see how to capture a gang territory");
        SendClientMessage(playerid, 0xFFFFFFFF, " */AdminHelp (/ah) -- Here you can see Admin Commands (ONLY ADMINS CAN SEE)");
        SendClientMessage(playerid, 0xFFFFFFFF, " */Rules -- Here you can see Ultimate Gang Wars server rules");
        SendClientMessage(playerid, 0xFFFFFFFF, " */Info and Credits -- Here you can see GAMEMODE version and credits");
        SendClientMessage(playerid, 0xFFFF00AA, "--------------------------------------------------------------------------");
        return 1;
    }
    if(strcmp(cmd, "/Commands", true) == 0 || strcmp(cmd, "/Cmds", true) == 0)
    {
        SendClientMessage(playerid, 0xFFFF00AA, "/Changeteam");
        return 1;
    }
    if (strcmp("/gateopen", cmdtext, true, 10) == 0)
    {
        if(gTeam[playerid] == TEAM_GROOVE)
        {
            if(IsPlayerInRangeOfPoint(playerid, 9.5, 2185.05053711,-1762.59289551,15.15187073))
            {
                MoveObject(Groovegate, 2185.05053711,-1762.59289551,20.15187073, 3.5);
                SetTimer("groovegateclose",3000,false);
            }
        }
        else if(gTeam[playerid] == TEAM_VAGOS)
        {
            if(IsPlayerInRangeOfPoint(playerid, 9.5, 2185.05053711,-1762.59289551,15.15187073))
            {
                MoveObject(Vagosgate, 2461.53955078,-1658.91625977,20.07807922, 3.5);
                SetTimer("vagosgateclose",3000,false);
            }
        }
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Command Problem - by Scripter123 - 24.10.2010, 18:07
Re: Command Problem - by CSMajor - 24.10.2010, 18:15
Re: Command Problem - by Scripter123 - 24.10.2010, 18:25
Re: Command Problem - by CSMajor - 24.10.2010, 21:22
Re: Command Problem - by Luis- - 24.10.2010, 21:41
Re: Command Problem - by Scripter123 - 25.10.2010, 06:14
Re: Command Problem - by Scripter123 - 25.10.2010, 17:26
Re: Command Problem - by MadeMan - 25.10.2010, 17:28
Re: Command Problem - by Scripter123 - 25.10.2010, 19:31
Re: Command Problem - by Scripter123 - 30.10.2010, 09:58

Forum Jump:


Users browsing this thread: 4 Guest(s)