/lock CMD For Planes.
#1

Hey, It's me back !! ... I've got some problems over here, It's the /lock CMD for planes..

I've added a new dealership for planes

but when you /lock it won't !!!

When i /park, It won't too !!


Here's my /lock CMD.

pawn Код:
CMD:lock(playerid, params[])
{
    new string[128], idx, done, lockdone;
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pBiz])
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[PlayerInfo[playerid][pBiz]][bX], BizInfo[PlayerInfo[playerid][pBiz]][bY], BizInfo[PlayerInfo[playerid][pBiz]][bZ]))
        {
            if(!BizInfo[PlayerInfo[playerid][pBiz]][bStatus])
            {
                BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 1;
                format(string, sizeof(string), "ID: %d\n%s\nOwner: %s\nStatus: %s", PlayerInfo[playerid][pBiz], RBT(PlayerInfo[playerid][pBiz]), BizInfo[PlayerInfo[playerid][pBiz]][bOwner], RBS(PlayerInfo[playerid][pBiz]));
                UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBiz]][bText], COLOR_WHITE, string);
                format(string, sizeof(string), "* %s takes out their business keys and unlocks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~g~Business Unlocked", 3500, 3);
            }
            else if(BizInfo[PlayerInfo[playerid][pBiz]][bStatus])
            {
                BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 0;
                format(string, sizeof(string), "ID: %d\n%s\nOwner: %s\nStatus: %s", PlayerInfo[playerid][pBiz], RBT(PlayerInfo[playerid][pBiz]), BizInfo[PlayerInfo[playerid][pBiz]][bOwner], RBS(PlayerInfo[playerid][pBiz]));
                UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBiz]][bText], COLOR_WHITE, string);
                format(string, sizeof(string), "* %s takes out their business keys and locks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~r~Business Locked", 3500, 3);
            }
            done = 1;
            lockdone = 1;
        }
    }
    if(PlayerInfo[playerid][pVBiz] && !done)
    {
        idx = PlayerInfo[playerid][pVBiz];
        if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
        {
            if(!BizInfo[idx][bStatus])
            {
                BizInfo[idx][bStatus] = 1;
                format(string, sizeof(string), "ID: %d\n%s\nOwner: %s\nStatus: %s", idx, RBT(idx), BizInfo[idx][bOwner], RBS(idx));
                UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
                format(string, sizeof(string), "* %s takes out their business keys and unlocks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~g~Business Unlocked", 3500, 3);
            }
            else if(BizInfo[idx][bStatus])
            {
                BizInfo[idx][bStatus] = 0;
                format(string, sizeof(string), "ID: %d\n%s\nOwner: %s\nStatus: %s", idx, RBT(idx), BizInfo[idx][bOwner], RBS(idx));
                UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
                format(string, sizeof(string), "* %s takes out their business keys and locks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~r~Business Locked", 3500, 3);
            }
            done = 1;
            lockdone = 1;
        }
    }
    if(PlayerInfo[playerid][pHouse])
    {
        idx = PlayerInfo[playerid][pHouse];
        if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ]))
        {
            if(!HouseInfo[PlayerInfo[playerid][pHouse]][hStatus])
            {
                HouseInfo[PlayerInfo[playerid][pHouse]][hStatus] = 1;
                format(string, sizeof(string), "ID: %d\nHouse (Lvl: %d)\nOwner: %s\nStatus: %s", idx, HouseInfo[idx][hLevel], HouseInfo[idx][hOwner], RHS(idx));
                UpdateDynamic3DTextLabelText(HouseInfo[PlayerInfo[playerid][pHouse]][hText], COLOR_WHITE, string);
                format(string, sizeof(string), "* %s takes out their house keys and unlocks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~g~House Unlocked", 3500, 3);
            }
            else if(HouseInfo[PlayerInfo[playerid][pHouse]][hStatus])
            {
                HouseInfo[PlayerInfo[playerid][pHouse]][hStatus] = 0;
                format(string, sizeof(string), "ID: %d\nHouse (Lvl: %d)\nOwner: %s\nStatus: %s", idx, HouseInfo[idx][hLevel], HouseInfo[idx][hOwner], RHS(idx));
                UpdateDynamic3DTextLabelText(HouseInfo[PlayerInfo[playerid][pHouse]][hText], COLOR_WHITE, string);
                format(string, sizeof(string), "* %s takes out their house keys and locks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~r~House Locked", 3500, 3);
            }
            done = 1;
            lockdone = 1;
        }
    }
    if(PlayerInfo[playerid][pVHouse] && !done)
    {
        idx = PlayerInfo[playerid][pVHouse];
        if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ]))
        {
            if(!HouseInfo[PlayerInfo[playerid][pVHouse]][hStatus])
            {
                HouseInfo[PlayerInfo[playerid][pVHouse]][hStatus] = 1;
                format(string, sizeof(string), "ID: %d\nHouse (Lvl: %d)\nOwner: %s\nStatus: %s", idx, HouseInfo[idx][hLevel], HouseInfo[idx][hOwner], RHS(idx));
                UpdateDynamic3DTextLabelText(HouseInfo[PlayerInfo[playerid][pVHouse]][hText], COLOR_WHITE, string);
                format(string, sizeof(string), "* %s takes out their house keys and unlocks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~g~House Unlocked", 3500, 3);
            }
            else if(HouseInfo[PlayerInfo[playerid][pVHouse]][hStatus])
            {
                HouseInfo[PlayerInfo[playerid][pVHouse]][hStatus] = 0;
                format(string, sizeof(string), "ID: %d\nHouse (Lvl: %d)\nOwner: %s\nStatus: %s", idx, HouseInfo[idx][hLevel], HouseInfo[idx][hOwner], RHS(idx));
                UpdateDynamic3DTextLabelText(HouseInfo[PlayerInfo[playerid][pVHouse]][hText], COLOR_WHITE, string);
                format(string, sizeof(string), "* %s takes out their house keys and locks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~r~House Locked", 3500, 3);
            }
            lockdone = 1;
            return 1;
        }
    }
    if(PlayerInfo[playerid][pVeh] || PlayerInfo[playerid][pVVeh])
    {
        new Float:vx, Float:vy, Float:vz;
        GetVehiclePos(PlayerInfo[playerid][pVeh], vx, vy, vz);
        if(IsPlayerInRangeOfPoint(playerid, 3, vx, vy, vz))
        {
            idx = PlayerInfo[playerid][pVeh];
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
            if(doors)
            {

                SetVehicleParamsEx(idx, engine, lights, alarm, 0, bonnet, boot, objective);
                PlayerInfo[playerid][vLocked] = 0;
                format(string, sizeof(string), "* %s takes out their vehicle keys and unlocks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~g~Vehicle Unlocked", 3500, 3);
            }
            else
            {
                SetVehicleParamsEx(idx, engine, lights, alarm, 1, bonnet, boot, objective);
                PlayerInfo[playerid][vLocked] = 1;
                format(string, sizeof(string), "* %s takes out their vehicle keys and locks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~r~Vehicle Locked", 3500, 3);
            }
            lockdone = 1;
            return 1;
        }
        GetVehiclePos(PlayerInfo[playerid][pVVeh], vx, vy, vz);
        if(IsPlayerInRangeOfPoint(playerid, 3, vx, vy, vz))
        {
            idx = PlayerInfo[playerid][pVVeh];
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(idx, engine, lights, alarm, doors, bonnet, boot, objective);
            if(doors)
            {

                SetVehicleParamsEx(idx, engine, lights, alarm, 0, bonnet, boot, objective);
                PlayerInfo[playerid][vVLocked] = 0;
                format(string, sizeof(string), "* %s takes out their vehicle keys and unlocks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~g~Vehicle Unlocked", 3500, 3);
            }
            else
            {
                SetVehicleParamsEx(idx, engine, lights, alarm, 1, bonnet, boot, objective);
                PlayerInfo[playerid][vVLocked] = 1;
                format(string, sizeof(string), "* %s takes out their vehicle keys and locks it.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                GameTextForPlayer(playerid, "~r~Vehicle Locked", 3500, 3);
            }
            lockdone = 1;
        }
        return 1;
    }
    if(!lockdone)
    {
        SendClientMessage(playerid, COLOR_GREY, "You are not near something you can lock/unlock.");
    }
    return 1;
}
Here's my /park CMD.

