SaedAmer Posted July 13, 2016 Share Posted July 13, 2016 السلام عليكم ده كود يخلي السيارة تطلق صاروخ عاوزه يتحقق اذا الي يقود السيارة كونسول يعطه الصاروخ و اذا مش كونسول ما يعته الصاروخ function shootProjectile() local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end bindKey("vehicle_fire", "down", shootProjectile) Link to comment
' A F . Posted July 13, 2016 Share Posted July 13, 2016 استخدم triggerServerEvent getPlayerAccount isGuestAccount getAccountName isObjectInACLGroup triggerClientEvent Link to comment
SaedAmer Posted July 13, 2016 Author Share Posted July 13, 2016 كده؟ function shootProjectile() local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) triggerServerEvent("Cheakacl", localPlayer) end end bindKey("vehicle_fire", "down", shootProjectile) سيرفر addEvent('Cheakacl', true) addEventHandler( 'Cheakacl', root, function ( ) if isGuestAccount ( sourceAccount ) then cancelEvent ( ) else if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then local getPlayerAccount(thePlayer) getAccountName ( account theAccount ) triggerClientEvent ("Cheakacl", localPlayer) Link to comment
N3xT Posted July 13, 2016 Share Posted July 13, 2016 (edited) Client : function shootProjectile() triggerServerEvent("check", localPlayer, localPlayer) end bindKey("vehicle_fire", "down", shootProjectile) bindKey("lctrl", "down", shootProjectile) bindKey("rctrl", "down", shootProjectile) addEvent('shoot', true) addEventHandler('shoot', root, function () local vehicle = getPedOccupiedVehicle(localPlayer) local rX,rY,rZ = getElementRotation(vehicle) local x, y, z = getElementPosition(vehicle) local x = x+4*math.cos(math.rad(rZ+90)) local y = y+4*math.sin(math.rad(rZ+90)) if ( vehicle ) then createProjectile(vehicle, 19, x, y, z, 1.0, nil) end end) Server : addEvent('check', true) addEventHandler('check', root, function ( plr ) if (getPlayerAccount(plr)) and not (isGuestAccount(getPlayerAccount(plr))) then if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)), aclGetGroup ( "Console" ) ) then triggerClientEvent ("shoot", source) end end end) Edited July 13, 2016 by Guest Link to comment
SaedAmer Posted July 13, 2016 Author Share Posted July 13, 2016 وش يجي بالديبق يجي تحذير من تحقق الاكونت Link to comment
Jupi Posted July 13, 2016 Share Posted July 13, 2016 انا اقول استعملو الداتا احسن من التريقرات يوم يسجل دخول يتحقق انه كونسل لو هو كونسل يعطيه الداتا و تحققو من الكلاينت Link to comment
SaedAmer Posted July 13, 2016 Author Share Posted July 13, 2016 ما شتغل اساسا و ما في شئ بالدي بق Link to comment
N3xT Posted July 13, 2016 Share Posted July 13, 2016 الكود مجرب وشغال ، المشكلة منك أنت Link to comment
#|_oskar_|# Posted July 13, 2016 Share Posted July 13, 2016 للافاده bindKey("vehicle_fire", "down",function () if getElementData(localPlayer,"Console") == true then local vehicle = getPedOccupiedVehicle(localPlayer) local rX,rY,rZ = getElementRotation(vehicle) local x, y, z = getElementPosition(vehicle) local x = x+4*math.cos(math.rad(rZ+90)) local y = y+4*math.sin(math.rad(rZ+90)) createProjectile(vehicle, 19, x, y, z, 1.0, nil) end end) addEventHandler("onPlayerLogin",root,function () if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ( "Console" )) then setElementData(source, "Console",true) end end) addEventHandler("onPlayerLogout", root,function () setElementData(source, "Console",false) end) Link to comment
' A F . Posted July 13, 2016 Share Posted July 13, 2016 ^ طيب اعتبر الاعب مسجل دخول من قبل وشغلت المود ذذ .. لازم يسجل خروج وبعدين يسجل دخول onResourceStart Link to comment
#|_oskar_|# Posted July 13, 2016 Share Posted July 13, 2016 ^ طيب اعتبر الاعب مسجل دخول من قبل وشغلت المود ذذ .. لازم يسجل خروج وبعدين يسجل دخول onResourceStart صح نسيتها معلش Link to comment
' A F . Posted July 13, 2016 Share Posted July 13, 2016 ^ طيب اعتبر الاعب مسجل دخول من قبل وشغلت المود ذذ .. لازم يسجل خروج وبعدين يسجل دخول onResourceStart صح نسيتها معلش np. Link to comment
SaedAmer Posted July 13, 2016 Author Share Posted July 13, 2016 كده يقبل علي اي سيارة ؟ Link to comment
' A F . Posted July 13, 2016 Share Posted July 13, 2016 كده يقبل علي اي سيارة ؟ نعم . لو تبيه ع سيارة محددة استخدم getElementModel Link to comment
SaedAmer Posted July 13, 2016 Author Share Posted July 13, 2016 تمات الافاداة شوكراااا جمايعاااا Link to comment
' A F . Posted July 13, 2016 Share Posted July 13, 2016 تمات الافاداةشوكراااا جمايعاااا العفو حياك الله Link to comment
Kara Posted July 13, 2016 Share Posted July 13, 2016 ----------client function fire() triggerServerEvent("isAdmin",localPlayer) end bindKey("vehicle_fire", "down", fire) addEvent("Yes",true) addEventHandler("Yes",root, function () local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end ) ------server addEvent("isAdmin",true) addEventHandler("isAdmin",root, function () if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)),aclGetGroup("Console")) then triggerClientEvent(source,"Yes",source) end end ) Link to comment
' A F . Posted July 13, 2016 Share Posted July 13, 2016 ----------client function fire() triggerServerEvent("isAdmin",localPlayer) end bindKey("vehicle_fire", "down", fire) addEvent("Yes",true) addEventHandler("Yes",root, function () local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end ) ------server addEvent("isAdmin",true) addEventHandler("isAdmin",root, function () if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)),aclGetGroup("Console")) then triggerClientEvent(source,"Yes",source) end end ) Link to comment
N3xT Posted July 13, 2016 Share Posted July 13, 2016 ----------client function fire() triggerServerEvent("isAdmin",localPlayer) end bindKey("vehicle_fire", "down", fire) addEvent("Yes",true) addEventHandler("Yes",root, function () local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) end end ) ------server addEvent("isAdmin",true) addEventHandler("isAdmin",root, function () if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)),aclGetGroup("Console")) then triggerClientEvent(source,"Yes",source) 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