Jump to content

مشكلة كود


Recommended Posts

هلا شباب

لو سمحتم عندي كود بس ما حاب يشتغل

client side

function JetpackGive () 
triggerServerEvent ( "onJetpack",localPlayer)  
end 
addEventHandler ( "onClientGUIClick", GUIEditor.button[5] , JetpackGive, false ) 
  

Server side

function JetpackGive  ( ) 
   local hasJetPack = doesPedHaveJetPack ( source ) 
   outputChatBox ("[VIP]You are got or deleted jetpack",source,255,255,0,false) 
if ( hasJetPack ) then   
removePedJetPack ( source )   
else 
givePedJetPack ( source ) 
end 
end 
  end 
addEvent( "onJetpack", true ) 
addEventHandler( "onJetpack", getRootElement(), JetpackGive ) 

Link to comment
function JetpackGive  ( ) 
  
   local hasJetPack = doesPedHaveJetPack ( source ) 
  
   outputChatBox ("[VIP]You are got or deleted jetpack",source,255,255,0,false) 
  
if ( hasJetPack ) then   
  
        removePedJetPack ( source )   
  
           else 
  
        givePedJetPack ( source ) 
  
      end 
 end 
      addEvent( "onJetpack", true ) 
      addEventHandler( "onJetpack", getRootElement(), JetpackGive ) 
  

كان فيه آند زآيده في سطر -10- بي ملف السيرفر

Link to comment

كودك طويل ومافي داعي المسافات

تفضل كود قصير :)

addEvent("onJetpack", true) 
addEventHandler("onJetpack", root, function( ) 
    _G[(doesPedHaveJetPack(source) and "remove" or "give").."PedJetPack"](source)   
    outputChatBox("[VIP]You are "..(doesPedHaveJetPack(source) and "got" or "deleted").." jetpack", source, 255, 255, 0) 
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...