Jump to content

Vaux42

Members
  • Posts

    5
  • Joined

  • Last visited

Vaux42's Achievements

Vic

Vic (3/54)

0

Reputation

  1. Vaux42

    Hotkey help

    Works perfectly, thanks for the help and the lightning fast reply
  2. Vaux42

    Hotkey help

    I want to repair the vehicle on the press of "F7" What's wrong with my code? function bindTheKeys bindKey("F7","down",fix) end addEventHandler("onClientResourceStart", resourceRoot, bindTheKeys) function fix local theVehicle = getPedOccupiedVehicle( localPlayer ) fixVehicle(theVehicle) end addEvent("fix",true) addEventHandler("fix",resourceRoot,fix)
  3. Thanks heaps for that, it works perfectly now!
  4. Vaux42

    Car Paintjobs

    Should be just as simple as replacing the paint job txd's.
  5. Hi, at the moment i'm scripting a new gamemode, and a component involves a GUI that lets you purchase weapons, items and vehicles. If i scripted it normally with IF statements, the script would have to go through all weapons, items and vehicles to find the button you clicked. As a result, i'm trying to limit its search range by making it only do a certain set of if statements for each tab, for example if the "Weapons" tab is open and you click a button, it will jump to a set of "if's" for which weapon button was clicked. Here is my client script at the moment, but the Purchase doesn't work function onClientGUIClick (button, state, absoluteX, absoluteYe) if selectedTab == TabItems then if (source == WepBtnSHOVEL) then money = getPlayerMoney (source) if (money >= 300) then player = getLocalPlayer() outputChatBox ("You bought a SHOVEL for $300",225,225,0) takePlayerMoney(300) triggerServerEvent ("GiveSHOVEL",getLocalPlayer(),GiveSHOVEL) else outputChatBox ("Your funds are too low") end elseif (source == WepBtnKATANA) then money = getPlayerMoney (source) if (money >= 500) then player = getLocalPlayer() outputChatBox ("You bought a KATANA for $500",225,225,0) takePlayerMoney(500) triggerServerEvent ("GiveKATANA",getLocalPlayer(),GiveKATANA) else outputChatBox ("Your funds are too low") end end end if (source == StephCloseBtn) then guiSetVisible (StephMission, false) showCursor (false) end end addEventHandler ("onClientGUIClick", getRootElement(), onClientGUIClick) Here's the Server element: function GiveSHOVEL () giveWeapon (source,6,1,true) end addEvent("GiveSHOVEL",true) addEventHandler("GiveSHOVEL",getRootElement(),GiveSHOVEL) function GiveKATANA () giveWeapon (source,8,1,true) end addEvent("GiveKATANA",true) addEventHandler("GiveKATANA",getRootElement(),GiveKATANA) What's wrong with it? Thanks
×
×
  • Create New...