Warrant
#1

So, i made a warrant system for my server. If player doesn't have a driving license and he drives a vehicle, he'll get a wanted level:

pawn Код:
if (IsDoorVehicle(vehicleid))
            {
                switch (Player[playerid][VehicleLicense])
                {
                    case 0:
                    {
                        SCM(playerid, COLOR_LIGHTRED, "* Commited a crime: (Vehicle theft | Driving without a valid driving license) - Your wanted level has been increased.");
                        SetPlayerWantedLevelEx(playerid, GetPlayerWantedLevel(playerid)+1);

                        format(string,sizeof(string),"* [Law Enforcement Radio]: Vehicle theft without license (%s) by %s (%d) - Zone: %s",  ReturnVehicleName(vehicleid), ReturnPlayerName(playerid), playerid, zone);
                        SendMessageToCops(string);
                    }
                    case 1:
                    {
                        SCM(playerid, COLOR_LIGHTRED, "* Commited a crime: (Vehicle Theft) - Your wanted level has been increased.");
                        SetPlayerWantedLevelEx(playerid, GetPlayerWantedLevel(playerid)+1);

                        format(string,sizeof(string),"* [Law Enforcement Radio]: Vehicle theft (%s) by %s (%d) - Zone: %s",  ReturnVehicleName(vehicleid), ReturnPlayerName(playerid), playerid, zone);
                        SendMessageToCops(string);
                    }
                }
                SetPVarInt(playerid,"WarrantTime",GetTickCount()+60000);
                if(GetPVarInt(playerid,"WarrantTime")>GetTickCount()) return 0;
                                }
Everything works, but as you can see, i set pvars to prevent adding a wanted level everytime a player exits/enters the vehicle.

It's a 1 minute cooldown, means if the player got already the wanted level for driving without license and he tries to re-enter another vehicle in less than 1 minute, he'll not get wanted level again.

But doesn't work, what's wrong? Probably added in wrong place the pvars?
Reply


Messages In This Thread
Warrant - by KinderClans - 26.08.2018, 16:44
Re: Warrant - by Sew_Sumi - 26.08.2018, 17:13
Re: Warrant - by KinderClans - 26.08.2018, 17:23
Re: Warrant - by Dignity - 26.08.2018, 17:31
Re: Warrant - by KinderClans - 26.08.2018, 18:50
Re: Warrant - by Shinja - 26.08.2018, 18:56
Re: Warrant - by KinderClans - 26.08.2018, 19:05
Re: Warrant - by Shinja - 26.08.2018, 19:19
Re: Warrant - by KinderClans - 26.08.2018, 19:20
Re: Warrant - by Shinja - 26.08.2018, 19:26

Forum Jump:


Users browsing this thread: 1 Guest(s)