Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.56 KB | None | 0 0
  1. if config.useCopWhitelist==true then isCop=false else isCop=true end;local a=false;local b="unknown"local c={}local d=nil;local e=false;local f=false;local g={}local h={}local i=false;local j=-1;takingService={{x=457.956909179688,y=-992.72314453125,z=30.6895866394043}}stationGarage={{x=452.115966796875,y=-1018.10681152344,z=28.4786586761475}}if config.useCopWhitelist==true then AddEventHandler("playerSpawned",function()TriggerServerEvent("police:checkIsCop")end)end;if config.useCopWhitelist==true then RegisterNetEvent('police:receiveIsCop')AddEventHandler('police:receiveIsCop',function(k)if k=="unknown"then if config.useCopWhitelist==true then isCop=false end else isCop=true;b=k end end)end;if config.useCopWhitelist==true then RegisterNetEvent('police:nowCop')AddEventHandler('police:nowCop',function()isCop=true end)end;if config.useCopWhitelist==true then RegisterNetEvent('police:noLongerCop')AddEventHandler('police:noLongerCop',function()if config.useCopWhitelist==true then isCop=false end;a=false;if config.enableOutfits==true then RemoveAllPedWeapons(GetPlayerPed(-1))TriggerServerEvent("skin_customization:SpawnPlayer")else local l=GetHashKey("a_m_y_mexthug_01")RequestModel(l)while not HasModelLoaded(l)do RequestModel(l)Citizen.Wait(0)end;SetPlayerModel(PlayerId(),l)SetModelAsNoLongerNeeded(l)RemoveAllPedWeapons(GetPlayerPed(-1))end;if d~=nil then SetEntityAsMissionEntity(d,true,true)Citizen.InvokeNative(0xEA386986E786A54F,Citizen.PointerValueIntInitialized(d))d=nil end;ServiceOff()end)end;RegisterNetEvent('police:getArrested')AddEventHandler('police:getArrested',function()if isCop==false and config.useCopWhitelist==true or config.useCopWhitelist==false then e=not e;if e then TriggerEvent("police:notify","CHAR_ANDREAS",1,txt[config.lang]["title_notification"],false,txt[config.lang]["now_cuffed"])else TriggerEvent("police:notify","CHAR_ANDREAS",1,txt[config.lang]["title_notification"],false,txt[config.lang]["now_uncuffed"])i=false end end end)local m=false;RegisterNetEvent('police:payFines')AddEventHandler('police:payFines',function(n,o)Citizen.CreateThread(function()if m~=true then m=true;local p=GetGameTimer()Notification(txt[config.lang]["info_fine_request_before_amount"]..n..txt[config.lang]["info_fine_request_after_amount"])while true do Wait(0)if GetTimeDifference(GetGameTimer(),p)>15000 then TriggerServerEvent('police:finesETA',o,2)Notification(txt[config.lang]["request_fine_expired"])m=false;break end;if IsControlPressed(1,246)then if config.useModifiedBanking==true then TriggerServerEvent('bank:withdrawAmende',n)else TriggerServerEvent('bank:withdraw',n)end;Notification(txt[config.lang]["pay_fine_success_before_amount"]..n..txt[config.lang]["pay_fine_success_after_amount"])TriggerServerEvent('police:finesETA',o,0)m=false;break end;if IsControlPressed(1,45)then TriggerServerEvent('police:finesETA',o,3)m=false;break end end else TriggerServerEvent('police:finesETA',o,1)end end)end)RegisterNetEvent("police:notify")AddEventHandler("police:notify",function(q,r,o,s,t)Citizen.CreateThread(function()Wait(1)SetNotificationTextEntry("STRING")AddTextComponentString(t)SetNotificationMessage(q,q,true,r,o,s,t)DrawNotification(false,true)end)end)if config.useVDKInventory==true then RegisterNetEvent('police:dropIllegalItem')AddEventHandler('police:dropIllegalItem',function(u)TriggerEvent("player:looseItem",tonumber(u),exports.vdk_inventory:getQuantity(u))end)end;RegisterNetEvent('police:unseatme')AddEventHandler('police:unseatme',function(v)local w=GetPlayerPed(v)ClearPedTasksImmediately(w)plyPos=GetEntityCoords(GetPlayerPed(-1),true)local x=plyPos.x+2;local y=plyPos.y+2;SetEntityCoords(GetPlayerPed(-1),x,y,plyPos.z)end)RegisterNetEvent('police:toggleDrag')AddEventHandler('police:toggleDrag',function(v)if e then i=not i;j=v end end)RegisterNetEvent('police:forcedEnteringVeh')AddEventHandler('police:forcedEnteringVeh',function(z)if e then local A=GetEntityCoords(GetPlayerPed(-1))local B=GetOffsetFromEntityInWorldCoords(GetPlayerPed(-1),0.0,20.0,0.0)local C=CastRayPointToPoint(A.x,A.y,A.z,B.x,B.y,B.z,10,GetPlayerPed(-1),0)local D,D,D,D,E=GetRaycastResult(C)if E~=nil then SetPedIntoVehicle(GetPlayerPed(-1),E,1)end end end)if config.enableOtherCopsBlips==true then RegisterNetEvent('police:resultAllCopsInService')AddEventHandler('police:resultAllCopsInService',function(F)g=F;if config.enableOtherCopsBlips==true then enableCopBlips()end end)end;if config.useModifiedEmergency==true then RegisterNetEvent('es_em:cl_ResPlayer')AddEventHandler('es_em:cl_ResPlayer',function()if isCop and a then ServiceOff()end;if e==true then e=false end end)end;function Notification(G)SetNotificationTextEntry("STRING")AddTextComponentString(G)DrawNotification(0,1)end;function enableCopBlips()for H,I in pairs(h)do RemoveBlip(I)end;h={}local J={}for u=0,64 do if NetworkIsPlayerActive(u)and GetPlayerPed(u)~=GetPlayerPed(-1)then for K,L in pairs(g)do if K==GetPlayerServerId(u)then J[u]=L;break end end end end;for u,L in pairs(J)do local w=GetPlayerPed(u)local M=GetBlipFromEntity(w)if not DoesBlipExist(M)then M=AddBlipForEntity(w)SetBlipSprite(M,1)Citizen.InvokeNative(0x5FBCA48327B914DF,M,true)HideNumberOnBlip(M)SetBlipNameToPlayerName(M,u)SetBlipScale(M,0.85)SetBlipAlpha(M,255)table.insert(h,M)else blipSprite=GetBlipSprite(M)HideNumberOnBlip(M)if blipSprite~=1 then SetBlipSprite(M,1)Citizen.InvokeNative(0x5FBCA48327B914DF,M,true)end;SetBlipNameToPlayerName(M,u)SetBlipScale(M,0.85)SetBlipAlpha(M,255)table.insert(h,M)end end end;function GetPlayers()local N={}for K=0,31 do if NetworkIsPlayerActive(K)then table.insert(N,K)end end;return N end;function GetClosestPlayer()local N=GetPlayers()local O=-1;local P=-1;local Q=GetPlayerPed(-1)local R=GetEntityCoords(Q,0)for S,T in ipairs(N)do local U=GetPlayerPed(T)if U~=Q then local V=GetEntityCoords(GetPlayerPed(T),0)local W=GetDistanceBetweenCoords(V["x"],V["y"],V["z"],R["x"],R["y"],R["z"],true)if O==-1 or O>W then P=T;O=W end end end;return P,O end;function drawTxt(t,X,Y,Z,_,a0,a1,a2,a3,a4)SetTextFont(X)SetTextProportional(0)SetTextScale(a0,a0)SetTextColour(a1,a2,a3,a4)SetTextDropShadow(0,0,0,0,255)SetTextEdge(1,0,0,0,255)SetTextDropShadow()SetTextOutline()SetTextCentre(Y)SetTextEntry("STRING")AddTextComponentString(t)DrawText(Z,_)end;function isNearTakeService()for K=1,#takingService do local Q=GetPlayerPed(-1)local R=GetEntityCoords(Q,0)local W=GetDistanceBetweenCoords(takingService[K].x,takingService[K].y,takingService[K].z,R["x"],R["y"],R["z"],true)if W<30 then DrawMarker(1,takingService[K].x,takingService[K].y,takingService[K].z-1,0,0,0,0,0,0,1.0,1.0,1.0,0,155,255,200,0,0,2,0,0,0,0)end;if W<2 then return true end end end;function isNearStationGarage()for K=1,#stationGarage do local Q=GetPlayerPed(-1)local R=GetEntityCoords(Q,0)local W=GetDistanceBetweenCoords(stationGarage[K].x,stationGarage[K].y,stationGarage[K].z,R["x"],R["y"],R["z"],true)if W<30 then DrawMarker(1,stationGarage[K].x,stationGarage[K].y,stationGarage[K].z-1,0,0,0,0,0,0,2.0,2.0,1.0,0,155,255,200,0,0,2,0,0,0,0)end;if W<2 then return true end end end;function ServiceOn()a=true;if config.useJobSystem==true then TriggerServerEvent("jobssystem:jobs",config.job.officer_on_duty_job_id)end;TriggerServerEvent("police:takeService")end;function ServiceOff()a=false;if config.useJobSystem==true then TriggerServerEvent("jobssystem:jobs",config.job.officer_not_on_duty_job_id)end;TriggerServerEvent("police:breakService")if config.enableOtherCopsBlips==true then g={}for H,I in pairs(h)do RemoveBlip(I)end;h={}end end;function getIsInService()return a end;local a5=false;Citizen.CreateThread(function()while true do Citizen.Wait(0)if isCop then if isNearTakeService()then DisplayHelpText(txt[config.lang]["help_text_open_cloackroom"],0,1,0.5,0.8,0.6,255,255,255,255)if IsControlJustPressed(1,51)then OpenMenuVest()end end;if a then if IsControlJustPressed(1,166)then if a5==false then OpenPoliceMenu()a5=true elseif a5==true then CloseMenuPolice()a5=false end end end;if a then if isNearStationGarage()then if policevehicle~=nil then DisplayHelpText(txt[config.lang]["help_text_put_car_into_garage"],0,1,0.5,0.8,0.6,255,255,255,255)else DisplayHelpText(txt[config.lang]["help_text_get_car_out_garage"],0,1,0.5,0.8,0.6,255,255,255,255)end;if IsControlJustPressed(1,51)then if policevehicle~=nil then SetEntityAsMissionEntity(policevehicle,true,true)Citizen.InvokeNative(0xEA386986E786A54F,Citizen.PointerValueIntInitialized(policevehicle))policevehicle=nil else OpenVeh()end end end end end;if isCop==false and config.useCopWhitelist==true or config.useCopWhitelist==false then if e==true then RequestAnimDict('mp_arresting')while not HasAnimDictLoaded('mp_arresting')do Citizen.Wait(0)end;local a6=PlayerPedId(-1)local a7='idle'local a8=16;TaskPlayAnim(a6,'mp_arresting',a7,8.0,-8,-1,a8,0,0,0,0)end;if i then local w=GetPlayerPed(GetPlayerFromServerId(j))local a9=GetPlayerPed(-1)AttachEntityToEntity(a9,w,4103,11816,0.48,0.00,0.0,0.0,0.0,0.0,false,false,false,false,2,true)else DetachEntity(GetPlayerPed(-1),true,false)end end end end)local aa=false;Citizen.CreateThread(function()while true do Citizen.Wait(0)if isCop then if a then if config.useModifiedEmergency==false then if IsPlayerDead(PlayerId())then if aa==false then ServiceOff()e=false;aa=true end else aa=false end end;DrawMarker(1,449.113,-981.084,42.691,0,0,0,0,0,0,2.0,2.0,2.0,0,155,255,200,0,0,0,0)if GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(-1)),449.113,-981.084,43.691,true)<5 then if d~=nil then DisplayHelpText(txt[config.lang]["help_text_put_heli_into_garage"],0,1,0.5,0.8,0.6,255,255,255,255)else DisplayHelpText(txt[config.lang]["help_text_get_heli_out_garage"],0,1,0.5,0.8,0.6,255,255,255,255)end;if IsControlJustPressed(1,51)then if d~=nil then SetEntityAsMissionEntity(d,true,true)Citizen.InvokeNative(0xEA386986E786A54F,Citizen.PointerValueIntInitialized(d))d=nil else local ab=GetHashKey("polmav")local Q=GetPlayerPed(-1)local R=GetEntityCoords(Q,0)RequestModel(ab)while not HasModelLoaded(ab)do Citizen.Wait(0)end;d=CreateVehicle(ab,R["x"],R["y"],R["z"],90.0,true,false)local u=NetworkGetNetworkIdFromEntity(d)SetNetworkIdCanMigrate(u,true)SetVehicleLivery(d,0)TaskWarpPedIntoVehicle(Q,d,-1)end end end end end;if config.enableNeverWanted==true then SetPlayerWantedLevel(PlayerId(),0,false)SetPlayerWantedLevelNow(PlayerId(),false)ClearAreaOfCops()SetPoliceIgnorePlayer(PlayerId(),true)SetDispatchCopsForPlayer(PlayerId(),false)Citizen.InvokeNative(0xDC0F817884CDD856,1,false)Citizen.InvokeNative(0xDC0F817884CDD856,2,false)Citizen.InvokeNative(0xDC0F817884CDD856,3,false)Citizen.InvokeNative(0xDC0F817884CDD856,5,false)Citizen.InvokeNative(0xDC0F817884CDD856,8,false)Citizen.InvokeNative(0xDC0F817884CDD856,9,false)Citizen.InvokeNative(0xDC0F817884CDD856,10,false)Citizen.InvokeNative(0xDC0F817884CDD856,11,false)end end end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement