Jump to content

مساعده :)


nony

Recommended Posts

السلام عليكم

يا شباب سويت شوب ريس بس ابي اضيف اختصارات للشراء

مثلا

bind 1 buy nitro

اذا الاعب ضغط رقم 1 يشتري نيترو

ذا الي قدرت عليه

addCommandHandler ( "nitro",  
function() 
     local PlayerMoney = getPlayerMoney(source) 
     if (PlayerMoney >= 3000) then 
          if isPedInVehicle(source) then 
               takePlayerMoney(source,3000) 
               local name = getPlayerName(source) 
               addVehicleUpgrade(getPedOccupiedVehicle(source), 1010) 
               outputChatBox("#ffffff[ #0000ff".. name .." #ffffff] #007fffhas bought [ #ffff00Nitro #007fff]", source, 255, 255, 0, true)   
          else 
               outputChatBox("#007fffYou Dont Have [#999999 3,000 #007fff]", source, 255, 0, 0, true)     
          end 
     end 
end) 

Link to comment
bindKey(player,"1","down",function() 
     local PlayerMoney = getPlayerMoney(source) 
     if (PlayerMoney >= 3000) then 
          if isPedInVehicle(source) then 
               takePlayerMoney(source,3000) 
               local name = getPlayerName(source) 
               addVehicleUpgrade(getPedOccupiedVehicle(source), 1010) 
               outputChatBox("#ffffff[ #0000ff".. name .." #ffffff] #007fffhas bought [ #ffff00Nitro #007fff]", source, 255, 255, 0, true)   
          else 
               outputChatBox("#007fffYou Dont Have [#999999 3,000 #007fff]", source, 255, 0, 0, true)     
          end 
     end 
end) 
  

Edited by Guest
Link to comment
  • Other Languages Moderators
function buyN() 
     local PlayerMoney = getPlayerMoney(source) 
     if (PlayerMoney >= 3000) then 
          if isPedInVehicle(source) then 
               takePlayerMoney(source,3000) 
               local name = getPlayerName(source) 
               addVehicleUpgrade(getPedOccupiedVehicle(source), 1010) 
               outputChatBox("#ffffff[ #0000ff".. name .." #ffffff] #007fffhas bought [ #ffff00Nitro #007fff]", source, 255, 255, 0, true)   
          else 
               outputChatBox("#007fffYou Dont Have [#999999 3,000 #007fff]", source, 255, 0, 0, true)     
          end 
     end 
end 
bindKey(source,"1",down,buyN) 

bindKey(source,"1",down,buyN) 

source = ??

down = ??

Link to comment
function buyN() 
     local PlayerMoney = getPlayerMoney(source) 
     if (PlayerMoney >= 3000) then 
          if isPedInVehicle(source) then 
               takePlayerMoney(source,3000) 
               local name = getPlayerName(source) 
               addVehicleUpgrade(getPedOccupiedVehicle(source), 1010) 
               outputChatBox("#ffffff[ #0000ff".. name .." #ffffff] #007fffhas bought [ #ffff00Nitro #007fff]", source, 255, 255, 0, true)   
          else 
               outputChatBox("#007fffYou Dont Have [#999999 3,000 #007fff]", source, 255, 0, 0, true)     
          end 
     end 
end 
bindKey(source,"1",down,buyN) 

bindKey(source,"1",down,buyN) 

source = ??

down = ??

:oops::oops::oops:

Link to comment
bindKey(player,"1","down",function() 
     local PlayerMoney = getPlayerMoney(source) 
     if (PlayerMoney >= 3000) then 
          if isPedInVehicle(source) then 
               takePlayerMoney(source,3000) 
               local name = getPlayerName(source) 
               addVehicleUpgrade(getPedOccupiedVehicle(source), 1010) 
               outputChatBox("#ffffff[ #0000ff".. name .." #ffffff] #007fffhas bought [ #ffff00Nitro #007fff]", source, 255, 255, 0, true)   
          else 
               outputChatBox("#007fffYou Dont Have [#999999 3,000 #007fff]", source, 255, 0, 0, true)     
          end 
     end 
end) 
  

