abdalbaset Posted February 8, 2014 Share Posted February 8, 2014 شباب عندي مشكلة في الكود عملته بس لما اشغلة البيد مايصوب على الاعب لذا بدي اعمل كول شيب قرات في الويكيس بس ما استفدت كثير مكن تساعدوني مع الشرح لو سمحتم Server side addEventHandler( "onResourceStart", resourceRoot, function( ) local ped = createPed( 191, 2493.623, -1668.179, 13.343, 90 ) setTimer( function( ped ) if ( not isElement( ped ) ) then return end giveWeapon( ped, 22, 9999, true ) triggerClientEvent( root, "onPedControl", ped ) end, 100, 1, ped ) end ) Client side addEvent( "onPedControl", true ) addEventHandler( "onPedControl", root, function( ) setPedControlState( source, "fire", true ) end ) Link to comment
فاّرس Posted February 8, 2014 Share Posted February 8, 2014 تريقر للبيد؟ -__-" سوي الكود بالكلينت , وبعدين سوي تريقر للسيرفر Link to comment
abdalbaset Posted February 9, 2014 Author Share Posted February 9, 2014 (edited) اخي انا جديد على البرمجة لذا صعب شوي اعمل زي ما قلت بس انا فهمت الفكرة فممكن تساعدني في البقاي عملت فنكشين للاعب اذا بيدخل الكول شيب بس مش عارف شو احط فيها (انا اقصد الفنكشن في الكلينت) .وشكرا على الرد كلينت colsp1=createColSphere ( 2493.623, -1668.179, 13.343, 15 ) addEvent( "onPedControl", true ) addEventHandler( "onPedControl", root, function( ) setPedControlState( source, "fire", true ) end ) function colh(player) ---------وش احط هنا عشان البد يصوب على الللعب end addEventHandler("onColShapeHit",colsp1,colh) سيرفر addEventHandler( "onResourceStart", resourceRoot, function( ) local ped = createPed( 191, 2493.623, -1668.179, 13.343, 90 ) setTimer( function( ped ) if ( not isElement( ped ) ) then return end giveWeapon( ped, 27, 9999, true ) triggerClientEvent( root, "onPedControl", ped ) triggerClientEvent( root, "onColShapeHit", ped ) end, 100, 1, ped ) end ) Edited February 9, 2014 by Guest Link to comment
abdalbaset Posted February 9, 2014 Author Share Posted February 9, 2014 حد حيساعدني ولا ما لي الا الله? د Link to comment
abdalbaset Posted February 10, 2014 Author Share Posted February 10, 2014 شباب انا اسف اذا كنت مزعج بس ممكن حد يساعدني او اروح المنتدى الاجنبي يساعدوني؟ Link to comment
al-Kobra Posted February 10, 2014 Share Posted February 10, 2014 شباب انا اسف اذا كنت مزعج بس ممكن حد يساعدنياو اروح المنتدى الاجنبي يساعدوني؟ وش تبغي ؟؟ Link to comment
abdalbaset Posted February 10, 2014 Author Share Posted February 10, 2014 الفنكشن الي في الكلينت الي فوق ما اعرف وش اعمل فيها هشان اخلي البيد يطلق النار على اي لاعب يدخل الكوشيب شوف الشرح في الكلينت Link to comment
al-Kobra Posted February 10, 2014 Share Posted February 10, 2014 (edited) هذا مثل طلبك ,, بس بدل الماركر بالكول شيب -- Server Side thePed = createPed ( 282, 1513.3770751953, -1677.8481445313, 14.046875 ) theMarker = createMarker ( 0, 0, 0, "cylinder", 15, 0, 0, 0, 0 ) setPedStat ( thePed, 77, 999 ) setPedWeaponSlot ( thePed, 3 ) attachElements ( theMarker, thePed, 0, 0, -1 ) setTimer ( giveWeapon, 5000, 0, thePed, 30, 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, 30, 99999, true ) end end ) -- Client Side addEvent ( "setPedAttacking", true ) addEventHandler ( "setPedAttacking", root, function ( thePed ) setTimer ( function ( ) x, y, z = getElementPosition ( localPlayer ) setPedAimTarget ( thePed, x, y, z ) end , 100, 0 ) setPedControlState ( thePed, "fire", true ) outputChatBox ( "* Start Shooting !!!", 255, 255, 0, true ) end ) addEvent ( "setPedStanding", true ) addEventHandler ( "setPedStanding", root, function ( thePed ) setPedControlState ( thePed, "fire", false ) outputChatBox ( "* Stop Shooting !!!", 255, 255, 0, true ) for _, x3NAD in ipairs ( getTimers ( 100 ) ) do killTimer ( x3NAD ) end end ) Edited February 10, 2014 by Guest Link to comment
Mr.T9 Posted February 10, 2014 Share Posted February 10, 2014 هذا مثل طلبك ,, بس بدل الماركر بالكول شيب [quote="3NAD"][lua]-- Server Side thePed = createPed ( 282, 1513.3770751953, -1677.8481445313, 14.046875 ) theMarker = createMarker ( 0, 0, 0, "cylinder", 15, 0, 0, 0, 0 ) setPedStat ( thePed, 77, 999 ) setPedWeaponSlot ( thePed, 3 ) attachElements ( theMarker, thePed, 0, 0, -1 ) setTimer ( giveWeapon, 5000, 0, thePed, 30, 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, 30, 99999, true ) end end ) -- Client Side addEvent ( "setPedAttacking", true ) addEventHandler ( "setPedAttacking", root, function ( thePed ) setTimer ( function ( ) x, y, z = getElementPosition ( localPlayer ) setPedAimTarget ( thePed, x, y, z ) end , 100, 0 ) setPedControlState ( thePed, "fire", true ) outputChatBox ( "* Start Shooting !!!", 255, 255, 0, true ) end ) addEvent ( "setPedStanding", true ) addEventHandler ( "setPedStanding", root, function ( thePed ) setPedControlState ( thePed, "fire", false ) outputChatBox ( "* Stop Shooting !!!", 255, 255, 0, true ) for _, x3NAD in ipairs ( getTimers ( 100 ) ) do killTimer ( x3NAD ) end end ) [/lua] [lua] ??لو حطيته بملف السيرفر ماراح يشتغل Link to comment
abdalbaset Posted February 10, 2014 Author Share Posted February 10, 2014 هذا مثل طلبك ,, بس بدل الماركر بالكول شيب [quote="3NAD"][lua]-- Server Side thePed = createPed ( 282, 1513.3770751953, -1677.8481445313, 14.046875 ) theMarker = createMarker ( 0, 0, 0, "cylinder", 15, 0, 0, 0, 0 ) setPedStat ( thePed, 77, 999 ) setPedWeaponSlot ( thePed, 3 ) attachElements ( theMarker, thePed, 0, 0, -1 ) setTimer ( giveWeapon, 5000, 0, thePed, 30, 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, 30, 99999, true ) end end ) -- Client Side addEvent ( "setPedAttacking", true ) addEventHandler ( "setPedAttacking", root, function ( thePed ) setTimer ( function ( ) x, y, z = getElementPosition ( localPlayer ) setPedAimTarget ( thePed, x, y, z ) end , 100, 0 ) setPedControlState ( thePed, "fire", true ) outputChatBox ( "* Start Shooting !!!", 255, 255, 0, true ) end ) addEvent ( "setPedStanding", true ) addEventHandler ( "setPedStanding", root, function ( thePed ) setPedControlState ( thePed, "fire", false ) outputChatBox ( "* Stop Shooting !!!", 255, 255, 0, true ) for _, x3NAD in ipairs ( getTimers ( 100 ) ) do killTimer ( x3NAD ) end end ) [/lua] [lua] ??لو حطيته بملف السيرفر ماراح يشتغل وش اسوي هسا؟ Link to comment
al-Kobra Posted February 10, 2014 Share Posted February 10, 2014 (edited) #سيرفر -- Server Side thePed = createPed ( 282, 1513.3770751953, -1677.8481445313, 14.046875 ) theMarker = createMarker ( 0, 0, 0, "cylinder", 15, 0, 0, 0, 0 ) setPedStat ( thePed, 77, 999 ) setPedWeaponSlot ( thePed, 3 ) attachElements ( theMarker, thePed, 0, 0, -1 ) setTimer ( giveWeapon, 5000, 0, thePed, 30, 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, 30, 99999, true ) end end ) #كلينت -- Client Side addEvent ( "setPedAttacking", true ) addEventHandler ( "setPedAttacking", root, function ( thePed ) setTimer ( function ( ) x, y, z = getElementPosition ( localPlayer ) setPedAimTarget ( thePed, x, y, z ) end , 100, 0 ) setPedControlState ( thePed, "fire", true ) outputChatBox ( "* Start Shooting !!!", 255, 255, 0, true ) end ) addEvent ( "setPedStanding", true ) addEventHandler ( "setPedStanding", root, function ( thePed ) setPedControlState ( thePed, "fire", false ) outputChatBox ( "* Stop Shooting !!!", 255, 255, 0, true ) for _, x3NAD in ipairs ( getTimers ( 100 ) ) do killTimer ( x3NAD ) end end ) Edited February 10, 2014 by Guest Link to comment
Mr.T9 Posted February 10, 2014 Share Posted February 10, 2014 ^^ خطا بسيط ض1 thePed = createPed ( 282, 1513.3770751953, -1677.8481445313, 14.046875 ) theMarker = createMarker ( 0, 0, 0, "cylinder", 15, 0, 0, 0, 0 ) setPedStat ( thePed, 77, 999 ) setPedWeaponSlot ( thePed, 3 ) attachElements ( theMarker, thePed, 0, 0, -1 ) setTimer ( giveWeapon, 5000, 0, thePed, 30, 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, 30, 99999, true ) 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