-
Posts
732 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Bean666
-
i edited your code check it. if it works. make sure everything's right in meta.xml it's because u had an extra comma in the end of the GUIEditor table. if i were you i would make my GUI Relative, right click on your GUI via GUIEditor , click Relative, it would be better for people with other screen Resolution , that GUI will only be better / fit in your screen resolution.
-
is it working? i don't see anything wrong atm. try this if its not working: Edit: i think it's because u had an extra , comma in the end of the GUIEditor table. client: GUIEditor = { tab = {}, tabpanel = {}, label = {}, button = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(193, 147, 521, 353, "Oil Refinery - Job", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CloseButton", true) GUIEditor.label[1] = guiCreateLabel(10, 42, 129, 17, "Job's Name", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-small") GUIEditor.label[2] = guiCreateLabel(10, 59, 129, 17, "Income", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-small") GUIEditor.label[3] = guiCreateLabel(10, 76, 129, 17, "Rental Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[3], "default-small") GUIEditor.label[4] = guiCreateLabel(139, 42, 15, 17, "-", false, GUIEditor.window[1]) GUIEditor.label[5] = guiCreateLabel(139, 76, 15, 17, "-", false, GUIEditor.window[1]) GUIEditor.label[6] = guiCreateLabel(139, 59, 15, 17, "-", false, GUIEditor.window[1]) GUIEditor.label[7] = guiCreateLabel(154, 42, 333, 17, "Oil Refinery", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[7], "default-bold-small") GUIEditor.label[8] = guiCreateLabel(154, 59, 333, 17, "Not Set", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[8], "default-bold-small") GUIEditor.label[9] = guiCreateLabel(154, 76, 333, 17, "Yes", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[9], "default-bold-small") GUIEditor.label[10] = guiCreateLabel(232, 93, 106, 16, "Help", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(186, 303, 145, 40, "START JOB", false, GUIEditor.window[1]) GUIEditor.tabpanel[1] = guiCreateTabPanel(61, 118, 387, 166, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Basic Help ", GUIEditor.tabpanel[1]) GUIEditor.label[11] = guiCreateLabel(10, 5, 367, 127, "Your job is to extract oil and deliver it to refiner machine. After that refine the oil and it will be automatically stored in tanks. After that collect your money ...", false, GUIEditor.tab[1]) guiLabelSetHorizontalAlign(GUIEditor.label[11], "left", true) GUIEditor.tab[2] = guiCreateTab("How to do job ?", GUIEditor.tabpanel[1]) GUIEditor.label[12] = guiCreateLabel(6, 7, 371, 125, "This is a complex job. Follow the steps to complete the job - 1. Turn on the electric generator. 2. Switch on the power supply for machines. 3. Wait until progress bar shows 100%. 4. Now take your vehicle to every oil drill. 5. Now unload all the oil. 6. Turn on refiner. 7. Wait until it is refined 8. Now collect the money.", false, GUIEditor.tab[2]) guiLabelSetHorizontalAlign(GUIEditor.label[12], "left", true) GUIEditor.tab[3] = guiCreateTab("Miscs.", GUIEditor.tabpanel[1]) GUIEditor.label[13] = guiCreateLabel(6, 5, 371, 127, "The more you work the more you will get exp. .... The more exp. you have the more you earn ....", false, GUIEditor.tab[3]) guiLabelSetHorizontalAlign(GUIEditor.label[13], "left", true) addEvent("GUIhelp", true) function guishow(player) guiSetVisible(GUIEditor.window[1], true) showCursor(true) end addEventHandler("GUIhelp",getRootElement(),guishow) server: local marker = createMarker(2489,-1673,14, "cylinder", 1.5, 200, 150, 50, 150) function gui( hitElement ) if isPedInVehicle(hitElement) then return; end if getElementType( hitElement ) == "player" then triggerClientEvent(hitElement, "GUIhelp", hitElement) end end addEventHandler("onMarkerHit", root, gui)
-
both. if it's blue it's shared.
-
the problem with you is , you don't even know what you're doing , because you're not trying to learn by yourself , this is not a copy paste work , it's pretty boring seeing people not trying stuff by themselves.
-
would work , it can also work with tables. if you want the objects visible from far distance then this would work. local objects = getElementsByType("object") for i, v in ipairs(objects) do local ID = getElementModel (v) if ID == 3113 then local x,y,z = getElementPosition(v) local xr,yr,zr = getElementRotation(v) setLowLODElement(v,createObject ( getElementModel(v), x,y,z,xr,yr,zr,true )) end end local id = {3113,980, --[[add more ids here]]} for i, v in pairs (id) do -- your code here -- if ID == v then etc.. end
-
i get what you mean now , try just using resetTimer you could do it by yourself now.
-
try. replace server with this. function startVehicleChanging() vehChangeTimer = setTimer( function() for _,plr in pairs(getElementsByType("player")) do local veh = getPedOccupiedVehicle(plr) local model = vehicleIDS[math.random(1,#vehicleIDS)] if veh and model and getPedOccupiedVehicleSeat(plr) == 0 then local x,y,z = getElementVelocity(veh) setElementVelocity(veh,x,y,z+0.05) local hp = getElementHealth(veh) setElementModel(veh,model) setElementHealth(veh,hp) end end end ,15000,0) end addEvent("onRaceStateChanging",true) addEventHandler("onRaceStateChanging",root, function (new) if (new == "Running") then startVehicleChanging() triggerClientEvent(source,"onCounterStart",source) end if (new =="LoadingMap") then triggerClientEvent(source,"removeCounter",source) if isTimer(vehChangeTimer) then killTimer(vehChangeTimer) end end end )
-
Make a file called client.lua and server.lua, and if you already have a meta.xml file then copy and paste this: <meta> <info name="None" author="Random" description="None" version="1.0" type="script"></info> <script src="client.lua" type="client"></script> <script src="server.lua" type="server"></script> </meta>
-
this would do. if you would want the marker not accessable from air tho. Visit this: https://wiki.multitheftauto.com/wiki/Sc ... troduction Client: GUIEditor = { button = {}, window = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(242, 203, 297, 185, "Intro", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(47, 23, 205, 19, "Welcome to SKI-Skyline (RPG server)", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(88, 70, 103, 40, "Play", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "Tooltip", "start game") addEvent("GUI", true) function guishow(player) guiSetVisible(GUIEditor.window[1], true) showCursor(true) end addEventHandler("GUI",getRootElement(),guishow) Server: local marker = createMarker(x, y, z, "cylinder", 1.5, 200, 150, 50, 150) function gui( hitElement ) if isPedInVehicle(hitElement) then return; end if getElementType( hitElement ) == "player" then triggerClientEvent(hitElement, "GUI", hitElement) end end addEventHandler("onMarkerHit", root, gui)
-
try function m4p () triggerServerEvent ( "m4", getLocalPlayer(), m4 ) end addEventHandler ("onClientDXClick", m4, m4p) function m4 () giveWeapon (source, 31, 50, true) end addEvent ("m4", true) addEventHandler("m4", getRootElement() ,m4)
-
lol..... what are u even doing Server: function startVehicleChanging() if isTimer(vehChangeTimer) then killTimer(vehChangeTimer) end vehChangeTimer = setTimer( function() for _,plr in pairs(getElementsByType("player")) do local veh = getPedOccupiedVehicle(plr) local model = vehicleIDS[math.random(1,#vehicleIDS)] if veh and model and getPedOccupiedVehicleSeat(plr) == 0 then local x,y,z = getElementVelocity(veh) setElementVelocity(veh,x,y,z+0.05) local hp = getElementHealth(veh) setElementModel(veh,model) setElementHealth(veh,hp) end end end ,15000,0) end addEvent("onRaceStateChanging",true) addEventHandler("onRaceStateChanging",root, function (new) if (new == "Running") then startVehicleChanging() triggerClientEvent(source,"onCounterStart",source) end if (new =="LoadingMap") then triggerClientEvent(source,"removeCounter",source) if isTimer(vehChangeTimer) then killTimer(vehChangeTimer) end end end ) Client.lua function startEverything() addEventHandler("onClientRender",root,drawCounterSHI) timer = setTimer(function() counter = counter - 1 if counter < 0 then counter = 15 r,g,b = 0,255,0 end if counter <= 3 then r,g,b = 255,0,0 end end,1000,0) end addEvent("onCounterStart",true) addEventHandler("onCounterStart",getRootElement(),startEverything) addEvent("removeCounter", true) addEventHandler("removeCounter", getRootElement(), function () removeEventHandler("onClientRender", root, draw) if isTimer(timer) then killTimer(timer) end end )
-
show me your server side and clientside? anyways here are the states: you could change LoadingMap with these, LoadingMap maybe wont be the one you'll need: undefined NoMap LoadingMap PreGridCountdown GridCountdown Running MidMapVote SomeoneWon TimesUp EveryoneFinished PostFinish NextMapSelect NextMapVote ResourceStopping
-
replace the timer in client with this , not tested: function startEverything() addEventHandler("onClientRender",root,drawCounterSHI) timer = setTimer(function() counter = counter - 1 if counter < 0 then counter = 15 r,g,b = 0,255,0 end if counter <= 3 then r,g,b = 255,0,0 end end,1000,0) end addEvent("onCounterStart",true) addEventHandler("onCounterStart",getRootElement(),startEverything) add this to client: addEvent("removeCounter", true) addEventHandler("removeCounter", getRootElement(), function () removeEventHandler("onClientRender", root, draw) if isTimer(timer) then killTimer(timer) end end ) replace the onRaceStateChanging event with this. not tested! addEvent("onRaceStateChanging",true) addEventHandler("onRaceStateChanging",root, function (new) if (new == "Running") then startVehicleChanging() triggerClientEvent(source,"onCounterStart",source) end if (new =="LoadingMap") then triggerClientEvent(source,"removeCounter",source) if isTimer(vehChangeTimer) then killTimer(vehChangeTimer) end end end ) if that's not what you want here are the states: undefined NoMap LoadingMap PreGridCountdown GridCountdown Running MidMapVote SomeoneWon TimesUp EveryoneFinished PostFinish NextMapSelect NextMapVote ResourceStopping
-
luac.multitheftauto.com is pretty highly recommended now. you should deal with it tho.
-
do u just have CITscripts? explain me this: exports.CIThelp:modTextBar("armor", "") exports.CIThelp:modTextBar(element, "armor", "Press 'n' to buy armor for $"..price, 168, 164, 159, 255) i wont help u if u do and this is also like CIT armour system press N on Armour pickup locations.
-
its pretty much PLR isn't defined as a player, anyway are the exports in the meta.xml? try using source instead of PLR, leave the parentheses empty ()
-
you could have made a GUI Button in the DX Rectangle , and make the GUI Button alpha 0 anyways whats the error. and is the export in the Meta.xml? and any errors on /debugscript 3?
-
you are making the timer endless by putting 0. should be like this. 5000, 1 setTimer (function() if status == true then triggerServerEvent("CIFarmor.buyArmor", getLocalPlayer(), CIFarmor.buyArmor) end end, 5000, 1 )
-
no it's because the Counter script is client side. you could use triggerServerEvent, i managed to do it.
-
EDIT: its still not saving the timer. i got the timers moving but not saving.
-
could you exactly tell me what things should i replace? the code lines i'm confused thanks in advance.
-
is that all? im kinda lazy af too haha tired af still didn't sleep, btw is that all? could you mix that code with the original code please?( i mean to make sure if thats all or what )
-
Client: local sX,sY = guiGetScreenSize() local counter = 120 local r,g,b = 0,255,0 local redzone = createColRectangle ( -2978.78857, -806.87402, 1980, 2500 ) addEvent("dx",true) addEventHandler("dx", getRootElement(), function () addEventHandler("onClientRender", root, draw) end ) addEvent("dxremove", true) addEventHandler("dxremove", getRootElement(), function () removeEventHandler("onClientRender", root, draw) end ) addEvent("sound",true) addEventHandler("sound", getRootElement(), function () sound = playSound("sound.mp3", false) if isElement(sound) then setSoundVolume(sound, 0.-- s8) --> end end ) function draw() dxDrawText("Time left: "..counter,0,sY*0.8,sX,sY,tocolor(r,g,b,255),2,"default","center","top",false,false,false) end removeEventHandler("onClientRender", root, draw) addEvent("timer", true) addEventHandler("timer", getRootElement(), function () counter = counter - 1 if counter < 0 then counter = 120 r,g,b = 0,255,0 end if counter <= 10 then r,g,b = 255,0,0 end if counter == 0 then for i,v in ipairs(getElementsByType("player")) do outputChatBox("IMPACT!", 255, 0, 0, false) end end end ) function notcolshape( player ) if (player == localPlayer) then local id = getWeather() if id == 19 then fadeCamera( false, 0.4, 0, 0, 0 ) setTimer(fadeCamera, 2000, 1.0, true) setTimer(setWeather, 500, 1, 7) end end end addEventHandler ( "onClientColShapeLeave", redzone, notcolshape ) function redzoneEnter ( player ) if (player == localPlayer) then fadeCamera( false, 0.4, 0, 0, 0 ) setTimer(fadeCamera, 2000, 1.0, true) setTimer(setWeather, 500, 1, 19) end end setTimer(function () addEventHandler("onClientColShapeHit", root, redzoneEnter) outputChatBox("San Fierro",255,0,0) end,126000,1, true) server: local redzone = createColRectangle ( -2978.78857, -806.87402, 1980, 2500 ) redzonemaparea = createRadarArea (-2978.78857, -806.87402, 1980, 2500, 255, 0, 0, 120) function swag() for i, player in ipairs(getElementsByType("player")) do setTimer(triggerClientEvent, 500, 1, "dx", player) end end addEventHandler("onResourceStart", getRootElement(), swag) timer = setTimer(function() for i, player in ipairs(getElementsByType("player")) do triggerClientEvent(player, "timer", player) end end, 1000, 0) timer2 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player, redzone) then outputChatBox("WARNING: Leave San Fierro now!", player, 255, 0, 0, false) end end end, 10000, 0) timer3 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player, redzone) then setElementHealth(player, 0) setWeather(19) if isTimer(timer2) then killTimer(timer2) end end end end, 125000, 1) timer4 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player, redzone) then fadeCamera ( player, false, 1.0, 230, 178, 35 ) setTimer(fadeCamera, 3000, 1, player, true, 0.5) end end end, 122000, 1) timer5 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do triggerClientEvent(player, "sound", player) end end, 109400, 1) timer6 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isTimer(timer3) then killTimer(timer3) end if isTimer(timer4) then killTimer(timer3) end if isTimer(timer5) then killTimer(timer3) end end end, 130000, 1) timer7 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do triggerClientEvent(player, "dxremove", player) end end, 126000, 1) timer8 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isTimer(timer) then killTimer(timer) end end end, 123000, 1)
-
I found out about the dick but when the player joins the timers doesnt start for him now. what functions should i use or what should i do? the DX timer doesnt show up too. local redzone = createColRectangle ( -2978.78857, -806.87402, 1980, 2500 ) redzonemaparea = createRadarArea (-2978.78857, -806.87402, 1980, 2500, 255, 0, 0, 120) function swag() for i, player in ipairs(getElementsByType("player")) do setTimer(triggerClientEvent, 500, 1, "dx", player) end end addEventHandler("onResourceStart", getRootElement(), swag) timer = setTimer(function() for i, player in ipairs(getElementsByType("player")) do triggerClientEvent(player, "timer", player) end end, 1000, 0) timer2 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player, redzone) then outputChatBox("WARNING: Leave San Fierro now!", player, 255, 0, 0, false) end end end, 10000, 0) timer3 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player, redzone) then setElementHealth(player, 0) setWeather(19) if isTimer(timer2) then killTimer(timer2) end end end end, 125000, 1) timer4 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player, redzone) then fadeCamera ( player, false, 1.0, 230, 178, 35 ) setTimer(fadeCamera, 3000, 1, player, true, 0.5) end end end, 122000, 1) timer5 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do triggerClientEvent(player, "sound", player) end end, 109400, 1) timer6 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isTimer(timer3) then killTimer(timer3) end if isTimer(timer4) then killTimer(timer3) end if isTimer(timer5) then killTimer(timer3) end end end, 130000, 1) timer7 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do triggerClientEvent(player, "dxremove", player) end end, 126000, 1) timer8 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isTimer(timer) then killTimer(timer) end end end, 123000, 1)
-
but how about the Countdown timer? the DX Text with the tick shall i make it stay in ClientSide? EDIT: I found out about the dick but when the player joins the timers doesnt start for him now.