bindKey(player,"1","down" 

player = ??

Link to comment
 --- Server Side 
for _, thePlayer in ipairs ( getElementsByType("player") ) do 
    bindKey( thePlayer, "1", "down", BuyNitro ) 
end 
  
function BuyNitro ( thePlayer ) 
    local playerMoney = getPlayerMoney ( thePlayer ) 
    local playerName = getPlayerName ( thePlayer ) 
    local playerVehicle = getPedOccupiedVehicle ( thePlayer ) 
     
    if playerMoney >= 3000 then 
        if isPedInVehicle ( thePlayer ) then 
            takePlayerMoney ( thePlayer, 3000 ) 
            addVehicleUpgrade ( playerVehicle , 1010 ) 
            outputChatBox("#ffffff[ #0000ff".. playerName .." #ffffff] #007fffhas bought [ #ffff00Nitro #007fff]", root, 255, 255, 0, true)  
        else 
            outputChatBox("#007fffYou Must Be In Vehicle", thePlayer, 255, 0, 0, true)       
        end 
    else 
        outputChatBox("#007fffYou Dont Have [#999999 3,000 #007fff]", thePlayer, 255, 0, 0, true)     
    end 
end 
  

Link to comment
 --- Server Side 
for _, thePlayer in ipairs ( getElementsByType("player") ) do 
    bindKey( thePlayer, "1", "down", BuyNitro ) 
end 
  
function BuyNitro ( thePlayer ) 
    local playerMoney = getPlayerMoney ( thePlayer ) 
    local playerName = getPlayerName ( thePlayer ) 
    local playerVehicle = getPedOccupiedVehicle ( thePlayer ) 
     
    if playerMoney >= 3000 then 
        if isPedInVehicle ( thePlayer ) then 
            takePlayerMoney ( thePlayer, 3000 ) 
            addVehicleUpgrade ( playerVehicle , 1010 ) 
            outputChatBox("#ffffff[ #0000ff".. playerName .." #ffffff] #007fffhas bought [ #ffff00Nitro #007fff]", root, 255, 255, 0, true)  
        else 
            outputChatBox("#007fffYou Must Be In Vehicle", thePlayer, 255, 0, 0, true)       
        end 
    else 
        outputChatBox("#007fffYou Dont Have [#999999 3,000 #007fff]", thePlayer, 255, 0, 0, true)     
    end 
end 
  

اذا الاعب دخل بعد تشغيل المود

لازم تستخدم الايفينت

onPlayerJoin

Link to comment

يا شباب اقصد اذا اي واحد كتب

bind 1 buy nitro

يجي شراء نيترو اول مايضغط 1

واذا ماكتبها مايجيه لو ضغط 1 نيترو

او بعضهم يبون الاختصار رقم 0

bind 0 buy nitro

مابيه تلقائي الاختصار يجي على طول

اكثر شوبات الريس فيها كذا

الي عنده الكود يفيدنا

Link to comment
  • Other Languages Moderators
addCommandHandler("buy", 
function(player, cmd, what) 
     if what == "nitro" then 
          if (getPlayerMoney(player) >= 3000) then 
               local vehicle = getPedOccupiedVehicle(player) 
               if vehicle then 
                    takePlayerMoney(player,3000) 
                    local name = getPlayerName(player) 
                    addVehicleUpgrade(vehicle, 1010) 
                    outputChatBox("[ #0000ff"..name.." #ffffff] #007fffhas bought [ #ffff00Nitro #007fff]", player, 255,255,255,true) 
               else 
                    outputChatBox("You aren't in vehicle!", player, 255,0,0,true) 
               end 
          else 
               outputChatBox("You Dont Have [#999999 3,000 #007fff]", player, 0,127,255,true)     
          end 
     end 
end) 

Link to comment
يا شباب اقصد اذا اي واحد كتب

bind 1 buy nitro

يجي شراء نيترو اول مايضغط 1

واذا ماكتبها مايجيه لو ضغط 1 نيترو

او بعضهم يبون الاختصار رقم 0

bind 0 buy nitro

مابيه تلقائي الاختصار يجي على طول

اكثر شوبات الريس فيها كذا

الي عنده الكود يفيدنا

استخدم

setTimer 

bindKey 

addVehicleUpgrade 

getPedOccupiedVehicle 

الكود الكلنت

bindKey("0","down", 
function() 
    local theVehicle=getPedOccupiedVehicle(localPlayer) 
    if(theVehicle)then 
        setTimer(addVehicleUpgrade,50000,1,theVehicle,1010) 
        setTimer(removeVehicleUpgrade,10000,1,theVehicle,1010) 
    end 
        outputChatBox("تم تشغيل النيترو لمدة 50 ثانية") 
end) 

اذا كنت تبيها شراء وكذا , استخدم

triggerServerEvent 

getPlayerMoney 

takePlayerMoney 

Link to comment
يا شباب اقصد اذا اي واحد كتب

bind 1 buy nitro

يجي شراء نيترو اول مايضغط 1

واذا ماكتبها مايجيه لو ضغط 1 نيترو

او بعضهم يبون الاختصار رقم 0

bind 0 buy nitro

مابيه تلقائي الاختصار يجي على طول

اكثر شوبات الريس فيها كذا

الي عنده الكود يفيدنا

استخدم

setTimer 

bindKey 

addVehicleUpgrade 

getPedOccupiedVehicle 

الكود الكلنت

bindKey("0","down", 
function() 
    local theVehicle=getPedOccupiedVehicle(localPlayer) 
    if(theVehicle)then 
        setTimer(addVehicleUpgrade,50000,1,theVehicle,1010) 
        setTimer(removeVehicleUpgrade,10000,1,theVehicle,1010) 
    end 
        outputChatBox("تم تشغيل النيترو لمدة 50 ثانية") 
end) 

اذا كنت تبيها شراء وكذا , استخدم

triggerServerEvent 

getPlayerMoney 

takePlayerMoney 

انا ابي نفس طريقه تابل

جربته الكود تمام يشتري نيترو

بس عندي سؤال اصلاح السياره نفس النيترو؟

يعني اسوي مثل كود تابل

ولا في طريقه ثانيه؟

لاني جربت مانفع معي

جربت الصلاح السياره + flip

Link to comment

لالا باقي مشكله

الصتليح سويته تمام %100

باقي flip

addCommandHandler("buy", 
function(player, cmd, what) 
     if what == "flip" then 
          if (getPlayerMoney(player) >= 2000) then 
               local vehicle = getPedOccupiedVehicle(player) 
               if vehicle then 
                    takePlayerMoney(player,2000) 
                    rx, ry, rz = getVehicleRotation (vehicle) 
                    setVehicleRotation (vehicle, rx +180, ry, rz +180)) 
                    local name = getPlayerName(player) 
                    outputChatBox("[ #0000ff"..name.." #ffffff] #007fffhas bought [ #ffff00Flip #007fff]", player, 255,255,255,true) 
               else 
                    outputChatBox("You aren't in vehicle!", player, 255,0,0,true) 
               end 
          else 
               outputChatBox("You Dont Have [#999999 2,000 #007fff]", player, 0,127,255,true)     
          end 
     end 
end) 
  

وش الخطأ

Link to comment
  • Other Languages Moderators

في سطر 9 أنت حاط قوسين

setVehicleRotation (vehicle, rx +180, ry, rz +180)) 

عدله ليكون كذا

setVehicleRotation (vehicle, rx +180, ry, rz +180) 

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