Why my pawn crash?[+REP]
#1

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new newcar = GetPlayerVehicleID(playerid);
    new string[128];
    if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5,298.2446, 201.8958, 889.5491))
    {
        MoveObject(PrisonGate1,296.96875000,207.98828125,892.72052002, 2.2500000);
        SetTimer("PrisonGate", 4500, false);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5,295.3155, 211.4049, 889.5491))
    {
        MoveObject(PrisonGate1, 296.96875000, 207.98828125, 892.72052002, 2.2500000);
        SetTimer("PrisonGate", 4500, false);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5,295.3083, 234.5880, 889.5491))
    {
        MoveObject(PrisonGate2, 299.06845093,231.52783203,888.54907227, 2.2500000);
        MoveObject(PrisonGate3, 299.00900269,228.50942993,888.54907227, 2.2500000);
        SetTimer("PrisonGate4Opens", 3000, false);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5,299.8243, 227.9879, 889.5491))
    {
        MoveObject(PrisonGate2, 299.06845093,231.52783203,888.54907227, 2.2500000);
        MoveObject(PrisonGate3, 299.00900269,228.50942993,888.54907227, 2.2500000);
        SetTimer("PrisonGate4Opens", 3000, false);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 323.8190, 230.1355, 889.5491))
    {
        MoveObject(PrisonGate5,318.01525879,231.82656860,891.18591309, 2.500000);
        SetTimer("PrisonGate", 4500, false);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 335.1102, 220.0642, 889.5491))
    {
        MoveObject(PrisonGate6,335.65136719,222.08398438,892.64837646, 2.500000);
        SetTimer("PrisonGateForVisitors", 3500, false);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 336.2267, 223.9015, 889.5491))
    {
        MoveObject(PrisonGate6,335.65136719,222.08398438,892.64837646, 2.500000);
        SetTimer("PrisonGateForVisitors", 3500, false);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 320.2110,216.9101,889.5491))//From ENTER PRISON to PRISON
    {
        SetPlayerPos(playerid, 371.36816,183.34472,889.29827);
        SetPlayerInterior(playerid, 1);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 371.36816,183.34472,889.29827))//From PRISON to ENTER PRISON
    {
        SetPlayerPos(playerid, 320.2110,216.9101,889.5491);
        SetPlayerInterior(playerid, 1);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 410.4096,164.0016,895.9006))//Like down ^^
    {
        SetObjectRot(PrisonGate7,0.00000000,0.00000000,109.99514771);
        SetTimer("RotateObjectback", 4000, false);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 410.2949,165.4837,895.9006))//Upper gates who can open only a police?
    {
        SetObjectRot(PrisonGate7,0.00000000,0.00000000,109.99514771);
        SetTimer("RotateObjectback", 4000, false);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.5, 369.2244,170.9349,889.5491))//Gates who opens only for police to ISO 1,2
    {
        MoveObject(PrisonGate8,368.68524170,169.67308044,888.54907227, 2.500000);
        SetTimer("InPrisonGate", 3000, false);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 363.3798,155.9887,889.5491))//ISO 2
    {
        SetPlayerPos(playerid,304.12487793,158.95205688,886.36791992);
        SetPlayerInterior(playerid, 1);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 362.9739,153.6197,889.5491))//ISO 1
    {
        SetPlayerPos(playerid,303.79785156,144.47070312,886.36791992);
        SetPlayerInterior(playerid, 1);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 405.8181,181.2119,895.9006))//Open/Close cells dialog
    {
        ShowPlayerDialog(playerid, 1335, DIALOG_STYLE_LIST, " Please Choose what you want to do...","Open the Cells\nClose the Cells","Ok","Cancel");
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 2.0, 416.7481,159.0282,895.9077))//Gym enter?
    {
        SetPlayerPos(playerid,409.62695312,96.86425781,896.03515625);
        SetPlayerInterior(playerid, 1);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 1.0, 409.62695312,96.86425781,896.03515625))//GYM exit?
    {
        SetPlayerPos(playerid,416.7481,159.0282,895.9077);
        SetPlayerInterior(playerid, 1);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 5.0, 303.79785156,144.47070312,886.36791992))//From ISO 1 to PRISON
    {
        SetPlayerPos(playerid,362.9739,153.6197,889.5491);
        SetPlayerInterior(playerid, 1);
    }
    else if(PRESSED(KEY_WALK) && IsPlayerInRangeOfPoint(playerid, 5.0, 304.12487793,158.95205688,886.36791992))//From ISO 2 to PRISON
    {
        SetPlayerPos(playerid,363.3798,155.9887,889.5491);
        SetPlayerInterior(playerid, 1);
    }
    return 1;
}
    if(newkeys == KEY_SECONDARY_ATTACK)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            GetVehicleParamsEx(newcar, engine, lights, alarm, doors, bonnet, boot, objective);
            if(engine != 1)
            {
                RemovePlayerFromVehicle(playerid);
                TogglePlayerControllable(playerid, 1);
                return 1;
            }
            else
            {
                RemovePlayerFromVehicle(playerid);
                TogglePlayerControllable(playerid, 1);
                NoFuel[playerid] = 0;
                return 1;
            }
        }
    }
Guys i have bug in this code my pawn crash when i do this codes what's wrong here?
Reply


Messages In This Thread
Why my pawn crash?[+REP] - by Chris_Morrison - 07.07.2012, 11:13
Re: Why my pawn crash?[+REP] - by FireCat - 07.07.2012, 11:14
Re: Why my pawn crash?[+REP] - by ToiletDuck - 07.07.2012, 11:18
Re: Why my pawn crash?[+REP] - by Chris_Morrison - 07.07.2012, 11:23
Re: Why my pawn crash?[+REP] - by CmZxC - 07.07.2012, 11:24
Re: Why my pawn crash?[+REP] - by newbienoob - 07.07.2012, 11:25
Re: Why my pawn crash?[+REP] - by Chris_Morrison - 07.07.2012, 11:31
Re: Why my pawn crash?[+REP] - by Roko_foko - 07.07.2012, 11:32
Re: Why my pawn crash?[+REP] - by Chris_Morrison - 07.07.2012, 11:34
Re: Why my pawn crash?[+REP] - by Chris_Morrison - 07.07.2012, 12:02

Forum Jump:


Users browsing this thread: 1 Guest(s)