Jump to content

IamWooky

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by IamWooky

  1. IamWooky

    hide hud issue

    addEventHandler ( "onPlayerSpawn", root, function () setPlayerHudComponentVisible ( source, "ammo", false ) setPlayerHudComponentVisible ( source, "weapon", false ) setPlayerHudComponentVisible ( source, "armor", false ) setPlayerHudComponentVisible ( source, "health", false ) setPlayerHudComponentVisible ( source, "money", false ) setPlayerHudComponentVisible ( source, "breath", false ) setPlayerHudComponentVisible ( source, "clock", false ) setPlayerHudComponentVisible ( source, "radar", false ) end ) Problem was.. that you cannot see change.. until you reconnect.. i changed event to onPlayerSpawn.. also make sure that you put it in serverside script
  2. Nerevmind.. i made my own marker system.. with setElementVisibleTo.. and isElementVisibleTo..
  3. Thanks guys... works fine
  4. Im trying to make gun license script.. but when i restart resource.. player must buy it again.. i want to save it.. everything works fine but doesn't save after restarting resource or server Client: GunLicense= { button = {}, window = {} } addEvent("CallGuiLicense",true) function guilicense() showCursor(true) local screenW, screenH = guiGetScreenSize() GUIEditor.window[license] = guiCreateWindow(208, 311, 164, 171, "", false) guiWindowSetSizable(GUIEditor.window[license], false) GUIEditor.button[1] = guiCreateButton(30, 63, 97, 47, "Buy Gun License", false, GUIEditor.window[license]) addEventHandler ( "onClientGUIClick", GUIEditor.button[1], license, false) end addEventHandler ("CallGuiLicense",getRootElement(),guilicense) function license () triggerServerEvent("license", getLocalPlayer()) showCursor(false) guiSetVisible( GUIEditor.window[license] , false) end Server: local gunlicensemarker = createMarker(-2586.7861328125,162.4683380127,-6.8921875953674,"cylinder",1.5,255,0,0,100) function gunlicense() local money = getPlayerMoney(source) if license_data.have_gunlicense == 1 then outputChatBox("You already have Gun license",source,255,0,0,true) else local money = getPlayerMoney(source) if (money > 4999) then takePlayerMoney(source,5000) license_data.have_gunlicense = 1 else outputChatBox("You dont have enough money",source,255,0,0,true) end end end addEvent("license",true) addEventHandler("license",getRootElement(),gunlicense) function licenseGUI (player) if getElementType( player ) == "player" and not isPedInVehicle(player) then triggerClientEvent(player,"CallGuiLicense",player) end end addEventHandler("onMarkerHit",gunlicensemarker,licenseGUI)
  5. Need help .. iam new in scripting and iam using Bus driver role script... markers appear for all Bus drivers same .. and players are stealing from each other this markers and that sucks.. please help me to fix this.. Server: local rootElement = getRootElement() local Bus = createTeam("Bus Driver", 0, 255, 255) local busses = {[431] = true, [437] = true} local busTable = { [1]={-1998.1170654297, 382.66506958008, 35.015625}, [2]={1825.22791, -1635.03711, 13.38281}, } function getNewBusLocation(thePlayer, ID) local x, y, z = busTable[ID][1], busTable[ID][2], busTable[ID][3] triggerClientEvent(thePlayer,"bus_set_location",thePlayer,x,y,z) end function onVehicleEnter(thePlayer) if not busses[getElementModel(source)] then return end if not getPlayerTeam(thePlayer) then return end if getTeamName(getPlayerTeam(thePlayer)) == "Bus Driver" then local x, y, z = getNewBusLocation(thePlayer, 1) setElementData(thePlayer,"busData",1) end end addEventHandler("onVehicleEnter",rootElement,onVehicleEnter) addEvent("bus_finish",true) addEventHandler("bus_finish",rootElement, function (client) if not isPedInVehicle(client) then return end if not busses[getElementModel(getPedOccupiedVehicle(client))] then return end givePlayerMoney(client, 100) if #busTable == tonumber(getElementData(client,"busData")) then setElementData(client,"busData",1) else setElementData(client,"busData",tonumber(getElementData(client,"busData"))+1) end getNewBusLocation(client, tonumber(getElementData(client,"busData"))) end)[/code] Client: [code=text]local client = getLocalPlayer( ) local rootElement = getRootElement() local marker = nil local blip = nil addEvent("bus_set_location",true) addEventHandler("bus_set_location",rootElement, function (x, y, z) marker = createMarker(tostring(x), tostring(y), tostring(z)-1, "cylinder", 3.5, 255, 255, 0, 170) blip = createBlipAttachedTo( marker, 0, 2, 255, 255, 0, 255 ) addEventHandler("onClientMarkerHit",marker,onBusStopHit) end) function onBusStopHit(hitPlayer) if not hitPlayer == client then return end triggerServerEvent("bus_finish",client,client) if isElement(blip) then destroyElement(blip) end if isElement(marker) then removeEventHandler("onClientMarkerHit",marker,onBusStopHit) destroyElement(marker) end end addEventHandler("onClientVehicleExit",rootElement, function () if isElement(marker) then removeEventHandler("onClientMarkerHit",marker,onBusStopHit) destroyElement(marker) end if isElement(blip) then destroyElement(blip) end end
×
×
  • Create New...