[Help] Unknown Command
#1

hello
i was checking a little command for lock cars but when i use the command works but i recive Unknown Command but i have add the "return something" at the end of the command

pawn Код:
if(strcmp(cmd, "/lock", true) == 0)
    {
        if (GetPlayerState(playerid) == 2)
        {
            if(GetCreatorID(vehicleid) != 0)
            {
                if(strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid)))
                {
                    for(new ip = 0; ip < MAX_PLAYERS; ip++)
                    {
                        if(ip != playerid)
                        {
                            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), ip, 0, 1);
                        }
                        SendClientMessage(playerid, COLOR_GRAD4, "* Veicolo Chiuso");
              new Float:pX, Float:pY, Float:pZ;
                        GetPlayerPos(playerid,pX,pY,pZ);
                        PlayerPlaySound(playerid,1056,pX,pY,pZ);
                        CarInfo[vehicleid][cLock] = 1;
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "Aiuto: Non puoi chiudere un veicolo che non и di tua proprietа!");
                    return 1;
                }
            }
            else
            {
                for(new ip = 0; ip < MAX_PLAYERS; ip++)
                {
                    if(ip != playerid)
                    {
                        SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), ip, 0, 1);
                    }
                    SendClientMessage(playerid, COLOR_GRAD4, "* Veicolo Chiuso");
          new Float:pX, Float:pY, Float:pZ;
                    GetPlayerPos(playerid,pX,pY,pZ);
                    PlayerPlaySound(playerid,1056,pX,pY,pZ);
                    CarInfo[vehicleid][cLock] = 1;
                    return 1;
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "Aiuto: Puoi chiudere un veicolo solo al posto di guida!");
        }
        return 1;
    }
can some one check if i have made some mistakes?
Reply
#2

i also got the similar type of problem for a different command
the command works but it still showed that message
Reply
#3

You don't have to put return 1 after everything...
pawn Код:
if(strcmp(cmd, "/lock", true) == 0)
    {
        if (GetPlayerState(playerid) == 2)
        {
            if(GetCreatorID(vehicleid) != 0)
            {
                if(strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid)))
                {
                    for(new ip = 0; ip < MAX_PLAYERS; ip++)
                    {
                        if(ip != playerid)
                        {
                            SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), ip, 0, 1);
                        }
                        SendClientMessage(playerid, COLOR_GRAD4, "* Veicolo Chiuso");
              new Float:pX, Float:pY, Float:pZ;
                        GetPlayerPos(playerid,pX,pY,pZ);
                        PlayerPlaySound(playerid,1056,pX,pY,pZ);
                        CarInfo[vehicleid][cLock] = 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "Aiuto: Non puoi chiudere un veicolo che non и di tua proprietа!");
                }
            }
            else
            {
                for(new ip = 0; ip < MAX_PLAYERS; ip++)
                {
                    if(ip != playerid)
                    {
                        SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), ip, 0, 1);
                    }
                    SendClientMessage(playerid, COLOR_GRAD4, "* Veicolo Chiuso");
          new Float:pX, Float:pY, Float:pZ;
                    GetPlayerPos(playerid,pX,pY,pZ);
                    PlayerPlaySound(playerid,1056,pX,pY,pZ);
                    CarInfo[vehicleid][cLock] = 1;
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "Aiuto: Puoi chiudere un veicolo solo al posto di guida!");
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)