pawn Код:
CMD:park(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a vehicle.");
    // Family Vehicles
    if(IsFamVehicle(GetPlayerVehicleID(playerid)) && Fam[GetPlayerVehicleID(playerid)] == PlayerInfo[playerid][pFam])
    {
        new idx = PlayerInfo[playerid][pFam], veh = GFVS(GetPlayerVehicleID(playerid));

        GetVehiclePos(GetPlayerVehicleID(playerid), FamInfo[idx][fVehCoX][veh], FamInfo[idx][fVehCoY][veh], FamInfo[idx][fVehCoZ][veh]);
        GetVehicleZAngle(GetPlayerVehicleID(playerid), FamInfo[idx][fVehRot][veh]);
        if(FamInfo[idx][fVehType][veh])
        {
            DestroyVehicle(FamInfo[idx][fVeh][veh]);
        }
        FamInfo[idx][fVeh][veh] = CreateVehicle(FamInfo[idx][fVehType][veh], FamInfo[idx][fVehCoX][veh], FamInfo[idx][fVehCoY][veh], FamInfo[idx][fVehCoZ][veh], FamInfo[idx][fVehRot][veh], FamInfo[idx][fVehCol1][veh], FamInfo[idx][fVehCol2][veh], 1200);
        ChangeVehicleColor(FamInfo[idx][fVeh][veh], FamInfo[idx][fVehCol1][veh], FamInfo[idx][fVehCol2][veh]);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have parked your family vehicle, it will always spawn here until you park it somewhere else.");
        return 1;
    }
    // Owned Vehicles
    if(GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVeh] && GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVVeh]) return SendClientMessage(playerid, COLOR_GREY, "You are not in a vehicle you can park.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have parked your vehicle, it will always spawn here until you park it somewhere else.");
    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVeh])
    {
        for(new i=0; i<14; i++)
        {
            PlayerInfo[playerid][pVehMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][pVeh], i);
        }
        GetVehiclePos(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ]);
        GetVehicleZAngle(PlayerInfo[playerid][pVeh],PlayerInfo[playerid][vA]);
        DestroyVehicle(PlayerInfo[playerid][pVeh]);
        PlayerInfo[playerid][pVeh] = CreateVehicle(PlayerInfo[playerid][vModel], PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ],PlayerInfo[playerid][vA],PlayerInfo[playerid][vC1],PlayerInfo[playerid][vC2],1200);
        ChangeVehiclePaintjob(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vPJ]);
        for(new i=0; i<14; i++)
        {
            AddVehicleComponent(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVehMod][i]);
        }
    }
    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVVeh])
    {
        for(new i=0; i<14; i++)
        {
            PlayerInfo[playerid][pVVehMod][i] = GetVehicleComponentInSlot(PlayerInfo[playerid][pVVeh], i);
        }
        GetVehiclePos(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ]);
        GetVehicleZAngle(PlayerInfo[playerid][pVVeh],PlayerInfo[playerid][vVA]);
        DestroyVehicle(PlayerInfo[playerid][pVVeh]);
        PlayerInfo[playerid][pVVeh] = CreateVehicle(PlayerInfo[playerid][vVModel], PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ],PlayerInfo[playerid][vVA],PlayerInfo[playerid][vVC1],PlayerInfo[playerid][vVC2],1200);
        ChangeVehiclePaintjob(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][vVPJ]);
        for(new i=0; i<14; i++)
        {
            AddVehicleComponent(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][pVVehMod][i]);
        }
    }
    return 1;
}
Hope you help me...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)