Jump to content

Small problem


MAB

Recommended Posts

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 :mrgreen: 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 ) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...