Jump to content

Potato_Tomato420

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by Potato_Tomato420

  1. Thx all, i'm not that good at tables at the moment, still learning ? Also i'm aware that the resource wouldn't assign a nametag to new players, i'm still working on it. Thx for the help!
  2. I'm currently making a custom nametag script for my server but i have a problem with showing the players wanted level. It shows the wanted level.. how could i fix this? local GUI = {} local label = {} local image = {} function showCustomNametag (sResource) if sResource == getThisResource() then local players = getElementsByType ("player") for i, player in ipairs (players) do GUI.i = dgsCreate3DInterface (-2631.4, 609, 13.45, 1, 0.5, 200, 100, tocolor(255,255,255,255), 0, 1, 0) if localPlayer == player then dgsSetVisible (GUI.i, false) end dgsSetProperty (GUI.i, "maxDistance", 10) dgsSetProperty (GUI.i, "fadeDistance", 7) dgs3DInterfaceAttachToElement (GUI.i, player, 0, 0, 1) local bg = dgsCreateImage (0, 0, 1, 0.2, nil, true, GUI.i, tocolor(0,0,0,255)) label.i = dgsCreateLabel (0, 0, 200, 15, getPlayerName (player), false, GUI.i) table.insert (label, label.i) dgsSetProperty (label.i , "textColor", tocolor(255,255,255,255)) dgsSetProperty (label.i , "alignment", {"center", "top"}) dgsSetProperty (label.i , "font", textH1) if getPlayerWantedLevel (player) > 0 then image.i = dgsCreateImage (0, 20, 200, 20, "assets/images/wantedLevel/"..getPlayerWantedLevel (player)..".png", false, GUI.i) table.insert (image, image.i) end setElementData (player, "playerNametagID", i) end end end addEventHandler ("onClientResourceStart", root, showCustomNametag) function updateNick(name) local ID = getElementData (localPlayer, "playerNametagID") dgsSetText (label[ID], name) end addEvent ("SAnametag:updateNick", true) addEventHandler ("SAnametag:updateNick", localPlayer, updateNick)
  3. I agree it would be awesome if the made MTA for the remasterd opcoming GTA SA But i understand it would be a lot of work
  4. Hi all, Is it possible to force a burrito to have cargo inside the loading area?
  5. So I want to create moving vehicles and walking peds in a scene. For example a intro movie/scene for a new player. What's the best way to make this possible? Edit: Found something on the community
  6. Thx!! Got it working I created a function to check if the lineOfSightClear is clear from any object and then triggerServerEvent to spawn the vehicle.
  7. Hi all, is it possible to detect a gta world object within a colshape? For example: can i create a colshape in front of the player and then use isElementWithinColShape to detect if there is anyting inside the col? Even a object from the game itself? I have created a vehicle shop with a control panel to spawn purchased vehicles. But i have a little problem with the spawning part. I use getElementPosition to detect the players x, y, z and the createVehicle (x, y, z). But now i can spawn a vehicle inside a wall. To prevent this from happening i want to create a colShape in front of the player and then check if there are any element withing the colShape, so also walls from the game itself. Somebody any idea how i could detect this or resolve it? (Sorry for my english i know it's not great)
  8. Thx! Probably did something wrong with updating Error is gone now! Thx!
  9. Hi all, i get the following error everytime my script is running at the exact line. I have no idea what i'm doing wrong and how i could fix it. I only get this error at the first run of the script, when the blur screen shows up. The second time i run my script then the error won't show up. Only at the first run of the script. I tried updating the dgs resource but still got the error. Thanks! Debug: WARNING: dgs/Core/imageslia:176: Bad argument @ 'dxGetMaterialSize' [Expected material at atgument 1, got dxcustomrender] My code: (The line i think that causes this debug line) Code from: https://wiki.multitheftauto.com/wiki/DgsCreateBlurBox Dgs line:
  10. Already thought it was inpossible, Thx!
  11. Does somebody know if it is possible to rotate a col shape? I tried using setElementRotation but then i found this isn't possible on the wiki page Is there some other way to set the rotation for a col cuboid?
  12. I was wondering if it is possible to create a custom download screen when a new players joins the server. Now i have the default download GUI/ transfer box when a players join the server. What is the best way to hide this Transfer box and create a custom download screen?
  13. How can i disable the shaders? The code below doesn't same to work Very new to this stuff function triggerWorldEffects(state) for i = 1, #texturesimg do if not (shader) then local shader = dxCreateShader("worldEffects/shader/shader.fx") engineApplyShaderToWorldTexture(shader, texturesimg[i][2]) dxSetShaderValue(shader, "gTexture", dxCreateTexture(texturesimg[i][1])) elseif (shader) then engineRemoveShaderFromWorldTexture (shader, texturesimg[i][2]) end end end
  14. Update: already soleved This seems to work: (Line 3, 4 and 5 added) function onColHit (hitElement, matchingDim) if (hitElement == localPlayer) and (matchingDim) then if (getElementData (hitElement, "warpedPoliceDepartment") == false) then setElementData (hitElement, "warpedPoliceDepartment", 0) end if (source == enterCol) and (getElementData (hitElement, "warpedPoliceDepartment") == 0) then setElementData (hitElement, "warpedPoliceDepartment", 1) setElementInterior (hitElement, 6) setElementDimension (hitElement, 1) setElementPosition (hitElement, 246.79, 63.06, 1003.64) elseif (source == exitCol) and (getElementData (hitElement, "warpedPoliceDepartment") == 0) then setElementData (hitElement, "warpedPoliceDepartment", 1) setElementInterior (hitElement, 0) setElementDimension (hitElement, 0) setElementPosition (hitElement, 1555.16, -1675.62, 16.2) end end end addEventHandler("onClientColShapeHit", getRootElement(), onColHit)
  15. So i created a warper to warp a player inside and also outside a building. For some reason the first warp seems to work fine but then when i try it again it spawns me at the exact same location. I use setElementData to prevent the player from looping in the spawn. I think the bug is somewhere in that part. local enCol = createColCuboid (1554.56, -1677.10, 15.2, 1.2, 3, 2.4) local exCol = createColCuboid (245.30, 62.10, 1002.64, 3, 1.2, 2.5) setElementInterior (exCol, 6) setElementDimension (exCol, 1) local policeDepartment = createBlip (1555.16, -1675.62, 15.2, 58) function onColHit (hitElement, matchingDim) if (hitElement == localPlayer) and (matchingDim) then if (source == enCol) and (getElementData (hitElement, "warpedPoliceDepartment") == false) then setElementInterior (hitElement, 6) setElementDimension (hitElement, 1) setElementPosition (hitElement, 246.79, 63.06, 1003.64) setElementData (hitElement, "warpedPoliceDepartment", 1) elseif (source == exCol) and (getElementData (hitElement, "warpedPoliceDepartment") == false) then setElementInterior (hitElement, 0) setElementDimension (hitElement, 0) setElementPosition (hitElement, 1555.16, -1675.62, 16.2) setElementData (hitElement, "warpedPoliceDepartment", 1) end end end addEventHandler("onClientColShapeHit", getRootElement(), onColHit) function onColLeave (leaveElement, matchingDim) if (leaveElement == localPlayer) and (matchingDim) then if (source == enCol) then setElementData (leaveElement, "warpedPoliceDepartment", false) elseif (source == exCol) then setElementData (leaveElement, "warpedPoliceDepartment", false) end end end addEventHandler("onClientColShapeLeave", getRootElement(), onColLeave)
  16. Hi all, I have created a login system for my server and added a guiCreateStaticImage to create a background image. Every time a click on the image it comes on top of the login GUI. Is there a simple way to prevent the image coming op top of the login GUI? For example make the image a non click element? Idk if this is possible?
  17. Thx, adding tostring seams to work. Still i don't get it why i need to add tostring to convert the numbers to a string. The debug was showing both codes and the seems to be ok but still that didn't work. But thx for the support! I almost got a headache because i could solve it xDD
  18. Do i need to check the activation code serverside? That seems like a bad idea to me. The debug does already shows both codes and seems to be ok.. but still Debug:
  19. Hi all, I'm scripting a login system for my server. In the registration process a new player must enter a valid and working email. To ensure the player use his own email, the resource will send a mail with a "activation code". Once the player received the email, he will find a activation code to activate his account. So now i got the problem that the script keeps saying that the activation code is wrong. I don't know what i did wrong but i'm sure the code from the mail and the code i filled in are correct. I thing it's a little bug but i don't understand how i could possibly solve this
  20. Nevermind, just deleted the resource ? Still thx!
  21. Hi all, I'm working on a DX login system for my server but i have no idea how to insert more character in my table. Can somebody explain me how i can do this? Now it only inserts het key i press, but how can i insert character1, character2, character3 etc? local usernameTable = {} local passwordTable = {} local usernameText = "Username!" local font = dxCreateFont('assets/font.otf', 18, false, 'default') local sx, sy = guiGetScreenSize() function loginGUI() dxDrawRectangle (sx*(0/1024), sy*(0/768), sx*(1024/1024), sy*(768/768), tocolor(0, 173, 239, 255)) -- Blue background screen dxDrawRectangle (sx*(362/1024), sy*(400/768), sx*(300/1024), sy*(25/768), tocolor(255, 255, 255, 255)) -- Username input dxDrawText (usernameText, sx*(368/1024), sy*(402/768), sx*(300/1024), sy*(18/768), tocolor ( 0, 0, 0, 255 ), 1, 1, font) -- dxDrawRectangle (sx*(362/1024), sy*(440/768), sx*(300/1024), sy*(25/768), tocolor(255, 255, 255, 255)) -- Username input -- dxDrawRectangle (sx*(0/1024), sy*(0/768), sx*(1024/1024), sy*(768/768), tocolor(0, 173, 239, 255)) -- register button -- dxDrawRectangle (sx*(0/1024), sy*(0/768), sx*(1024/1024), sy*(768/768), tocolor(0, 173, 239, 255)) -- Login button end function onJoinHandler() setPlayerHudComponentVisible ("all", false) showChat (false) showCursor (true) addEventHandler ("onClientRender", root, loginGUI) end addEventHandler ("onClientResourceStart", getRootElement(), onJoinHandler) function addLabelOnClick (button, state, x, y) if (button == "left") and (state == "up") then if (x > sx*(362/1024)) and (x < sx*(662/1024)) and (y > sy*(400/768) and (y < sy*(425/768))) then toggleAllControls (false) usernameText = "" addEventHandler("onClientCharacter", getRootElement(), outputUsername) end end end addEventHandler ("onClientClick", root, addLabelOnClick) function outputUsername(character) usernameTable[]= character outputDebugString ("Stored!") usernameText = usernameTable[] end
  22. Hi, I'm creating a roleplay server but for some resources I need a second player to debug it. Is it possible to run MTASA multiple times? I tried sandboxie but MTA won't allow that. A error pops up saying that there was already a MTA session running and if I want to terminate it. Is there some way I can bypass this checking for other active MTA sessions? I also tried to run virtualbox with windows XP but that also won't work.
×
×
  • Create New...