Jump to content

وش المشكلة؟


w7sH

Recommended Posts




Code = createMarker ( -3316.7551269531 , -3213.98046875, 7.2168769836426,"cylinder",100,  255, 0, 0, 0)

 
addEventHandler ( "onMarkerHit", resourceRoot, function ( vehicle )
 if ( source == SaaD ) then
   if ( getElementType ( vehicle ) == "vehicle" ) then
         destroyElement ( vehicle )
     end
  end
end )

addEventHandler ( "onMarkerHit", SafahM,
    function ( hitPlayer )
        if getElementType ( hitPlayer ) == "player" then
            toggleControl ( hitPlayer, "fire", false )
            toggleControl ( hitPlayer, "aim_weapon", false )
                toggleControl ( hitPlayer, "fire", false)
    toggleControl (hitPlayer, "next_weapon", false)
    toggleControl (hitPlayer, "previous_weapon", false)
    toggleControl (hitPlayer, "sprint", false)
    toggleControl (hitPlayer, "aim_weapon", false)
    toggleControl (hitPlayer, "vehicle_fire", false)
        elseif getElementType ( hitPlayer ) == "vehicle" then
            local Player = getVehicleController ( hitPlayer )
            outputChatBox ( "* ممنوع دخول المواتر هنا !", Player, 255, 0, 0, true )
            destroyElement ( hitPlayer )
        end
    end
)

انا ضايف كود ممنوع يطلع السلاح اذا خش الماركر . لكن يقدر يطلع ويطلق وش المشكلة ^ ؟

Link to comment



Code = createMarker ( -3316.7551269531 , -3213.98046875, 7.2168769836426,"cylinder",100,  255, 0, 0, 0)

 
addEventHandler ( "onMarkerHit", resourceRoot, function ( vehicle )
 if ( source == Code ) then
   if ( getElementType ( vehicle ) == "vehicle" ) then
         destroyElement ( vehicle )
     end
  end
end )

addEventHandler ( "onMarkerHit", Code,
    function ( hitPlayer )
        if getElementType ( hitPlayer ) == "player" then
            toggleControl ( hitPlayer, "fire", false )
            toggleControl ( hitPlayer, "aim_weapon", false )
                toggleControl ( hitPlayer, "fire", false)
    toggleControl (hitPlayer, "next_weapon", false)
    toggleControl (hitPlayer, "previous_weapon", false)
    toggleControl (hitPlayer, "sprint", false)
    toggleControl (hitPlayer, "aim_weapon", false)
    toggleControl (hitPlayer, "vehicle_fire", false)
toggleControl (hitPlayer,"action", false)
toggleControl (hitPlayer,"aim_weapon", false)
        elseif getElementType ( hitPlayer ) == "vehicle" then
            local Player = getVehicleController ( hitPlayer )
            outputChatBox ( "* ممنوع دخول المواتر هنا !", Player, 255, 0, 0, true )
            destroyElement ( hitPlayer )
        end
    end
)

نفس المشكله - ملاحظة كل شي شغال اذا نظام السلاح

Link to comment
Just now, w7sH said:




Code = createMarker ( -3316.7551269531 , -3213.98046875, 7.2168769836426,"cylinder",100,  255, 0, 0, 0)

 
addEventHandler ( "onMarkerHit", resourceRoot, function ( vehicle )
 if ( source == Code ) then
   if ( getElementType ( vehicle ) == "vehicle" ) then
         destroyElement ( vehicle )
     end
  end
end )

addEventHandler ( "onMarkerHit", Code,
    function ( hitPlayer )
        if getElementType ( hitPlayer ) == "player" then
            toggleControl ( hitPlayer, "fire", false )
            toggleControl ( hitPlayer, "aim_weapon", false )
                toggleControl ( hitPlayer, "fire", false)
    toggleControl (hitPlayer, "next_weapon", false)
    toggleControl (hitPlayer, "previous_weapon", false)
    toggleControl (hitPlayer, "sprint", false)
    toggleControl (hitPlayer, "aim_weapon", false)
    toggleControl (hitPlayer, "vehicle_fire", false)
toggleControl (hitPlayer,"action", false)
toggleControl (hitPlayer,"aim_weapon", false)
        elseif getElementType ( hitPlayer ) == "vehicle" then
            local Player = getVehicleController ( hitPlayer )
            outputChatBox ( "* ممنوع دخول المواتر هنا !", Player, 255, 0, 0, true )
            destroyElement ( hitPlayer )
        end
    end
)

نفس المشكله - ملاحظة كل شي شغال اذا نظام السلاح

-- جرب هذا

-- client

ClientMarker = createMarker ( ... ) -- نفس الاحداثيات اللي في ملف السيرفر

function killerProjetRender ()

if ClientMarker then
if isElementWithinMarker ( localPlayer, ClientMarker ) then
setPlayerWeaponSlot ( localPlayer, 0 )
end
end

end

addEventHandler ( "onClientRender" , root , killerProjetRender )

 

Edited by Killer Project
if ClientMarker then
Link to comment
	Code = createMarker ( -3316.7551269531 , -3213.98046875, 7.2168769836426,"cylinder",100,  255, 0, 0, 0)

	local toggleControls = { "aim_weapon" , "fire" , "next_weapon" , "previous_weapon" , "sprint" , "action" , "vehicle_fire" , "aim_weapon" , "aim_weapon" }

	function aFunction( aElement )
	
	if ( eventName == "onMarkerHit" ) then
	
	if ( aElement and getElementType ( aElement ) == "player" ) then
	
	for _ , v in ipairs ( toggleControls ) do 
	
	toggleControl ( aElement , v , false )

	end
	
	elseif ( aElement and getElementType ( aElement ) == "vehicle" ) then
	
	destroyElement ( aElement )

	end
	
	elseif ( eventName == "onMarkerLeave" ) then
	
	if ( aElement and getElementType ( aElement ) == "player" ) then	
	
	for _ ,v in ipairs ( toggleControls ) do 
	
	toggleControl ( aElement , v , true )	
	
				end
			end
        end
    end
	
addEventHandler ( "onMarkerHit", Code, aFunction )
addEventHandler ( "onMarkerLeave", Code, aFunction )

جرب هذا افضلك من الرندر

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...