Jump to content

طلب كود


Recommended Posts

هذا كل الكود server side

jobmarker = createMarker(-1643.0999755859, -2261.8000488281, 31.599998474121, "cylinder", 4, 255, 255, 255, 0 ) 
function duty(thePlayer, matchingDimension) 
 if isElementWithinMarker(thePlayer, jobmarker) then 
createObject ( 18568, -1650, -2261.8999023438, 32.900001525879, 0, 0, 311.49536132813 ) 
end 
end 

انا اريد عندما الرجل يقف فى المركر ويضرب بالسكينة يتم انشاء الاوبجيكت

من فضلك ساعدنى

Link to comment

, جـرب *

إذا تبي بـ سلاح محدد ,

سوي تحقق , وعرفها ,

if ( weapon == id ) then

#Client .

local Marker = createMarker( x, y, z, "cylinder", 1.5, 255, 255, 0, 160 ) 
  
addEventHandler("onClientPlayerWeaponFire", localPlayer,  
function ()  
    if isElementWithinMarker(localPlayer, Marker) then 
      triggerServerEvent("Event", localPlayer) 
  end 
end 
)  

#Server .

addEvent("Event", true) 
addEventHandler("Event", root, 
function () 
    createObject( id, x, y, z ) 
 end 
) 
Link to comment
, جـرب *

إذا تبي بـ سلاح محدد ,

سوي تحقق , وعرفها ,

if ( weapon == id ) then

#Client .

local Marker = createMarker( x, y, z, "cylinder", 1.5, 255, 255, 0, 160 ) 
  
addEventHandler("onClientPlayerWeaponFire", localPlayer,  
function ()  
    if isElementWithinMarker(localPlayer, Marker) then 
      triggerServerEvent("Event", localPlayer) 
  end 
end 
)  

#Server .

addEvent("Event", true) 
addEventHandler("Event", root, 
function () 
    createObject( id, x, y, z ) 
 end 
) 

اخى هذا يعمل مع الاسلحة التى تصدر رصاص فقط لكن لا يعمل مع السكينه

Link to comment

جرب كذا

local marker = createMarker (x,y,z, "cylinder", 2, 0, 255, 0) 
  
function fire (plr) 
if getPedWeapon (plr) == 4 and getPedWeaponSlot (plr) == 1 then 
if isElementWithinMarker (plr, marker) then 
x,y,z = getElementPosition (plr) 
createObject (id, x,y,z) 
end 
end 
end 
  
addEventHandler ("onMarkerHit", marker, function (hit) 
if getElementType (hit) == "player" then 
bindKey (hit, "mouse1", "down", fire) 
end 
end 
) 
Link to comment
جرب كذا

local marker = createMarker (x,y,z, "cylinder", 2, 0, 255, 0) 
  
function fire (plr) 
if getPedWeapon (plr) == 4 and getPedWeaponSlot (plr) == 1 then 
if isElementWithinMarker (plr, marker) then 
x,y,z = getElementPosition (plr) 
createObject (id, x,y,z) 
end 
end 
end 
  
addEventHandler ("onMarkerHit", marker, function (hit) 
if getElementType (hit) == "player" then 
bindKey (hit, "mouse1", "down", fire) 
end 
end 
) 

يعمل لكن يعمل مع كل الاسلحة واننا اريد ان يعمل مع السكينه فقط

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