Jump to content

تصحيح كود


Mhmd.z

Recommended Posts

السلام عليكم ورحمة الله وبركاته

انا مسوي كود انه لما اكتب باف 8 كلمة يصنع اوبجكت بمكاني ....

function tankHat ( commandName ) 
local x, y, z = getElementPosition ( localPlayer ) 
local tank = createObject ( 1429, x, y , z, 0, 0, 0 ) 
end 
addCommandHandler ( "hat", tankHat ) 

ذا الكود ضابط وكل شي تمام لكن لو اجي ابي اشيل الاوبجكت ب زر ما ينفع ومعي ذا الكود

function brake() 
destroyElement(tank) 
end 
bindKey("x", "down", brake) 

تصحيح كود لو سمحتم :(

Link to comment
function tankHat ( commandName ) 
local x, y, z = getElementPosition ( localPlayer ) 
tank = createObject ( 1429, x, y , z, 0, 0, 0 ) 
end 
addCommandHandler ( "hat", tankHat ) 

function brake() 
     if isElement(tank) then 
          destroyElement(tank) 
     end 
end 
bindKey("x", "down", brake) 

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