mo7taref2014 Posted May 2, 2015 Share Posted May 2, 2015 في مود انا سويته local ca3 = { { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 } } local marker = { --You can add more locations here { 511.94174194336, -1655.2518310547, 18.948333740234 }, { 1841.0515136719, -1797.8941650391, 13.546875 } } local vehicle_ = {} local blip = {} local rand = {} local Markers = {} function CreatCarRandom () rand.random = ca3[math.random(#ca3)] vehicle_.car = createVehicle(560, 2228.9113769531, -1152.0667724609, 25.854433059692) blip.blip1Car = createBlipAttachedTo(vehicle_.car, 53) end addEventHandler("onResourceStart", root, CreatCarRandom) addEventHandler("onPlayerVehicleEnter", root, function(vehicle) if(isElement(vehicle_.car))then if (vehicle == vehicle_.car) then local x,y,z = unpack(marker[math.random(#marker)]) Markers.Marker = createMarker(x, y, z, "cylinder", 5, 0, 0, 205, 170) blip.blipCar2 = createBlipAttachedTo(Markers.Marker, 51) setElementVisibleTo(Markers.Marker, root, false) setElementVisibleTo(Markers.Marker, source, true) end end end ) addEventHandler( "onMarkerHit", root, function(hitElement) if ( getElementType( hitElement ) == "player" ) then if( isPedInVehicle( hitElement ) )then givePlayerMoney ( hitElement, math.random(10000,10001) ) triggerClientEvent(hitElement, "playSoundC", hitElement) for i,v in pairs(vehicle_) do destroyElement(v) end for i,v in pairs(Markers) do destroyElement(v) end for i,v in pairs(blip) do destroyElement(v) end CreatCarRandom () end end end ) 1-بدي اخلي كل دقيقتين 2-كل الي فلسياره ياخذ الفلوس ارجو الرد السريع Link to comment
mo7taref2014 Posted May 2, 2015 Author Share Posted May 2, 2015 انا جربت اسوي setTimer(setElementPosition,1000,1,Vehicle,x,y,z) ما ضبط Link to comment
yazan Posted May 2, 2015 Share Posted May 2, 2015 addEventHandler("onPlayerVehicleEnter", root, function(vehicle) if(isElement(vehicle_.car))then if (vehicle == vehicle_.car) then local x,y,z = unpack(marker[math.random(#marker)]) Markers.Marker = createMarker(x, y, z, "cylinder", 5, 0, 0, 205, 170) blip.blipCar2 = createBlipAttachedTo(Markers.Marker, 51) setElementVisibleTo(Markers.Marker, root, false) setElementVisibleTo(Markers.Marker, source, true) setTimer ( function() givePlayerMoney(source,2000) end, 2000, 0 ) end end end ) Link to comment
</Mr.Tn6eL> Posted May 2, 2015 Share Posted May 2, 2015 انت قصدك اذ دخل الماركر وانتظر دقيقتين يعطيه فلوس؟ Link to comment
mo7taref2014 Posted May 2, 2015 Author Share Posted May 2, 2015 اول ما اوصل السياره على الماركر يعطي ال موجودين فالسياره فلوس وبعدين تختفي السياره والماركر وتنتضر دقيقتين وتضهر سياره والماركر Link to comment
</Mr.Tn6eL> Posted May 2, 2015 Share Posted May 2, 2015 getVehicleOccupants givePlayerMoney تجيب اللي بالسيارة وتعطيه فلوس هذا اللي فهمته Link to comment
mo7taref2014 Posted May 2, 2015 Author Share Posted May 2, 2015 الحين لما ياخذ فلوس تختفي السياره و الماركر ورجعوا بعد دقيقتين Link to comment
</Mr.Tn6eL> Posted May 2, 2015 Share Posted May 2, 2015 سوي وظيفة وحط فيها صنع السيارة والماركر وعيدها زي كذا function restartFunction( ) outputChatBox("المهمة قد بدأت") end setTimer(restartFunction, 60000*2, 1) Link to comment
mo7taref2014 Posted May 2, 2015 Author Share Posted May 2, 2015 هذي ما فهمتها getVehicleOccupants Link to comment
yazan Posted May 2, 2015 Share Posted May 2, 2015 server# function restartFunction( ) y = createMarker(x, y, z, "cylinder", 5, 0, 0, 205, 170) vehicle = createVehicle(560, 2228.9113769531, -1152.0667724609, 25.854433059692) end addEventHandler( "onMarkerHit", root, function(element) if source == marker then if getElementType(element) == "player" then local vehicle = getPedOccupiedVehicle (element) if vehicle then occupants = getVehicleOccupants(vehicle) for i,v in pairs(occupants) do givePlayerMoney ( v, 2000 ) destroyElement(y) destroyElement(vehicle) setTimer(restartFunction, 60000*2, 1) end end end end end) Link to comment
</Mr.Tn6eL> Posted May 2, 2015 Share Posted May 2, 2015 هذي ما فهمتها getVehicleOccupants يجيب لك كل الاعبين داخل السيارة Link to comment
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