SA-MP Forums Archive
SERVER: Unknown Command - 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: SERVER: Unknown Command (/showthread.php?tid=140088)



SERVER: Unknown Command - Hiddos - 07.04.2010

I've been working on a housing system for my server, and I just made the enter command. Although it makes me enter the house and does what the command should, it as well gives me a SERVER: Unknown Command. Anybody has an idea how this is happening?

This is my script:
pawn Код:
if(strcmp(cmd,"/enter",true) == 0)
    {
      new hCount = 0;
      for(new h; h <= MAX_HOUSES; h++)
      {
        if(PlayerToPoint(MaxPTP,playerid,HouseInfo[h][hX],HouseInfo[h][hY],HouseInfo[h][hZ]))
        {
          hCount += 1;
          if(HouseInfo[h][hLocked] == 0 || !strcmp(pName,HouseInfo[h][hOwner],true) && IsPlayerLogged(playerid))
          {
                    EnterHouse(playerid,h);
                    if(strcmp(HouseInfo[h][hOwner],pName,true) == 0) format(string,sizeof(string),"SERVER: Welcome home, %s.",pName);
                    else format(string,sizeof(string),"SERVER: Welcome in %s's house, %s.",HouseInfo[h][hOwner],pName);
                    SendClientMessage(playerid,COLOR_ROYALBLUE,string);
                }
                else SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: This house is locked!");
            }
        }
        if(hCount == 0) SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: You aren't near any house!");
        return 1;
    }



Re: SERVER: Unknown Command - -Rebel Son- - 07.04.2010

Код:
if(strcmp(cmd,"/enter",true) == 0)
{
  new hCount = 0;
  for(new h; h <= MAX_HOUSES; h++)
  {
    if(PlayerToPoint(MaxPTP,playerid,HouseInfo[h][hX],HouseInfo[h][hY],HouseInfo[h][hZ]))
    {
      hCount += 1;
      if(HouseInfo[h][hLocked] == 0 || !strcmp(pName,HouseInfo[h][hOwner],true) && IsPlayerLogged(playerid))
      {
EnterHouse(playerid,h);
if(strcmp(HouseInfo[h][hOwner],pName,true) == 0) format(string,sizeof(string),"SERVER: Welcome home, %s.",pName);
else format(string,sizeof(string),"SERVER: Welcome in %s's house, %s.",HouseInfo[h][hOwner],pName);
SendClientMessage(playerid,COLOR_ROYALBLUE,string);
}
else SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: This house is locked!");
{
if(hCount == 0) SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: You aren't near any house!");
}
}
return 1;
}
Try this


Re: SERVER: Unknown Command - Hiddos - 07.04.2010

Tried it. Still gives me an Unknown Command and gives me 300 times 'You aren't near any house'


Re: SERVER: Unknown Command - Hiddos - 07.04.2010

Err, bump?


Re: SERVER: Unknown Command - Hiddos - 08.04.2010

Bump


Re: SERVER: Unknown Command - Hiddos - 09.04.2010

Another bump, does seriously nobody has an idea what causes this and how I can stop it?


Re: SERVER: Unknown Command - Grim_ - 09.04.2010

Is OnPlayerCommandText returning 0?


Re: SERVER: Unknown Command - armyoftwo - 09.04.2010

Код:
if(strcmp(cmd,"/enter",true) == 0)
{
  new hCount = 0;
  for(new h; h <= MAX_HOUSES; h++)
  {
    if(PlayerToPoint(MaxPTP,playerid,HouseInfo[h][hX],HouseInfo[h][hY],HouseInfo[h][hZ]))
    {
      hCount += 1;
      if(HouseInfo[h][hLocked] == 0 || !strcmp(pName,HouseInfo[h][hOwner],true) && IsPlayerLogged(playerid))
      {
EnterHouse(playerid,h);
if(strcmp(HouseInfo[h][hOwner],pName,true) == 0) format(string,sizeof(string),"SERVER: Welcome home, %s.",pName);
else format(string,sizeof(string),"SERVER: Welcome in %s's house, %s.",HouseInfo[h][hOwner],pName);
SendClientMessage(playerid,COLOR_ROYALBLUE,string);
}
else SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: This house is locked!");
{
if(hCount == 0) SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: You aren't near any house!");
}
}
}
return 1;
}
try this


Re: SERVER: Unknown Command - Hiddos - 09.04.2010

Quote:
Originally Posted by _Xerxes_
Is OnPlayerCommandText returning 0?
yes

Quote:
Originally Posted by armyoftwo
Код:
if(strcmp(cmd,"/enter",true) == 0)
{
  new hCount = 0;
  for(new h; h <= MAX_HOUSES; h++)
  {
    if(PlayerToPoint(MaxPTP,playerid,HouseInfo[h][hX],HouseInfo[h][hY],HouseInfo[h][hZ]))
    {
      hCount += 1;
      if(HouseInfo[h][hLocked] == 0 || !strcmp(pName,HouseInfo[h][hOwner],true) && IsPlayerLogged(playerid))
      {
EnterHouse(playerid,h);
if(strcmp(HouseInfo[h][hOwner],pName,true) == 0) format(string,sizeof(string),"SERVER: Welcome home, %s.",pName);
else format(string,sizeof(string),"SERVER: Welcome in %s's house, %s.",HouseInfo[h][hOwner],pName);
SendClientMessage(playerid,COLOR_ROYALBLUE,string);
}
else SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: This house is locked!");
{
if(hCount == 0) SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: You aren't near any house!");
}
}
}
return 1;
}
try this
Still the same


Re: SERVER: Unknown Command - Micko9 - 09.04.2010

Quote:
Originally Posted by Hiddos
Quote:
Originally Posted by _Xerxes_
Is OnPlayerCommandText returning 0?
yes

Quote:
Originally Posted by armyoftwo
Код:
if(strcmp(cmd,"/enter",true) == 0)
{
  new hCount = 0;
  for(new h; h <= MAX_HOUSES; h++)
  {
    if(PlayerToPoint(MaxPTP,playerid,HouseInfo[h][hX],HouseInfo[h][hY],HouseInfo[h][hZ]))
    {
      hCount += 1;
      if(HouseInfo[h][hLocked] == 0 || !strcmp(pName,HouseInfo[h][hOwner],true) && IsPlayerLogged(playerid))
      {
EnterHouse(playerid,h);
if(strcmp(HouseInfo[h][hOwner],pName,true) == 0) format(string,sizeof(string),"SERVER: Welcome home, %s.",pName);
else format(string,sizeof(string),"SERVER: Welcome in %s's house, %s.",HouseInfo[h][hOwner],pName);
SendClientMessage(playerid,COLOR_ROYALBLUE,string);
}
else SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: This house is locked!");
{
if(hCount == 0) SendClientMessage(playerid,COLOR_STEELBLUE,"SERVER: You aren't near any house!");
}
}
}
return 1;
}
try this
Still the same
stop bumping and answer : IS OnPlayerCommandText returning 0 so is there on the end of OnPlayerCommandText :

pawn Код:
return 0;