Unknown command
#3

Well, first, "SERVER:Unknown CMD" means that there is something wrong with the code. It is the native SA-MP error line. I can't find the issus directly.

Replace it with the bellow code and then tell us the last debug line it reads before "SERVER:Unknown CMD" This will help to pinpoint the exact spot(s) with the error.

pawn Код:
if(strcmp(cmd, "/friskcar", true) == 0)    
{
      if(IsPlayerConnected(playerid))        
      {
            if(IsACop(playerid) && PlayerInfo[playerid][pDuty] == 1)            
            {
                  SendClientMessage(playerid, -1, "[DEBUG]: You are an on-duty officer.");
                  for(new i; i != MAX_VEHICLES; i++)                
                  {
                        SendClientMessage(playerid, -1, "[DEBUG]: Maximum server vehicles now stored to i variable.");
                        new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
                        SendClientMessage(playerid, -1, "[DEBUG]: Distance to vehicle stored to dist variable.");

                        if(dist)                    
                        {
                              format(string, sizeof(string), "Materials: %d/%d.", PlayerHaul[i][pMaterials],PlayerHaul[i][pCapasity]);
                              SendClientMessage(playerid, -1, "[DEBUG]: Materials line formated.");
                              SCM(playerid, TEAM_GROVE_COLOR, string);
                              SendClientMessage(playerid, -1, "[DEBUG]: Materials line sent as SCM.");
                              format(string, sizeof(string), "Heroin: %d/%d.", PlayerHaul[i][pHeroin],PlayerHaul[i][pCapasity]);
                              SendClientMessage(playerid, -1, "[DEBUG]: Heroin line formated.");  
                              SCM(playerid, TEAM_GROVE_COLOR, string);
                              SendClientMessage(playerid, -1, "[DEBUG]: Heroin line sent as SCM.");
                              format(string, sizeof(string), "Law Enforcer opens the trunk to see what's inside..");
                              SendClientMessage(playerid, -1, "[DEBUG]: 'opens trunk' line formated.");    
                              ProxDetector(20.0, playerid, string, COLOR_RLRPGBLUE,COLOR_RLRPGBLUE,COLOR_RLRPGBLUE,COLOR_RLRPGBLUE,COLOR_RLRPGBLUE);
                              SendClientMessage(playerid, -1, "[DEBUG]: 'opens trunk' line sent to nearby players.");
                              new engine, lights, alarm, doors, bonnet, boot, objective;                    
                              SendClientMessage(playerid, -1, "[DEBUG]: Vehicle parameter variables created.");            
                              GetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, boot, objective);
                       
                            SendClientMessage(playerid, -1, "[DEBUG]: Vehicle Parameters gotten.");              
                            SetVehicleParamsEx(i, engine, lights, alarm, doors, bonnet, 1, objective);
                            SendClientMessage(playerid, -1, "[DEBUG]: Vehicle trunk opened.");
                            SetTimerEx("CloseBoot", 2000,false,"i",i);
                            SendClientMessage(playerid, -1, "[DEBUG]: Vehicle trunk close timer started.");
                            return 1;
                  }
            }
      }
return 1;
SendClientMessage(playerid, -1, "[DEBUG]: Returned in error.");
}
This will help you in the future too, as I promise you this wont be the last 'hard' bug you find in the script. Adding simple debug lines are great for self-diagnosis. It's often faster to do something like this, rather than ask here for help.
Reply


Messages In This Thread
Unknown command - by Don_Cage - 20.01.2014, 13:39
Re: Unknown command - by Hansrutger - 20.01.2014, 14:46
Re: Unknown command - by jakejohnsonusa - 20.01.2014, 15:00
Re: Unknown command - by Don_Cage - 20.01.2014, 15:02
Re: Unknown command - by Don_Cage - 20.01.2014, 15:25
Re: Unknown command - by Avi Raj - 20.01.2014, 15:27
Re: Unknown command - by Don_Cage - 20.01.2014, 15:37
Re: Unknown command - by jakejohnsonusa - 20.01.2014, 15:41
Re: Unknown command - by Don_Cage - 20.01.2014, 15:44
Re: Unknown command - by jakejohnsonusa - 20.01.2014, 15:58

Forum Jump:


Users browsing this thread: 1 Guest(s)