Police lights turn off all the time
#1

When I type /lock, police lights and sirens turn off. This is my code, I don't see what's wrong with it:

pawn Код:
CMD:lock(playerid)
{
    if(GetPlayerColor(playerid) == COLOR_POLICE)
    {
        for(new v = 0; v < MAX_VEHICLES; v ++)
        {
            for(new i=0;i<MAX_CUSTOM_VEHICLES;i++){
                if(v == car[i])
                {
                    new Float: vpos[3];
                    GetVehiclePos(v,vpos[0],vpos[1],vpos[2]);
                    if(IsPlayerInRangeOfPoint(playerid,3.0,vpos[0],vpos[1],vpos[2]))
                    {
                        new engine,lights,alarm,doors,bonnet,boot,objective, string[80];
                        GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
   
                        if (doors != VEHICLE_PARAMS_ON)
                        {
                            //SetVehicleParamsEx(v,engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
                            SetVehicleParamsForAll(v, 0, 1);
                            format(string, sizeof(string), "~w~%s ~r~Locked",GetVehicleName(v));
                            GameTextForPlayer(playerid, string, 1000, 4);
                            return 1;
                        }
                        else
                        {
                            //SetVehicleParamsEx(v,engine,lights,alarm,VEHICLE_PARAMS_OFF,bonnet,boot,objective);
                            SetVehicleParamsForAll(v, 0, 0);
                            format(string, sizeof(string), "~w~%s ~g~UnLocked",GetVehicleName(v));
                            GameTextForPlayer(playerid, string, 1000, 4);
                            return 1;
                        }
                    }
                }
            }  
        }
    }
    return 0;
}
Reply


Messages In This Thread
Police lights turn off all the time - by Gerira Gaijin - 19.02.2012, 18:57
Re: Police lights turn off all the time - by Madd Kat - 19.02.2012, 19:00
Re: Police lights turn off all the time - by Gerira Gaijin - 19.02.2012, 20:04
Re: Police lights turn off all the time - by milanosie - 19.02.2012, 20:11
Re: Police lights turn off all the time - by Madd Kat - 19.02.2012, 20:13

Forum Jump:


Users browsing this thread: 1 Guest(s)