Jump to content

مساعده :)


Recommended Posts

يا شباب بغيت اسأل

ذا الكود في خطأ؟

buttons.nitro10x = guiCreateButton(20,10,90,75, "Nitro 10x", false, tap3)  
labels.price_nitro10x = guiCreateLabel(20,80,90,30, "R$:1.800", false, tap3) 
guiLabelSetHorizontalAlign(labels.price_nitro10x, "center", false) 
guiSetFont(labels.price_nitro10x, "default-bold-small") 
guiSetProperty( buttons.nitro10x, "HoverTextColour", "FFFFFF00" ) 
     
----------------ربط الازرار---------------- 
elseif (source == buttons.nitro10x) then  
    player = localPlayer 
    local price_nitro10x = 500 
    money = getPlayerMoney (source) 
  
    if (money >= price_nitro10x) and getPedOccupiedVehicle(player) then 
    outputChatBox ("You bought #FF0000Nitro 10x #FFFFFFfor #00ff00$#FF0000"..price_nitro10x.."", 255, 255, 255, true) 
    takePlayerMoney(price_nitro10x) 
    addVehicleUpgrade( getPedOccupiedVehicle(player), 1010 ) 
  
    elseif money <= 1800 then 
    outputChatBox("You dont have enough money to buy Nitro 10x.", 255, 0, 0) 
  
    elseif not getPedOccupiedVehicle(player) then 
    outputChatBox("You should be in a vehicle.", 255, 0, 0) 
    end 
end) 

وفيه كود لسيرفر ولا لا؟ :?:

Link to comment

كذا صح ولا خطأ؟

كلنت

buttons.nitro10x = guiCreateButton(20,10,90,75, "Nitro 10x", false, tap3)  
labels.price_nitro10x = guiCreateLabel(20,80,90,30, "R$:1.800", false, tap3) 
guiLabelSetHorizontalAlign(labels.price_nitro10x, "center", false) 
guiSetFont(labels.price_nitro10x, "default-bold-small") 
guiSetProperty( buttons.nitro10x, "HoverTextColour", "FFFFFF00" ) 
     
--------------ربط الازرار------------------ 
elseif (source == buttons.nitro10x) then  
    player = localPlayer 
    local price_nitro10x = 500 
    money = getPlayerMoney (source) 

سيرفر

  
    if (money >= price_nitro10x) and getPedOccupiedVehicle(player) then 
    outputChatBox ("You bought #FF0000Nitro 10x #FFFFFFfor #00ff00$#FF0000"..price_nitro10x.."", 255, 255, 255, true) 
    takePlayerMoney(price_nitro10x) 
    addVehicleUpgrade( getPedOccupiedVehicle(player), 1010 ) 
  
    elseif money <= 1800 then 
    outputChatBox("You dont have enough money to buy Nitro 10x.", 255, 0, 0) 
  
    elseif not getPedOccupiedVehicle(player) then 
    outputChatBox("You should be in a vehicle.", 255, 0, 0) 
    end 
end) 

Link to comment

تفضل جرب هاذا اي خطاأ قولي

--server side--

addEvent("nitro-1", true) 
addEventHandler("nitro-1", getRootElement(), function() 
  
local PlayerMoney = getPlayerMoney(source) 
 if ( PlayerMoney >= 1800) then 
  
    takePlayerMoney(source,1800)  
  if isPedInVehicle(source) then 
      addVehicleUpgrade(getPedOccupiedVehicle(source), 1010) 
  
 local name = getPlayerName(source) 
      outputChatBox("تم اضافةالنتيرو لتشغيله اضغط CTRL", source, 255, 255, 0, true)   
    else 
    outputChatBox("انت لست بسيارتك", source, 255, 0, 0, true)  end 
end 
end) 

--client side--

  
    n1 = guiCreateButton(252,296,100,28,"نيترو-1",false,tab3) 
    Lnetro = guiCreateLabel(252,320,90,30,"Buy=$1800",false,tab3) 
---------------------Link Button------------ 
  
addEventHandler("onClientGUIClick", SaveChangesButton, accept, false)  
  
function onGuiClick (button, state, absoluteX, absoluteY) 
  if (source == n1) then 
    triggerServerEvent ("nitro-1", getLocalPlayer()) 
  end 
end 
addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) 
-----------Color Button----------- 
  guiSetProperty(n1, "NormalTextColour", "FF00FF00") 
  guiSetProperty(n1, "HoverTextColour", "FF00FF00") 

Link to comment
تفضل جرب هاذا اي خطاأ قولي

--server side--

addEvent("nitro-1", true) 
addEventHandler("nitro-1", getRootElement(), function() 
  
local PlayerMoney = getPlayerMoney(source) 
 if ( PlayerMoney >= 1800) then 
  
    takePlayerMoney(source,1800)  
  if isPedInVehicle(source) then 
      addVehicleUpgrade(getPedOccupiedVehicle(source), 1010) 
  
 local name = getPlayerName(source) 
      outputChatBox("تم اضافةالنتيرو لتشغيله اضغط CTRL", source, 255, 255, 0, true)   
    else 
    outputChatBox("انت لست بسيارتك", source, 255, 0, 0, true)  end 
end 
end) 

--client side--

  
    n1 = guiCreateButton(252,296,100,28,"نيترو-1",false,tab3) 
    Lnetro = guiCreateLabel(252,320,90,30,"Buy=$1800",false,tab3) 
---------------------Link Button------------ 
  
addEventHandler("onClientGUIClick", SaveChangesButton, accept, false)  
  
function onGuiClick (button, state, absoluteX, absoluteY) 
  if (source == n1) then 
    triggerServerEvent ("nitro-1", getLocalPlayer()) 
  end 
end 
addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) 
-----------Color Button----------- 
  guiSetProperty(n1, "NormalTextColour", "FF00FF00") 
  guiSetProperty(n1, "HoverTextColour", "FF00FF00") 

تصحيح للسيرفر

addEvent("nitro-1", true) 
addEventHandler("nitro-1", getRootElement(), function() 
     local PlayerMoney = getPlayerMoney(source) 
     if (PlayerMoney >= 1800) then 
          if isPedInVehicle(source) then 
               takePlayerMoney(source,1800) 
               local name = getPlayerName(source) 
               addVehicleUpgrade(getPedOccupiedVehicle(source), 1010) 
               outputChatBox("تم اضافةالنتيرو لتشغيله اضغط CTRL", source, 255, 255, 0, true)   
          else 
               outputChatBox("انت لست بسيارتك", source, 255, 0, 0, true) 
          end 
     else 
          outputChatBox("لايوجد معك مال كافي", source, 255, 0, 0, true) 
     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...