MAB Posted July 30, 2015 Posted July 30, 2015 what is the problem i see no marker and there is no messages at debugscript .. i didn't test until i finished typing the codes i can't find the problem --Markers effect.. function markers ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) if ( getPedWeaponSlot ( source ) == 0 or 1 or 8 or 9 or 10 or 11 or 12 ) then return end -- if his weapon isn't a gun then don't do the function if ( getElementType ( hitElement ) == "player" or getElementType ( hitElement ) == "vehicle" ) then return end -- if he is shooting a player then don't make the marker , cuz no need for it marker = createMarker ( hitX, hitY, hitZ, "corona", 0.1, 255, 255, 255, 255 ) -- when the player shoot we create a white marker in the place that the bullet hit and make it visible for the player who is shooting only. if getPedWeaponSlot ( source ) == 2 then -- if he is using a handgun then setMarkerColor ( marker, 255, 0, 0, 255 ) -- set the marker colour as red end if getPedWeaponSlot ( source ) == 3 then -- if he is using a shotgun then setMarkerColor ( marker, 0, 0, 255, 255 ) -- set the marker colour as blue end if getPedWeaponSlot ( source ) == 4 then -- if he is using a sub machine gun then setMarkerColor ( marker, 255, 255, 0, 255 ) -- set the marker colour as yellow end if getPedWeaponSlot ( source ) == 5 then -- if he is using a rifle then setMarkerColor ( marker, 255, 0, 255, 255 ) -- etc end if getPedWeaponSlot ( source ) == 6 then setMarkerColor ( marker, 0, 255, 255, 255 ) end if getPedWeaponSlot ( source ) == 7 then setMarkerColor ( marker, 0, 0, 255, 255 ) end if marker then setTimer ( destroyElement,3*1000,1,marker ) end end addEventHandler ( "onClientPlayerWeaponFire", root, markers )
Nikolay_888 Posted July 30, 2015 Posted July 30, 2015 I don't know, but I think there is an error in third string. Try this: local slot = getPedWeaponSlot ( source ) if slot == 0 or slot == 1 or slot == 8
MAB Posted July 30, 2015 Author Posted July 30, 2015 thx working now but there is a debug error message saying .. "23: bad argument @ 'getElementType' expected element at argument 1 got nil
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