Jump to content

x[ تعديل ]x تحقق


Recommended Posts

السلام عليكم ده كود يخلي السيارة تطلق صاروخ

عاوزه يتحقق اذا الي يقود السيارة كونسول يعطه الصاروخ و اذا مش كونسول ما يعته الصاروخ

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

كده؟

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

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 by Guest
Link to comment

للافاده

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

----------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
----------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 
) 
  

:shock::shock:

Link to comment
----------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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...