pa3ck
Members-
Posts
1,141 -
Joined
-
Last visited
-
Days Won
7
Everything posted by pa3ck
-
Can you not use getRealTime timestamp and calculate the time that way? You might need to adjust it a bit for local time, since client side it will return the client's PC time rather than the server time, but you can adjust that before a race begins.
-
I don't understand why can't you just use serverside and forget about the client? What events are you using to trigger the start and end events?
-
Fórum moderátorként szerinted megmondhatod nekem hogy mit kérdezhetek? Ne vicceljél már Egy kérdés hogyan lehet támadás jellegű? Jó ég...
-
Szia, kérdést tettem fel, tőle vártam a választ nem tőled, fórum szabályzatot nem sértettem, nem értem miért kérhetnéd tőlem, hogy "mellőzzük az ilyesfajta viselkedést". Egyébként nem egy mostani topic..
-
There are couple of questions that need to be answered first... you only mention client side, so you don't care whether the blinkers are same for everyone? If so, you can use XML or JSON string in a client file - remember that fromJSON takes a string and converts it into a LUA table and toJSON converts a LUA table to a string that you can store in a file, once you converted the string back to LUA table, you can handle it as any other table.
-
I'm not 100% sure I understand what you are looking for, but as far as I can understand, you want to get the color code of a specific percentage.. for example you have a scale of 0-500 reputation, you would need to know the color when the player for example has 350 reputation?
-
Hi, I think the best option would be to use an image instead of dx function.. you can still create the arrow and text with dx functions, but the base gradient would be an image. If you really want to use pure dx, I put together some code that would create the same gradient effect using dxGetTexturePixels & dxSetPixelColor & interpolateBetween See code below: addEventHandler ("onClientResourceStart", resourceRoot, function () texture = dxCreateTexture (300, 25) local pixels = dxGetTexturePixels (texture) for i=0,300 do local progress = 100 / 300 * i / 100 local r, g, b = interpolateBetween ( 255, 0, 0, 255, 255, 0, progress, "Linear") for j=0,25 do dxSetPixelColor (pixels, i, j, r, g, b, 255) end end dxSetTexturePixels (texture, pixels) texture2 = dxCreateTexture (600, 25) local pixels2 = dxGetTexturePixels (texture2) for i=0,300 do local progress = 100 / 300 * i / 100 local r, g, b = interpolateBetween ( 255, 255, 0, 0, 255, 0, progress, "Linear") for j=0,25 do dxSetPixelColor (pixels2, i, j, r, g, b, 255) end end dxSetTexturePixels (texture2, pixels2) end) addEventHandler ("onClientRender", root, function () dxDrawImage (300, 300, 300, 25, texture) dxDrawImage (600, 300, 300, 25, texture2) end) If you need explanation let me know, I can go into detail, but I think it's pretty straight forward.
-
Akkor most kinek is vannak szövegértelmezési problémai? Én azt mondtam, hogy azok az emberek rontják a közösséget, nem a srácról állítottam. Máskor inkább olvasd el figyelmesebben. Kötekedés lenne, ha megkérdezem, hogy ő pontosan mit is tenne egy szerver készítéshez? Ha igen akkor ne tudd meg mekkora beefet fog kapni másoktól..
-
Én értelmezem félre? Én nem értelmeztem semmit félre barátom, én csak érdeklődtem.. A közösség viszont elmondom neked miért romlott meg az elmúlt pár évben. Mindenki saját szervert akar, pedig se a tudása se a képessége nem engedi, azt hiszi, hogy ha egy havi 1500 forintos VPS-t biztosit akkor minden meg van oldva, illetve egy 0 profittal rendelkező szerver x százalékát juttatás címszó alatt ígérget, de sok szerencsét, biztos vagyok benne, hogy találni fogsz fejlesztőket.
-
Szia. Tehát keresel programozót, web fejlesztőt, designert illetve modellezőt. Magyarul minden pozícióra keresel embert, ami azt jelenti, hogy te semmit nem nyújtasz. Miért jönne akárki is hozzád, mit tudsz TE hozzá tenni a projecthez?
-
Good job linking bunch of leaked resources...
-
In the first instance, you set it on the window element, not the button, that's why it only worked when you clicked on the window and nothing else. Using getResourceRootElement(getThisResource()) OR resourceRoot is advised, since you only want to hook the event to the GUI being created by this resource anyway.
-
help please.. - setVehicleComponentPosition- move spoiler...
pa3ck replied to nagymark686's topic in Scripting
Use a timer to check the current speed of the vehicle and if it's above 70 and it's not already out, open it out. -
You probably have some resource running that sets back the alpha of the player. In your first code you set it every 3 seconds even when it's already 50, then it's being set back, that is why it flickers every 3 seconds. In Lysanders code it sets it every 1 second that is why it flickers even faster. Search for the keyword setElementAlpha in your resources folder using Notepad++ or similar.
-
Show the function / event where you set the timer. If that's all the code you have, do this: setTimer(function( ) for k, thePlayer in ipairs(getElementsByType("player")) do if getElementData(thePlayer, "asd.asd") then outputChatBox("asd", thePlayer, 255, 255, 255, true) end end end, 1000*3, 0) Keep in mind this will always loop through all players. If you want to only run it for X players, you should tie it to an event / function and pass the in the player element as explained in the previous replies.
-
1. dbPoll will always return true as long as the statement returned without an error, even though it's empty, which means your first if statement will always be true (unless DB error happens) 2. Since you are using LIMIT 1, there's no need to use loop, it's impossible to return multiple rows. 3. dbPoll returns a table with the following structure (only 1 row in your case): { { colname1=value1, colname2=value2, ... }, { colname1=value3, colname2=value4, ... }, ... } Try this: if res[1]["Name"] then outputChatBox("User is registered") else outputChatBox("User is not registered") end 4. fromJson(toJson(res)) - what are you trying to achieve there? Is your data saved as JSON object in DB? Either way, converting to then back from JSON is pointless.
-
Megértem, hogy egyedi szervert akarsz, de ennyi pénzért nem fogsz találni minőségi munkát, szerintem inkább gondolkozz egy kész módon és ahhoz tedd hozzá a saját ötleteid. Olcsóbb és gyorsabb, nincs olyan RP szerver ami nem az alapból elérhető Valhalla vagy egy bizonyos lengyel RP alapot használ.
- 3 replies
-
- jó szervert
- scripter
- (and 12 more)
-
If you post your code and tell us which part you're stuck on, somebody might be able to help you..
-
setElementData is meant to be temporary, so if a player rejoins, their elementData is cleared, if you restart the server all elementData is cleared, so yes, it is normal.
-
Where do you set that setElementData?
-
It's not clear what you're trying to do and what your problem is. So you want the leader to be able to add / kick players, but you don't know who the leader is? What is wrong with your code? Any errors? Which "if" statement does the execution fail at?
-
It's some sort of a pseudo code, but it should give you an idea.. As @Shayf said, setTimer doesn't really go well with animations, it will be slow and clunky. local inRenderHealth = 0 local renderStart = getTickCount() function drawHealth() local playerHealth = Math.ceil ( getElementHealth ( localPlayer ) ) if(inRenderHealth ~= playerHealth ) renderStart = getTickCount() end local now = getTickCount() local endTime = renderStart + 500 local elapsedTime = now - renderStart local duration = endTime - renderStart local progress = elapsedTime / duration local inRenderHealth, _, _ = interpolateBetween ( inRenderHealth, 0, 0, playerHealth, 0, 0, progress, "Linear") dxDrawRectangle ( 0, 0, inRenderHealth * 4, 20 ) end
-
Oh, I see, what do you have so far? Post your full code