TAPL Posted November 15, 2012 Share Posted November 15, 2012 https://forum.multitheftauto.com/viewtopic.php?f=119&t=49609 Link to comment
3NAD Posted November 15, 2012 Share Posted November 15, 2012 سطر 8 setTimer ( giveWeapon, 5000, 0, thePed, 30, 99999, true ) تقدر تقلل وقت إعطاء السلاح الـ 5 ثواني = 5000 لو تبي حطه كل 3 ثواني Link to comment
MrCor Posted November 15, 2012 Author Share Posted November 15, 2012 خلاص عناد تم حل كل المشاااكل شكرا عناد أنت أحسن واااحد Link to comment
MrCor Posted November 15, 2012 Author Share Posted November 15, 2012 عناد ليش لم يطلق على أحد بس هو الي يشوفه يطلق من ملف الكلنت ؟؟ Link to comment
3NAD Posted November 15, 2012 Share Posted November 15, 2012 لأن كود الطلق اصله كلنت = لـ العنصر نفسه setPedControlState setPedAimTarget Link to comment
emad10 Posted November 22, 2012 Share Posted November 22, 2012 اسف على التدخل بدل ما افتح موضوع شلون اسوي اكثر من بيد؟ Link to comment
==>ҭᾄlᾄl Posted November 22, 2012 Share Posted November 22, 2012 اتوقع تكرر كود صنع البيد وهو بيسوي الاكواد الي على البيد الاول عليهم Link to comment
3NAD Posted November 22, 2012 Share Posted November 22, 2012 thePed1 = createPed ( ID, x, y, z ) thePed2 = createPed ( ID, x, y, z ) thePed3 = createPed ( ID, x, y, z ) Or thePositions = { { x, y, z }, { x, y, z }, { x, y, z }, } for _, AllPositions in ipairs ( thePositions ) do createPed ( ID, AllPositions [1], AllPositions [2], AllPositions [3] ) end Link to comment
emad10 Posted November 22, 2012 Share Posted November 22, 2012 -- Server Side thePed = createPed ( 124, 1513.3770751953, -1677.8481445313, 14.046875 ) thePed1 = createPed ( 124, 1514.3770751953, -1677.8481445313, 14.046875 ) thePed2 = createPed ( 124, 1515.3770751953, -1677.8481445313, 14.046875 ) thePed3 = createPed ( 124, 1516.3770751953, -1677.8481445313, 14.046875 ) theMarker = createMarker ( 1516.3770751953, -1677.8481445313, 14.046875, "cylinder", 15, 0, 0, 0, 0 ) setPedStat ( thePed, 77, 999 ) setPedStat ( thePed1, 77, 999 ) setPedStat ( thePed2, 77, 999 ) setPedStat ( thePed3, 77, 999 ) setPedWeaponSlot ( thePed, 3 ) setPedWeaponSlot ( thePed1, 3 ) setPedWeaponSlot ( thePed2, 3 ) setPedWeaponSlot ( thePed3, 3 ) attachElements ( theMarker, thePed, 0, 0, -1 ) attachElements ( theMarker, thePed1, 0, 0, -1 ) attachElements ( theMarker, thePed2, 0, 0, -1 ) attachElements ( theMarker, thePed3, 0, 0, -1 ) setTimer ( giveWeapon, 500, 0, thePed, 25, 99999, true ) setTimer ( giveWeapon, 500, 0, thePed1, 25, 99999, true ) setTimer ( giveWeapon, 500, 0, thePed2, 25, 99999, true ) setTimer ( giveWeapon, 500, 0, thePed3, 25, 99999, true ) addEventHandler ( "onMarkerHit", getResourceRootElement ( getThisResource ( ) ), function ( thePlayer ) if getElementType ( thePlayer ) == "player" then if getPlayerTeam ( thePlayer ) == getTeamFromName ( "eetlaf" ) then triggerClientEvent ( thePlayer, "setPedAttacking", thePlayer, thePed ) if isPedInVehicle ( thePlayer ) then destroyElement ( getPedOccupiedVehicle ( thePlayer ) ) end end end end ) addEventHandler ( "onMarkerLeave", getResourceRootElement ( getThisResource ( ) ), function ( thePlayer ) if getElementType ( thePlayer ) == "player" then triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed ) triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed1 ) triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed2 ) triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed3 ) setTimer ( giveWeapon, 500, 1, thePed, 25, 99999, true ) setTimer ( giveWeapon, 500, 1, thePed1, 25, 99999, true ) setTimer ( giveWeapon, 500, 1, thePed2, 25, 99999, true ) setTimer ( giveWeapon, 500, 1, thePed3, 25, 99999, true ) end end ) -- Client Side addEvent ( "setPedAttacking", true ) addEventHandler ( "setPedAttacking", root, function ( thePed )( thePed1 )( thePed2 )( thePed3 ) setTimer ( function ( ) x, y, z = getElementPosition ( localPlayer ) setPedAimTarget ( thePed, x, y, z ) setPedAimTarget ( thePed1, x, y, z ) setPedAimTarget ( thePed2, x, y, z ) setPedAimTarget ( thePed3, x, y, z ) end , 100, 0 ) setPedControlState ( thePed, "fire", true ) setPedControlState ( thePed1, "fire", true ) setPedControlState ( thePed2, "fire", true ) setPedControlState ( thePed3, "fire", true ) outputChatBox ( "* Start Shooting !!!", 255, 255, 0, true ) end ) addEvent ( "setPedStanding", true ) addEventHandler ( "setPedStanding", root, function ( thePed )( thePed1 )( thePed2 )( thePed3 ) setPedControlState ( thePed, "fire", false ) setPedControlState ( thePed1, "fire", false ) setPedControlState ( thePed2, "fire", false ) setPedControlState ( thePed3, "fire", false ) outputChatBox ( "* Stop Shooting !!!", 255, 255, 0, true ) for _, x3NAD in ipairs ( getTimers ( 100 ) ) do killTimer ( x3NAD ) end end ) Link to comment
abu5lf Posted November 22, 2012 Share Posted November 22, 2012 thePositions = { { x, y, z }, { x, y, z }, { x, y, z }, } for _, AllPositions in ipairs ( thePositions ) do createPed ( ID, AllPositions [1], AllPositions [2], AllPositions [3] ) end شرحها لك عناد Link to comment
MrCor Posted November 22, 2012 Author Share Posted November 22, 2012 -- Server Side thePed = createPed ( 124, 1513.3770751953, -1677.8481445313, 14.046875 ) thePed1 = createPed ( 124, 1514.3770751953, -1677.8481445313, 14.046875 ) thePed2 = createPed ( 124, 1515.3770751953, -1677.8481445313, 14.046875 ) thePed3 = createPed ( 124, 1516.3770751953, -1677.8481445313, 14.046875 ) theMarker = createMarker ( 1516.3770751953, -1677.8481445313, 14.046875, "cylinder", 15, 0, 0, 0, 0 ) setPedStat ( thePed, 77, 999 ) setPedStat ( thePed1, 77, 999 ) setPedStat ( thePed2, 77, 999 ) setPedStat ( thePed3, 77, 999 ) setPedWeaponSlot ( thePed, 3 ) setPedWeaponSlot ( thePed1, 3 ) setPedWeaponSlot ( thePed2, 3 ) setPedWeaponSlot ( thePed3, 3 ) attachElements ( theMarker, thePed, 0, 0, -1 ) attachElements ( theMarker, thePed1, 0, 0, -1 ) attachElements ( theMarker, thePed2, 0, 0, -1 ) attachElements ( theMarker, thePed3, 0, 0, -1 ) setTimer ( giveWeapon, 500, 0, thePed, 25, 99999, true ) setTimer ( giveWeapon, 500, 0, thePed1, 25, 99999, true ) setTimer ( giveWeapon, 500, 0, thePed2, 25, 99999, true ) setTimer ( giveWeapon, 500, 0, thePed3, 25, 99999, true ) addEventHandler ( "onMarkerHit", getResourceRootElement ( getThisResource ( ) ), function ( thePlayer ) if getElementType ( thePlayer ) == "player" then if getPlayerTeam ( thePlayer ) == getTeamFromName ( "eetlaf" ) then triggerClientEvent ( thePlayer, "setPedAttacking", thePlayer, thePed ) if isPedInVehicle ( thePlayer ) then destroyElement ( getPedOccupiedVehicle ( thePlayer ) ) end end end end ) addEventHandler ( "onMarkerLeave", getResourceRootElement ( getThisResource ( ) ), function ( thePlayer ) if getElementType ( thePlayer ) == "player" then triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed ) triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed1 ) triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed2 ) triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed3 ) setTimer ( giveWeapon, 500, 1, thePed, 25, 99999, true ) setTimer ( giveWeapon, 500, 1, thePed1, 25, 99999, true ) setTimer ( giveWeapon, 500, 1, thePed2, 25, 99999, true ) setTimer ( giveWeapon, 500, 1, thePed3, 25, 99999, true ) end end ) -- Client Side addEvent ( "setPedAttacking", true ) addEventHandler ( "setPedAttacking", root, function ( thePed )( thePed1 )( thePed2 )( thePed3 ) setTimer ( function ( ) x, y, z = getElementPosition ( localPlayer ) setPedAimTarget ( thePed, x, y, z ) setPedAimTarget ( thePed1, x, y, z ) setPedAimTarget ( thePed2, x, y, z ) setPedAimTarget ( thePed3, x, y, z ) end , 100, 0 ) setPedControlState ( thePed, "fire", true ) setPedControlState ( thePed1, "fire", true ) setPedControlState ( thePed2, "fire", true ) setPedControlState ( thePed3, "fire", true ) outputChatBox ( "* Start Shooting !!!", 255, 255, 0, true ) end ) addEvent ( "setPedStanding", true ) addEventHandler ( "setPedStanding", root, function ( thePed )( thePed1 )( thePed2 )( thePed3 ) setPedControlState ( thePed, "fire", false ) setPedControlState ( thePed1, "fire", false ) setPedControlState ( thePed2, "fire", false ) setPedControlState ( thePed3, "fire", false ) outputChatBox ( "* Stop Shooting !!!", 255, 255, 0, true ) for _, x3NAD in ipairs ( getTimers ( 100 ) ) do killTimer ( x3NAD ) end end ) في طريقة أسهل اذا ما تعرف حق هذي الطريقة سو مود ثاني Link to comment
emad10 Posted November 22, 2012 Share Posted November 22, 2012 [2012-11-23 22:15:01] restart: Requested by Console [2012-11-23 22:15:01] restart: Resource restarting... [2012-11-23 22:15:01] Stopping 43 [2012-11-23 22:15:01] Resource '43' changed, reloading and starting [2012-11-23 22:15:01] Starting 43 [2012-11-23 22:15:01] WARNING: 43\server.lua:21: Bad argument @ 'setPedStat' [2012-11-23 22:15:01] WARNING: 43\server.lua:22: Bad argument @ 'setPedWeaponSlot' [2012-11-23 22:15:01] WARNING: 43\server.lua:23: Bad argument @ 'attachElements' [2012-11-23 22:15:01] 43 restarted successfully [2012-11-23 22:15:06] WARNING: Bad argument @ 'giveWeapon' [2012-11-23 22:15:11] WARNING: Bad argument @ 'giveWeapon' [2012-11-23 22:15:16] WARNING: Bad argument @ 'giveWeapon' [2012-11-23 22:15:21] WARNING: Bad argument @ 'giveWeapon' [2012-11-23 22:15:26] WARNING: Bad argument @ 'giveWeapon' -- Server Side thePositions = { { 1514.3770751953, -1677.8481445313, 14.046875 }, { 1515.3770751953, -1677.8481445313, 14.046875 }, { 1516.3770751953, -1677.8481445313, 14.046875 }, { 1517.3770751953, -1677.8481445313, 14.046875 }, { 1518.3770751953, -1677.8481445313, 14.046875 }, { 1513.3770751953, -1678.8481445313, 14.046875 }, { 1513.3770751953, -1679.8481445313, 14.046875 }, { 1513.3770751953, -1680.8481445313, 14.046875 }, { 1513.3770751953, -1681.8481445313, 14.046875 }, { 1513.3770751953, -1682.8481445313, 14.046875 }, } for _, AllPositions in ipairs ( thePositions ) do createPed ( 124, AllPositions [1], AllPositions [2], AllPositions [3], AllPositions [4], AllPositions [5], AllPositions [6], AllPositions [7], AllPositions [8],AllPositions [9],AllPositions [10] ) end theMarker = createMarker ( 0, 0, 0, "cylinder", 15, 0, 0, 0, 0 ) setPedStat ( Ped, 77, 999 ) setPedWeaponSlot ( Ped, 3 ) attachElements ( theMarker, Ped, 0, 0, -1 ) setTimer ( giveWeapon, 5000, 0, Ped, 25, 99999, true ) addEventHandler ( "onMarkerHit", getResourceRootElement ( getThisResource ( ) ), function ( thePlayer ) if getElementType ( thePlayer ) == "player" then if getPlayerTeam ( thePlayer ) == getTeamFromName ( "Skulls" ) then triggerClientEvent ( thePlayer, "setPedAttacking", thePlayer, thePed ) if isPedInVehicle ( thePlayer ) then destroyElement ( getPedOccupiedVehicle ( thePlayer ) ) end end end end ) addEventHandler ( "onMarkerLeave", getResourceRootElement ( getThisResource ( ) ), function ( thePlayer ) if getElementType ( thePlayer ) == "player" then triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed ) setTimer ( giveWeapon, 500, 1, thePed, 25, 99999, true ) end end ) Link to comment
3NAD Posted November 23, 2012 Share Posted November 23, 2012 -- Server Side thePositions = { { 1514.3770751953, -1677.8481445313, 14.046875 }, { 1515.3770751953, -1677.8481445313, 14.046875 }, { 1516.3770751953, -1677.8481445313, 14.046875 }, { 1517.3770751953, -1677.8481445313, 14.046875 }, { 1518.3770751953, -1677.8481445313, 14.046875 }, { 1513.3770751953, -1678.8481445313, 14.046875 }, { 1513.3770751953, -1679.8481445313, 14.046875 }, { 1513.3770751953, -1680.8481445313, 14.046875 }, { 1513.3770751953, -1681.8481445313, 14.046875 }, { 1513.3770751953, -1682.8481445313, 14.046875 }, } for _, AllPositions in ipairs ( thePositions ) do thePed = createPed ( 124, AllPositions [1], AllPositions [2], AllPositions [3] ) theMarker = createMarker ( 0, 0, 0, "cylinder", 50, 0, 0, 0, 0 ) setPedStat ( thePed, 77, 999 ) setPedWeaponSlot ( thePed, 3 ) attachElements ( theMarker, thePed, 0, 0, -1 ) setTimer ( giveWeapon, 5000, 0, thePed, 25, 99999, true ) end addEventHandler ( "onMarkerHit", getResourceRootElement ( getThisResource ( ) ), function ( thePlayer ) if getElementType ( thePlayer ) == "player" then if getPlayerTeam ( thePlayer ) == getTeamFromName ( "Skulls" ) then triggerClientEvent ( thePlayer, "setPedAttacking", thePlayer, thePed ) if isPedInVehicle ( thePlayer ) then destroyElement ( getPedOccupiedVehicle ( thePlayer ) ) end end end end ) addEventHandler ( "onMarkerLeave", getResourceRootElement ( getThisResource ( ) ), function ( thePlayer ) if getElementType ( thePlayer ) == "player" then triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePed ) setTimer ( giveWeapon, 500, 1, thePed, 25, 99999, true ) end end ) Link to comment
emad10 Posted November 23, 2012 Share Posted November 23, 2012 مو كلهم يطلقون بس واحد + يطلع ذا الخطأ [2012-11-24 06:27:11] WARNING: 43\server.lua:27: Bad 'element' pointer @ 'getElementType'(1) Link to comment
3NAD Posted November 24, 2012 Share Posted November 24, 2012 (edited) هي شغلة بسيطة والمفروض تعتمد على نفسك -- Server Side thePositions = { { 1514.3770751953, -1677.8481445313, 14.046875 }, { 1515.3770751953, -1677.8481445313, 14.046875 }, { 1516.3770751953, -1677.8481445313, 14.046875 }, { 1517.3770751953, -1677.8481445313, 14.046875 }, { 1518.3770751953, -1677.8481445313, 14.046875 }, { 1513.3770751953, -1678.8481445313, 14.046875 }, { 1513.3770751953, -1679.8481445313, 14.046875 }, { 1513.3770751953, -1680.8481445313, 14.046875 }, { 1513.3770751953, -1681.8481445313, 14.046875 }, { 1513.3770751953, -1682.8481445313, 14.046875 }, } for _, AllPositions in ipairs ( thePositions ) do createPed ( 124, AllPositions [1], AllPositions [2], AllPositions [3] ) createMarker ( AllPositions [1], AllPositions [2], AllPositions [3] - 1, "cylinder", 5, 0, 0, 0, 0 ) for _, thePeds in ipairs ( getElementsByType ( "ped", getResourceRootElement ( getThisResource() ) ) ) do setPedStat ( thePeds, 77, 999 ) setPedWeaponSlot ( thePeds, 3 ) setTimer ( giveWeapon, 5000, 0, thePeds, 25, 99999, true ) end end addEventHandler ( "onMarkerHit", getResourceRootElement ( getThisResource ( ) ), function ( thePlayer ) if getElementType ( thePlayer ) == "player" then if getPlayerTeam ( thePlayer ) == getTeamFromName ( "Skulls" ) then for _, thePeds in ipairs ( getElementsByType ( "ped", getResourceRootElement ( getThisResource() ) ) ) do triggerClientEvent ( thePlayer, "setPedAttacking", thePlayer, thePeds ) end if isPedInVehicle ( thePlayer ) then destroyElement ( getPedOccupiedVehicle ( thePlayer ) ) end end end end ) addEventHandler ( "onMarkerLeave", getResourceRootElement ( getThisResource ( ) ), function ( thePlayer ) if getElementType ( thePlayer ) == "player" then if getPlayerTeam ( thePlayer ) == getTeamFromName ( "Skulls" ) then for _, thePeds in ipairs ( getElementsByType ( "ped", getResourceRootElement ( getThisResource() ) ) ) do triggerClientEvent ( thePlayer, "setPedStanding", thePlayer, thePeds ) setTimer ( giveWeapon, 500, 1, thePeds, 25, 99999, true ) end end end end ) Edited November 24, 2012 by Guest Link to comment
MrCor Posted November 24, 2012 Author Share Posted November 24, 2012 خلاص شباب هذا موضوعي وتمت الأفاده الأخ عماد خلاص بكلم تابل يصك الموضوع Link to comment
./BlackBird# Posted November 24, 2012 Share Posted November 24, 2012 خلاص شباب هذا موضوعي وتمت الأفادهالأخ عماد خلاص بكلم تابل يصك الموضوع عماد اجل؟ يصك الموضوع؟ Link to comment
Bhrany-danger Posted November 24, 2012 Share Posted November 24, 2012 ساعدووووووني يقصد ذا ما يقصد عناد 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