Police and SRT Car problems
#7

Well this is current script now:
pawn Код:
// Check if the player is not a cop
            if (APlayerData[playerid][PlayerClass] != ClassPolice)
            {
                // First check if the vehicle is a static vehicle (player can still use a bought cop-car that he bought in his house,
                // as a bought vehicle isn't static)
                if (AVehicleData[vid][StaticVehicle] == true)
                {
                    // Check if the entered vehicle is a cop vehicle
                    switch (GetVehicleModel(vid))
                    {
                        case VehiclePoliceLSPD, VehiclePoliceSFPD, VehiclePoliceLVPD, VehicleHPV1000, VehiclePoliceRanger:
                        {
                            // Force the player out of the vehicle
                            RemovePlayerFromVehicle(playerid);
                            // Turn off the lights and engine
                            GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                            SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                            // Let the player know he cannot use a cop car
                            SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You cannot use a police vehicle");
                        }
                    }
                }
            }
When I change it to this:
pawn Код:
// Check if the player is not a cop
            if (APlayerData[playerid][PlayerClass] != ClassPolice || APlayerData[playerid[PlayerClass] != ClassSRT) // right here!!!
            {
                // First check if the vehicle is a static vehicle (player can still use a bought cop-car that he bought in his house,
                // as a bought vehicle isn't static)
                if (AVehicleData[vid][StaticVehicle] == true)
                {
                    // Check if the entered vehicle is a cop vehicle
                    switch (GetVehicleModel(vid))
                    {
                        case VehiclePoliceLSPD, VehiclePoliceSFPD, VehiclePoliceLVPD, VehicleHPV1000, VehiclePoliceRanger:
                        {
                            // Force the player out of the vehicle
                            RemovePlayerFromVehicle(playerid);
                            // Turn off the lights and engine
                            GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
                            SetVehicleParamsEx(vid, 0, 0, alarm, doors, bonnet, boot, objective);
                            // Let the player know he cannot use a cop car
                            SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You cannot use a police vehicle");
                        }
                    }
                }
            }
It won't work for either Cops or SRT, so they both cannot enter it.
Reply


Messages In This Thread
Police and SRT Car problems - by SomebodyAndMe - 05.01.2012, 14:16
Re: Police and SRT Car problems - by SomebodyAndMe - 07.01.2012, 06:53
Re: Police and SRT Car problems - by SomebodyAndMe - 15.01.2012, 08:31
Re: Police and SRT Car problems - by JamesC - 15.01.2012, 08:39
Re: Police and SRT Car problems - by SomebodyAndMe - 15.01.2012, 08:43
Re: Police and SRT Car problems - by mineralo - 15.01.2012, 08:43
Re: Police and SRT Car problems - by SomebodyAndMe - 15.01.2012, 08:46
Re: Police and SRT Car problems - by mineralo - 15.01.2012, 09:42
Re: Police and SRT Car problems - by Mean - 15.01.2012, 09:44
Re: Police and SRT Car problems - by HB - 15.01.2012, 10:22

Forum Jump:


Users browsing this thread: 1 Guest(s)