jafar Posted November 17, 2013 Share Posted November 17, 2013 كان الماركر مخفي , جرب أحين , ولا تنسى تخلي الكود سيرفر Link to comment
K1NG Posted November 17, 2013 Share Posted November 17, 2013 جرب ذا الكود ولا تنسى تعدل احداثيات الماركر local Marker = createMarker(0,0,0,"cylinder",1.5,0,255,0) local times = {} addEventHandler("onMarkerHit",Marker, function (element) if getElementType(element) == "player" and not isPedInVehicle(element) then if not times[element] and not isTimer(times[element]) then times[element] = setTimer( function (player) givePlayerMoney(player,9000) end ,10000,0) end end end ) addEventHandler("onMarkerLeave",Marker, function (element) if getElementType(element) == "player" and not isPedInVehicle(element) then if times[element] and isTimer(times[element]) then killTimer(times[element]) times[element] = nil end end end ) addEventHandler("onPlayerQuit",root, function () if times[source] and isTimer(times[source]) then killTimer(times[source]) times[source] = nil end end ) ما يحتاج تتحقق إذا اللاعب مهو بداخل السيارة يوم يطلع من الماركر، لأنه لنفرض ان اللاعب يوم دخل الماركر اخذ سيارة وهو بداخل الماركر ثم طلع من الماركر وهو بالسيارة بكذا رح يضل التايمر ماشي وهو خارج الماركر ويوصله فلوس .. وفيه عندكـ أخطاء بتعريف اللاعب بوظيفة التايمر الي بحدث دخول الماركر -- Server Side Marker = createMarker(0,0,0,"cylinder",1.5,0,255,0,255) times = { }; addEventHandler("onMarkerHit",Marker, function (element) if getElementType(element) == "player" and not isPedInVehicle(element) then if not times[element] and not isTimer(times[element]) then times[element] = setTimer( function () givePlayerMoney(element,9000) end ,10000,0) end end end ) addEventHandler("onMarkerLeave",Marker, function (element) if getElementType(element) == "player" and not isPedInVehicle(element) then if times[element] and isTimer(times[element]) then killTimer(times[element]) times[element] = nil end end end ) addEventHandler("onPlayerQuit",root, function () if times[source] and isTimer(times[source]) then killTimer(times[source]) times[source] = nil end end ) وانت بعد مسوي مثل طلال بالتحقق يوم يخرج من الماركر وعندكـ بعد خطأ بتعريف اللاعب بالوظيفة حقت التايمر ------- بالنسبة لصاحب الموضوع، الكود يصير كذا -- Server Side # local times = { } local Marker = createMarker ( x, y, z, "cylinder", 1.5, 0, 255, 0, 255 ) addEventHandler ( "onMarkerHit", Marker, function ( element ) if ( getElementType ( element ) == "player" ) then if ( times[element] ) and ( isTimer ( times[element] ) )then killTimer ( times[element] ) times[element] = nil end times[element] = setTimer ( function ( element ) givePlayerMoney ( element, 9000 ) end, 120000, 0, element ) end end ) addEventHandler ( "onMarkerLeave", Marker, function ( element ) if ( getElementType ( element ) == "player" ) and ( times[element] ) and ( isTimer ( times[element] ) ) then killTimer ( times[element] ) times[element] = nil end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( times[source] ) and ( isTimer ( times[source] ) ) then killTimer ( times[source] ) times[source] = nil end end ) Link to comment
|Mr|-Talal07-| Posted November 18, 2013 Share Posted November 18, 2013 جرب ذا الكود ولا تنسى تعدل احداثيات الماركر local Marker = createMarker(0,0,0,"cylinder",1.5,0,255,0) local times = {} addEventHandler("onMarkerHit",Marker, function (element) if getElementType(element) == "player" and not isPedInVehicle(element) then if not times[element] and not isTimer(times[element]) then times[element] = setTimer( function (player) givePlayerMoney(player,9000) end ,10000,0) end end end ) addEventHandler("onMarkerLeave",Marker, function (element) if getElementType(element) == "player" and not isPedInVehicle(element) then if times[element] and isTimer(times[element]) then killTimer(times[element]) times[element] = nil end end end ) addEventHandler("onPlayerQuit",root, function () if times[source] and isTimer(times[source]) then killTimer(times[source]) times[source] = nil end end ) ما يحتاج تتحقق إذا اللاعب مهو بداخل السيارة يوم يطلع من الماركر، لأنه لنفرض ان اللاعب يوم دخل الماركر اخذ سيارة وهو بداخل الماركر ثم طلع من الماركر وهو بالسيارة بكذا رح يضل التايمر ماشي وهو خارج الماركر ويوصله فلوس .. وفيه عندكـ أخطاء بتعريف اللاعب بوظيفة التايمر الي بحدث دخول الماركر -- Server Side Marker = createMarker(0,0,0,"cylinder",1.5,0,255,0,255) times = { }; addEventHandler("onMarkerHit",Marker, function (element) if getElementType(element) == "player" and not isPedInVehicle(element) then if not times[element] and not isTimer(times[element]) then times[element] = setTimer( function () givePlayerMoney(element,9000) end ,10000,0) end end end ) addEventHandler("onMarkerLeave",Marker, function (element) if getElementType(element) == "player" and not isPedInVehicle(element) then if times[element] and isTimer(times[element]) then killTimer(times[element]) times[element] = nil end end end ) addEventHandler("onPlayerQuit",root, function () if times[source] and isTimer(times[source]) then killTimer(times[source]) times[source] = nil end end ) وانت بعد مسوي مثل طلال بالتحقق يوم يخرج من الماركر وعندكـ بعد خطأ بتعريف اللاعب بالوظيفة حقت التايمر ------- بالنسبة لصاحب الموضوع، الكود يصير كذا -- Server Side # local times = { } local Marker = createMarker ( x, y, z, "cylinder", 1.5, 0, 255, 0, 255 ) addEventHandler ( "onMarkerHit", Marker, function ( element ) if ( getElementType ( element ) == "player" ) then if ( times[element] ) and ( isTimer ( times[element] ) )then killTimer ( times[element] ) times[element] = nil end times[element] = setTimer ( function ( element ) givePlayerMoney ( element, 9000 ) end, 120000, 0, element ) end end ) addEventHandler ( "onMarkerLeave", Marker, function ( element ) if ( getElementType ( element ) == "player" ) and ( times[element] ) and ( isTimer ( times[element] ) ) then killTimer ( times[element] ) times[element] = nil end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( times[source] ) and ( isTimer ( times[source] ) ) then killTimer ( times[source] ) times[source] = nil end end ) شكرراا على الملاحظه و انا لي وقت طويل ما برمجت فـ توقع اي شي 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