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



[Help] Unknown Command - Diablo1st - 08.04.2009

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?


Re: [Help] Unknown Command - Drift_King786 - 08.04.2009

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


Re: [Help] Unknown Command - Pyrokid - 08.04.2009

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;
    }