Seems weird
#1

<removed>
Reply
#2

After the bracket of the last one else, add return 1;
Try this:

Код:
forward BreakVehicleLock(playerid, vehicleid, ownerid, carslot, family);
public BreakVehicleLock(playerid, vehicleid, ownerid, carslot, family)
{
    new rand = random(7), string[128];
    TogglePlayerControllable(playerid, 1);
    if(rand == 1 || rand == 2) // Successful
    {
        if(IsAMPBike(PlayerVehicleInfo[playerid][vehicleid][pvId]) || IsABike(PlayerVehicleInfo[playerid][vehicleid][pvBId]))
        {
            format(string, sizeof(string), "* %s successfully breaks the chain lock, unwrapping the chain off the back tire.", GetPlayerNameEx(playerid));
            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

            //PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
            //PlayerVehicleInfo[playerid][d][pvBLocked] = 1;
            new engine,lights,alarm,doors,bonnet,boot,objective;
            GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
            SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);
            return 0;
        }
        format(string, sizeof(string), "* %s successfully breaks the lock on the door, opening it.", GetPlayerNameEx(playerid));
        ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

        new engine,lights,alarm,doors,bonnet,boot,objective;
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
        SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);

        if(family == 0)
        {
            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
            PlayerVehicleInfo[ownerid][carslot][pvLocked] = 1;
            UnLockPlayerVehicle(ownerid, PlayerVehicleInfo[ownerid][carslot][pvId], PlayerVehicleInfo[ownerid][carslot][pvLock]);
        }
        else
        {
            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
            FamilyVehicleInfo[ownerid][carslot][fvLocked] = 1;
            UnLockGangVehicle(ownerid, FamilyVehicleInfo[ownerid][carslot][fvId], FamilyVehicleInfo[ownerid][carslot][fvLock]);
        }
    }
    else
    {
        format(string, sizeof(string), "* %s is unable to break the vehicle lock.", GetPlayerNameEx(playerid));
        ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
return 1;
}
Reply
#3

Quote:
Originally Posted by dirigent00
Посмотреть сообщение
After the bracket of the last one else, add return 1;
Try this:

Код:
forward BreakVehicleLock(playerid, vehicleid, ownerid, carslot, family);
public BreakVehicleLock(playerid, vehicleid, ownerid, carslot, family)
{
    new rand = random(7), string[128];
    TogglePlayerControllable(playerid, 1);
    if(rand == 1 || rand == 2) // Successful
    {
        if(IsAMPBike(PlayerVehicleInfo[playerid][vehicleid][pvId]) || IsABike(PlayerVehicleInfo[playerid][vehicleid][pvBId]))
        {
            format(string, sizeof(string), "* %s successfully breaks the chain lock, unwrapping the chain off the back tire.", GetPlayerNameEx(playerid));
            ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

            //PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
            //PlayerVehicleInfo[playerid][d][pvBLocked] = 1;
            new engine,lights,alarm,doors,bonnet,boot,objective;
            GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
            SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
            SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);
            return 0;
        }
        format(string, sizeof(string), "* %s successfully breaks the lock on the door, opening it.", GetPlayerNameEx(playerid));
        ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

        new engine,lights,alarm,doors,bonnet,boot,objective;
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vehicleid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
        SetTimerEx("DisableVehicleAlarm", 30000, 0, "d",  vehicleid);

        if(family == 0)
        {
            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
            PlayerVehicleInfo[ownerid][carslot][pvLocked] = 1;
            UnLockPlayerVehicle(ownerid, PlayerVehicleInfo[ownerid][carslot][pvId], PlayerVehicleInfo[ownerid][carslot][pvLock]);
        }
        else
        {
            PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
            FamilyVehicleInfo[ownerid][carslot][fvLocked] = 1;
            UnLockGangVehicle(ownerid, FamilyVehicleInfo[ownerid][carslot][fvId], FamilyVehicleInfo[ownerid][carslot][fvLock]);
        }
    }
    else
    {
        format(string, sizeof(string), "* %s is unable to break the vehicle lock.", GetPlayerNameEx(playerid));
        ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
return 1;
}
How dumb I am?
Thanks mate, it was fixed

++ REP'ed
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)