Help with break lock timing system
#3

Try this

pawn Код:
command(breaklock, playerid, params[])
{
    new lockBreakTime;
    for(new h; h < MAX_HOUSES; h++) {
        if(IsPlayerInRangeOfPoint(playerid, 3.5, HD[h][exteriorX], HD[h][exteriorY], HD[h][exteriorZ])) {
            if(HD[h][locklevel] == 0) return SendClientMessage(playerid, COLOR_WHITE, "This house doesn't have a lock!");
            lockBreakTime = HD[h][locklevel] * 35 + random(20);
            TogglePlayerControllable(playerid, 0);
            SetTimerEx("BreakHouseLock", 1000, false, "did", h, playerid, lockBreakTime);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3.5, HD[h][interiorX], HD[h][interiorY], HD[h][interiorZ]) && GetPlayerInterior(playerid) == HD[h][interiorInt]) {
            if(GetPlayerVirtualWorld(playerid) == h) {
                if(HD[h][locklevel] == 0) return SendClientMessage(playerid, COLOR_WHITE, "This house doesn't have a lock!");
                lockBreakTime = HD[h][locklevel] * 40 + random(20);
                TogglePlayerControllable(playerid, 0);
                SetTimerEx("BreakHouseLock", 1000, false, "did", h, playerid, lockBreakTime);
            }
        }
    }
    return 1;
}
pawn Код:
public BreakHouseLock(houseid, playerid, time)
{
    time--;
    if(time == 0)
    {
        SendClientMessage(playerid, COLOR_WHITE, "You broke the lock on the house!");
        HD[houseid][locked] = 0;
        HD[houseid][locklevel] = 0;
        TogglePlayerControllable(playerid, 1);
    }
    else
    {
        new string[128];
        format(string, sizeof(string), "Breaking Lock~n~%d seconds remaining", time);
        GameTextForPlayer(playerid, string, 900, 1);
        SetTimerEx("BreakHouseLock", 1000, false, "did", houseid, playerid, time);
    }
}
Reply


Messages In This Thread
Help with break lock timing system - by jameskmonger - 14.05.2011, 09:44
AW: Help with break lock timing system - by Nero_3D - 14.05.2011, 11:47
Re: Help with break lock timing system - by MadeMan - 14.05.2011, 14:25
Re: Help with break lock timing system - by jameskmonger - 14.05.2011, 17:36
Re: Help with break lock timing system - by jameskmonger - 15.05.2011, 07:09

Forum Jump:


Users browsing this thread: 1 Guest(s)