DonOmar Posted July 4, 2016 Share Posted July 4, 2016 Today, i wanna ask for a script which gives Wanted Level when aiming at cop i mean when Criminal or any other Occ aiming at cop he will get Wanted Level. Link to comment
Walid Posted July 4, 2016 Share Posted July 4, 2016 All What you need is -- Function getElementType() getPlayerTeam() getTeamName() -- Events "onPlayerTarget" Link to comment
DonOmar Posted July 4, 2016 Author Share Posted July 4, 2016 ty Walid but iam noob scripter cant do it 100% can u help me with it ? Link to comment
Walid Posted July 4, 2016 Share Posted July 4, 2016 anyone help please ? Do it by yourself and post your code here. Link to comment
DonOmar Posted July 4, 2016 Author Share Posted July 4, 2016 what about this ? addEventHandler("onPlayerTarget",root,function(target) if(getElementType(target)=="player")then if(getTeamName(getPlayerTeam(target))=="Police")then setPlayerWantedLevel(source,1) end end) Link to comment
Captain Cody Posted July 4, 2016 Share Posted July 4, 2016 addEventHandler("onPlayerTarget",root,function(target) if(getElementType(target)=="player")then if(getTeamName(getPlayerTeam(target))=="Police")then setPlayerWantedLevel(source,getPlayerWantedLevel(source)+1) end end end) Link to comment
DonOmar Posted July 4, 2016 Author Share Posted July 4, 2016 Omg when i just look to the police i got WL i want if i aimed with a weapon get 1 WL . Link to comment
DonOmar Posted July 4, 2016 Author Share Posted July 4, 2016 also i wanna make it just get WL in LS and SF not in LV Link to comment
Captain Cody Posted July 4, 2016 Share Posted July 4, 2016 Could have specified that in the original post maybe. addEventHandler("onPlayerTarget",root,function(target) if(getElementType(target)=="player")then if(getTeamName(getPlayerTeam(target))=="Police")then local x,y,z = getElementPosition(source) if getZoneName ( x, y, z, true ) == "Los Santos" or getZoneName ( x, y, z, true ) == "San Fierro" then local slot = getPedWeaponSlot (source) if slot ~= 1 and slot ~= 0 then setPlayerWantedLevel(source,getPlayerWantedLevel(source)+1) end end end end end) Any ways if you need anything else -- https://wiki.multitheftauto.com/wiki/Sc ... troduction Try searching up the functions and what not before you ask here, that's a very simple code to do. /debugscript 3 to find errors. Link to comment
DonOmar Posted July 4, 2016 Author Share Posted July 4, 2016 Bro its working but i want it just when i aim with weapon .the code that u gave me is giving WL when looking to a cop without aim also i wanna make it +1 WL every 5sec of aiming iam just learning lua from some months and iam improving me self but i tried too much times with this code and still bugged. Help plz Link to comment
Captain Cody Posted July 4, 2016 Share Posted July 4, 2016 That would probably require client side integration, including with that would be a timer, that is infinite, every 5 secounds. That is where I end support here. Link to comment
Bean666 Posted July 4, 2016 Share Posted July 4, 2016 i think getElementZoneName works better than getZoneName i tried it before, and getElementZoneName works better for some reason. lol Link to comment
Captain Cody Posted July 4, 2016 Share Posted July 4, 2016 getElementZoneName uses an element getZoneName just uses cords, Just forgot about the getElementZoneName thing 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