Jump to content

طلب كود


EH10

Recommended Posts

Posted

السلام عليكم

طلب فنكشات

اذا انفك الصندوق حق الشاحنة الي ورا ودخلت الماركر ماتاخذ فلوس ولا ينسحب الماركر

Posted
السلام عليكم

طلب فنكشات

اذا انفك الصندوق حق الشاحنة الي ورا ودخلت الماركر ماتاخذ فلوس ولا ينسحب الماركر

مافهمت ماتاخذ فلوس؟ ولا ينسحب الماركر؟ مايصير ولا واحد أساساً؟

Posted
تقدر تستخدم حدث

'onTrailerDetach' 

انا مسوي ماركر والي يدخله بالشاحنة وفيها لصندوق ياخذ فلوس وينسحب الماركر واذا مافيه الصندوق ودخل يقول ارجع واخذ الصندوق

Posted
createMarker -- صنع ماركر 
onMarkerHit -- عند دخول الماركر 
getElementsByType --- نتحق ان اللي دخل الماركر لاعب 
isPedInVehicle -- نتحقق انه جوا السيارة 
detachTrailerFromVehicle -- نتحقق ان حوض التريلا مو مفصول  
givePlayerMoney -- نعطيه فلوس 
destroyElement -- نسحب الماركر 

Posted (edited)

local marker = createMarker(x,y,z, "cylinder",1.5,255,0,0,160) 
  
addEventHandler("onMarkerHit", marker, function() 
for _,v in ipairs( getElementsByType( "player" ) ) do 
    if isPedInVehicle (v) then 
    local Detach = detachTrailerFromVehicle(v) 
    givePlayerMoney(source, 100) 
    destroyElement(marker) 
      end 
   end 
 end 
) 
Edited by Guest
  • 2 weeks later...
Posted

جرب اخى بس انا ماجربتو والكود فيه فنكشنات شبه العفريت شوى المهم جربو وقلنا ^_^

local marker = createMarker(x,y,z, "cylinder",1.5,255,0,0,160) 
addEventHandler("onMarkerHit", marker, 
function (Element) 
if getElementType ( Element ) == "player" and isPedInVehicle ( Element ) then 
local theVehicle = getPedOccupiedVehicle(Element) 
local success = detachTrailerFromVehicle(theVehicle) 
if not success then 
givePlayerMoney( Element, TheMoney) 
destroyElement ( source ) 
        end 
    end 
end 
) 

Posted
جرب اخى بس انا ماجربتو والكود فيه فنكشنات شبه العفريت شوى المهم جربو وقلنا ^_^
local marker = createMarker(x,y,z, "cylinder",1.5,255,0,0,160) 
addEventHandler("onMarkerHit", marker, 
function (Element) 
if getElementType ( Element ) == "player" and isPedInVehicle ( Element ) then 
local theVehicle = getPedOccupiedVehicle(Element) 
local success = detachTrailerFromVehicle(theVehicle) 
if not success then 
givePlayerMoney( Element, TheMoney) 
destroyElement ( source ) 
        end 
    end 
end 
) 

ماضبطط

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