VenomOG Posted February 17, 2018 Share Posted February 17, 2018 Client Spoiler local policeSkins = { [280] = true, [281] = true, [282] = true, [283] = true, [284] = true, [285] = true, [286] = true, [287] = true, [71] = true } function arrestCriminal(element) if eventName == "onClientPlayerTarget" then if isElement(element) and getElementType(element) == "player" then if policeSkins[getElementModel(source)] and getElementData(element,"wanted.level") and getDistanceBetweenPoints3D(Vector3(getElementPosition(source)),Vector3(getElementPosition(element))) <= 15 and getElementHealth(element) < 50 and getPedTask(source,"secondary",0) == "TASK_SIMPLE_USE_GUN" then triggerServerEvent("NGJobs:setStars",source,element,0) setTimer(triggerServerEvent,5000,1,"NGJobs:onPlayerArrested",element) end if not policeSkins[getElementModel(source)] and policeSkins[getElementModel(element)] and getPedTask(source,"secondary",0) == "TASK_SIMPLE_USE_GUN" then triggerServerEvent("NGJobs:setStars",source,_,3) end end elseif eventName == "onClientPlayerWasted" then if getElementData(source,"wanted.level") and policeSkins[getElementModel(element)] then setTimer(triggerServerEvent,2000,1,"NGJobs:onPlayerArrested",source) end end end addEventHandler("onClientPlayerTarget",localPlayer,arrestCriminal) addEventHandler("onClientPlayerWasted",localPlayer,arrestCriminal) Server Spoiler local jailPosition = { {1606.28271,-1678.05237,-29.34375}, {1606.28271,-1678.05237,-29.34375}, {1606.28271,-1678.05237,-29.34375} } addEvent("NGJobs:setStars",true) addEventHandler("NGJobs:setStars",getRootElement(), function(arrested_player,level) if arrested_player then setPlayerWantedLevel(arrested_player,level) toggleAllControls(arrested_player,false) setPedAnimation(source,"ped","arrestgun",-1,false) setPedAnimation(arrested_player,"ped","handsup",-1,false) setTimer(setPedAnimation,2000,1,source) setTimer(setPedAnimation,5000,1,arrested_player) else setPlayerWantedLevel(source,level) end end) addEvent("NGJobs:onPlayerArrested",true) addEventHandler("NGJobs:onPlayerArrested",getRootElement(), function() spawnPlayer(source,Vector3(jailPosition[math.random(#jailPosition)])) toggleAllControls(source,true) setPlayerWantedLevel(source,0) end) So the problem is when a cop kills the player they go jail location and lose there guns but there not in dimension or injail. please help Link to comment
keymetaphore Posted February 17, 2018 Share Posted February 17, 2018 (edited) Can you use code tags for that, my friend? I'll help you when you do that. It's [ code ] long long code [ / code ] without spaces. @Venon1 Edited February 17, 2018 by Biistamais Link to comment
VenomOG Posted February 17, 2018 Author Share Posted February 17, 2018 What do you mean and btw i'm new to scripting Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now