Estevam2d Posted September 9, 2014 Share Posted September 9, 2014 The player does not get the team star, why? addEvent("wanted",true) addEventHandler("wanted",root, function() if weapon == 43 and getElementType(source)=="player" then if getPlayerTeam(source) == getTeamFromName("Bandido") then if setPlayerWantedLevel(source, 1) then end end end end ) Link to comment
Anubhav Posted September 9, 2014 Share Posted September 9, 2014 addEvent("wanted",true) addEventHandler("wanted",root, function(weapon) if weapon == 43 and getElementType(source)=="player" then if getPlayerTeam(source) == getTeamFromName("Bandido") then setPlayerWantedLevel(source, 1) end end end end ) not sure. Link to comment
Estevam2d Posted September 9, 2014 Author Share Posted September 9, 2014 not worked I took a photo of the criminal and he does not get star I took a final, you put one more. Client: function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) if getPlayerTeam(hitElement) == getTeamFromName("Bandido") then if weapon == 43 and getElementType(hitElement)=="player" then triggerServerEvent ( "wanted", localPlayer ) end end end addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) Server: addEvent("wanted",true) addEventHandler("wanted",root, function(weapon) if weapon == 43 and getElementType(source)=="player" then if getPlayerTeam(source) == getTeamFromName("Bandido") then setPlayerWantedLevel(source, 1) end end end ) Link to comment
darhal Posted September 10, 2014 Share Posted September 10, 2014 replace source in serverside to client client side use triggerServerEvent("wanted", localPlayer, weapon) try it Link to comment
justn Posted September 10, 2014 Share Posted September 10, 2014 replace source in serverside to client Heh, don't really need to replace 'source' to 'client' He can simply use this: triggerServerEvent ( "wanted", localPlayer, weapon ) Link to comment
darhal Posted September 10, 2014 Share Posted September 10, 2014 ik i say that but client is work more than source Link to comment
Estevam2d Posted September 10, 2014 Author Share Posted September 10, 2014 Perfect, thanks for the help. I put "hitElement" and it worked. triggerServerEvent ( "wanted", hitElement, weapon ) Link to comment
Estevam2d Posted September 10, 2014 Author Share Posted September 10, 2014 one more thing is this correct? setPlayerWantedLevel(source, +1) Link to comment
justn Posted September 10, 2014 Share Posted September 10, 2014 Nope it's not correct. local playerWantedLevel = getPlayerWantedLevel(source) setPlayerWantedLevel(source,playerWantedLevel+1) Link to comment
Estevam2d Posted September 10, 2014 Author Share Posted September 10, 2014 Thanks again You guys are great about it 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