Jump to content

[Request] fix JetPack codes - أكواد النفآثة


3NAD

Recommended Posts

آلسسلآم عليككمـ ..

أخوآإني أنآ وضعت أكواد و عند آلششرآء يعطي النفآثة

ولكن آلزر اللي يقـفـلهآ لآ يعمل

يقول :

Bad Arguments

و هذي الأكواد ..

addEvent("jet", true) 
 function jet() 
    local playerMoney = getPlayerMoney(source) 
    if playerMoney >= 1500 then 
    takePlayerMoney (source,1500) 
    givePedJetPack ( source ) 
    outputChatBox("* #0099ccSuccessfully bought JetPack #000000[ #ff0000-$1500 #000000]#00ff00 Press 'j' To remove it !",source,0,255,0,true) 
    elseif playerMoney <= 1500 then 
    outputChatBox("* you Don't have enough Money !",source,255,0,0,true) 
    end 
end 
addEventHandler("jet", getRootElement(),jet) 
  
function jetpack(thePlayer) 
local jp = doesPedHaveJetPack ( thePlayer ) 
    if  jp then 
        removePedJetPack ( thePlayer ) 
    end 
end  
bindKey ("j", "up", jetpack ) 

و يآليت لو تخلون لهآ مدة ..

يعني من وقت آلششرآء تأخذ دقيقتآن ثم تنتهي ( تنحذف

^ وششكراً لكم مقدماً

Link to comment
آلسسلآم عليككمـ ..

أخوآإني أنآ وضعت أكواد و عند آلششرآء يعطي النفآثة

ولكن آلزر اللي يقـفـلهآ لآ يعمل

يقول :

Bad Arguments

و هذي الأكواد ..

addEvent("jet", true) 
 function jet() 
    local playerMoney = getPlayerMoney(source) 
    if playerMoney >= 1500 then 
    takePlayerMoney (source,1500) 
    givePedJetPack ( source ) 
    outputChatBox("* #0099ccSuccessfully bought JetPack #000000[ #ff0000-$1500 #000000]#00ff00 Press 'j' To remove it !",source,0,255,0,true) 
    elseif playerMoney <= 1500 then 
    outputChatBox("* you Don't have enough Money !",source,255,0,0,true) 
    end 
end 
addEventHandler("jet", getRootElement(),jet) 
  
function jetpack(thePlayer) 
local jp = doesPedHaveJetPack ( thePlayer ) 
    if  jp then 
        removePedJetPack ( thePlayer ) 
    end 
end  
bindKey ("j", "up", jetpack ) 

و يآليت لو تخلون لهآ مدة ..

يعني من وقت آلششرآء تأخذ دقيقتآن ثم تنتهي ( تنحذف

^ وششكراً لكم مقدماً

وبالنسبة لل bind

اقرأ الويكي

Required Arguments

thePlayer: The player you wish to bind the key of.

هذا الحل

addEvent("jet", true) 
 function jet() 
    local playerMoney = getPlayerMoney(source) 
    if playerMoney >= 1500 then 
    takePlayerMoney (source,1500) 
    givePedJetPack ( source ) 
    outputChatBox("* #0099ccSuccessfully bought JetPack #000000[ #ff0000-$1500 #000000]#00ff00 Press 'j' To remove it !",source,0,255,0,true) 
setTimer ( removePedJetPack, 60000, 1,source) 
else 
    outputChatBox("* you Don't have enough Money !",source,255,0,0,true) 
    end 
end 
addEventHandler("jet", getRootElement(),jet) 
addEvent("GJet",true)  
  
addEventHandler("GJet",root,  
  
function() 
  
    givePedJetPack(source)  
     
end  
  
) 
  
addEvent("reJet",true)  
  
addEventHandler("reJet",root,  
  
function() 
      
    removePedJetPack ( source )      
  
end  
  
) 
  
  

كلنت

function CjETBind () 
local jp = doesPedHaveJetPack (getLocalPlayer()) 
    if  jp then 
        triggerServerEvent ("reJet", getLocalPlayer()) 
else 
        triggerServerEvent ("GJet", getLocalPlayer()) 
end 
end 
bindKey("j","down",CjETBind) 

Link to comment
  • Other Languages Moderators

-- Server Side --

addEvent("jet", true) 
addEventHandler("jet",root, 
function() 
     if getPlayerMoney(source) >= 1500 then 
          takePlayerMoney(source,1500) 
          givePedJetPack(source) 
          bindKey(source,"j", "down", jetpack) 
          setTimer(unbindKey,120000,1,source,"j","down",jetpack) 
          outputChatBox("* #0099ccSuccessfully bought JetPack #000000[ #ff0000-$1500 #000000]#00ff00 Press 'j' To remove it !",source,0,255,0,true) 
     else 
          outputChatBox("* you Don't have enough Money !",source,255,0,0,true) 
     end 
end) 
  
function jetpack(player) 
     if doesPedHaveJetPack(player) then 
          removePedJetPack(player) 
     else 
          givePedJetPack(player) 
     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...