[ERROR] HELP ME! UNKNOWN COMMAND...
#1

where is incorrect on my command? Because this send a message "Unknown Command" in server...
the command works. But it sends "Unknown command" after "Spec On!"

pawn Код:
dcmd_spec(playerid,params[])
{
  if(IsPlayerAdmin(playerid))
    {
      if(!strlen(params) || !IsNumeric(params)) return
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /lspec [PlayerID]") &&
        SendClientMessage(playerid, orange, "Function: Will spec a specified Player");

        new specid = strval(params);
       
    if(IsPlayerConnected(specplayerid) && specid != INVALID_PLAYER_ID)
        {
            if(specid == playerid)
            return SendClientMessage(playerid, red, "ERROR");
            if(GetPlayerState(specid) == PLAYER_STATE_SPECTATING && INFO[specid][ID] != INVALID_PLAYER_ID)
            return SendClientMessage(playerid, red, "ERROR");
            if(GetPlayerState(specid) != 2 && GetPlayerState(specplayerid) != 1 && GetPlayerState(specplayerid) != 3)
            return SendClientMessage(playerid, red, "ERROR");
           
            if( (INFO[specid][POSI] != svInfo[ADM]) || (INFO[specid][POSI] == svInfo[ADM] && INFO[playerid][POSI] == svInfo[ADM]))
            {
                LoadSpec(playerid, specid);
                GetPlayerPos(playerid,POSITION[playerid][0],POSITION[playerid][1],POSITION[playerid][2]);
                GetPlayerFacingAngle(playerid,POSITION[playerid][3]);
                return SendClientMessage(playerid,blue,"Spec ON!");
            }
        }
    }
}
Reply
#2

pawn Код:
dcmd_spec(playerid,params[])
{
  if(IsPlayerAdmin(playerid))
    {
      if(!strlen(params) || !IsNumeric(params)) return
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /lspec [PlayerID]") &&
        SendClientMessage(playerid, orange, "Function: Will spec a specified Player");

        new specid = strval(params);
       
    if(IsPlayerConnected(specplayerid) && specid != INVALID_PLAYER_ID)
        {
            if(specid == playerid)
            return SendClientMessage(playerid, red, "ERROR");
            if(GetPlayerState(specid) == PLAYER_STATE_SPECTATING && INFO[specid][ID] != INVALID_PLAYER_ID)
            return SendClientMessage(playerid, red, "ERROR");
            if(GetPlayerState(specid) != 2 && GetPlayerState(specplayerid) != 1 && GetPlayerState(specplayerid) != 3)
            return SendClientMessage(playerid, red, "ERROR");
           
            if( (INFO[specid][POSI] != svInfo[ADM]) || (INFO[specid][POSI] == svInfo[ADM] && INFO[playerid][POSI] == svInfo[ADM]))
            {
                LoadSpec(playerid, specid);
                GetPlayerPos(playerid,POSITION[playerid][0],POSITION[playerid][1],POSITION[playerid][2]);
                GetPlayerFacingAngle(playerid,POSITION[playerid][3]);
                return SendClientMessage(playerid,blue,"Spec ON!");
            }
        }
    }
    return 1;
}
That should fix it.

[Doppeyy
Reply
#3

Only put "return 1;"
Reply
#4

Ok, thank guys.
And help me in this: (SAME ERROR):

pawn Код:
stock LoadSpec(playerid, specplayerid)
{
    for(new x=0; x<MAX_PLAYERS; x++)
    {
      if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && INFO[x][ID] == playerid)
        {
       SPECTATE2(x); }
    }
    SetPlayerInterior(playerid,GetPlayerInterior(specplayerid));
    TogglePlayerSpectating(playerid, 1);

    if(IsPlayerInAnyVehicle(specplayerid)) {
        PlayerSpectateVehicle(playerid, GetPlayerVehicleID(specplayerid));
        INFO[playerid][ID] = specplayerid;
        INFO[playerid][TYPW] = ADMIN_SPEC_TYPE_VEHICLE;
    }else {
        PlayerSpectatePlayer(playerid, specid);
        INFO[playerid][ID] = specplayerid;
        INFO[playerid][TYPE] = ADMIN_SPEC_TYPE_PLAYER;
    }
    for(new i = 0; i < MAX_PLAYERS; i++) {
    TextDrawShowForPlayer(playerid,SPEC[i]);
    TextDrawSetString(SPEC[i], "SPEC TEXT");
    }
    return 1;
}
Reply
#5

Pleaase, someone help me
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)