Jump to content

LabiVila

Members
  • Posts

    272
  • Joined

  • Last visited

Everything posted by LabiVila

  1. Hey, so while doing stuff I finally got stuck into somewhere... it's a xml thing what's the code to write/read between ? I mean if I try to get the text from an EditBox and put it here I'd have: but I don't want it like this... I need it like namehere Hopefully I'm clear enough
  2. function submitLogin (source, user, pass) if (user ~= "") then if (pass ~= "") then local acc = getAccount (user, pass) if (acc ~= false) then logIn (source, acc, pass) outputChatBox ("You logged in successfully.") triggerClientEvent (source, "hideWindow", source) else outputChatBox ("Wrong username or password, please try again!", getRootElement(), 255, 255, 255, false) end else outputChatBox ("Password can not be blank.", getRootElement(), 255, 255, 255, false) end else outputChatBox ("Username can not be blank.", getRootElement(), 255, 255, 255, false) end end addEvent ("loginReq", true) addEventHandler ("loginReq", getRootElement(), submitLogin) function initializing () showCursor (true, true) main = guiCreateWindow (0.25, 0.25, 0.50, 0.50, "Login Window", true) local usernameLabel = guiCreateLabel (0.10, 0.17, 0.50, 0.10, "Username: ", true, main) local username = guiCreateEdit (0.25, 0.15, 0.60, 0.10, "", true, main) local passwordLabel = guiCreateLabel (0.10, 0.42, 0.50, 0.10, "Password: ", true, main) local password = guiCreateEdit (0.25, 0.40, 0.60, 0.10, "", true, main) local loginB = guiCreateButton (0.15, 0.65, 0.30, 0.12, "Login", true, main) local regB = guiCreateButton (0.60, 0.65, 0.30, 0.12, "Register", true, main) addEventHandler ("onClientGUIClick", loginB, function (us, pa) local us = guiGetText (username) local pa = guiGetText (password) triggerServerEvent ("loginReq", getRootElement(), getLocalPlayer(), us, pa) end, false ) addEventHandler ("onClientGUIClick", regB, function (us, pa) local us = guiGetText (username) local pa = guiGetText (password) triggerServerEvent ("registerReq", getRootElement(), getLocalPlayer(), us, pa) end, false ) end addEventHandler ("onClientResourceStart", getRootElement(), initializing) function hiding () showCursor (false, false) guiSetVisible (main, false) end addEvent ("hideWindow", true) addEventHandler ("hideWindow", getRootElement(), hiding) I got this, trying to make register button work but it isn't. The script you sent me does output the chatbox but it doesn't really register someone, I'd like a bit of help EDIT: Fixed, thanks
  3. Hey function submitRegister (newUser, newPass) if (newUser ~= "") then if not (newPass ~= "") then local newAcc = addAccount (newUser, newPass) if (newAcc) then outputChatBox ("Acc add") end end end end addEvent ("registerReq", true) addEventHandler ("registerReq", getRootElement(), submitRegister) is anything wrong here? I don't think there's any error at other scripting side... tho I don't get any error
  4. As I know, the freeroam runs from somewhere at [gamemode] section, and if you've deleted that, what do you expect to see? I mean, it shouldn't how anything at all. There's no need to delete all that just to test a login script...
  5. Well you don't have to do anything for that... onMarkerHit doesn't specify a special marker, it's for every marker. It automatically does what you're asking for...
  6. To work what? Can you be more clear as I think nobody around here totally got you...
  7. https://wiki.multitheftauto.com/wiki/DxDrawImage and have a look on as much pages below "See also:" as you can
  8. Have you set a big scale to that object?
  9. It must show the distance between player and selected object... as dxDrawText EDIT: here's the script I do currently have: addEventHandler ("onClientResourceStart", getRootElement(), function () showCursor (true) outputChatBox ("Program successfully started.", 255, 255, 255) outputDebugString ("Program successfully started.") end ) local trigger = false addEventHandler ("onClientRender", root, function () px, py, pz = getElementPosition (localPlayer) end ) addEventHandler ("onClientClick", getRootElement(), function (btn, state, ax, ay, wx, wy, wz) wx = wx wy = wy wz = wz trigger = true if state == "up" then outputChatBox ("Object's position: "..wx..", "..wy..", "..wz.."!") outputChatBox ("Your position: "..px..", "..py..", "..pz.."!") end end ) function metters () if (trigger) then local a = getDistanceBetweenPoints3D (px, py, pz, wx, wy, wz) dxDrawText (a, x/3, y/3, x, y, tocolor (255, 255, 255, 155), 5) end end addEventHandler ("onClientRender", root, metters)
  10. Yea, replied to you as well but not sure how much you may have noticed but it's not the same script...
  11. Did exactly as you told me. It isn't working and surprisingly, it is giving me the same two errors.
  12. addEventHandler ("onClientRender", root, function () px, py, pz = getElementPosition (localPlayer) end ) addEventHandler ("onClientClick", getRootElement(), function (btn, state, ax, ay, wx, wy, wz) if state == "up" then outputChatBox ("Object's position: "..wx..", "..wy..", "..wz.."!") outputChatBox ("Your position: "..px..", "..py..", "..pz.."!") end end ) function metters () local a = getDistanceBetweenPoints3D (px, py, pz, wx, wy, wz) dxDrawText (a, x/3, y/3, x, y, tocolor (255, 255, 255, 155), 5) end addEventHandler ("onClientRender", root, metters) The outputChatBox tell current positions but Distance isn't working. I get these errors: Bad argument @ 'getDistanceBetweenPoints3D' [Expected vector3 at argument 4, got nil] attempt to perform arithmetic on global 'x' (a nil value)
  13. LabiVila

    GUI Help!

    GUIEditor = { tab = {}, window = {}, tabpanel = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(356, 169, 536, 401, "Paranoia Server Information", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.77) guiSetVisible (GUIEditor.window[1], false) GUIEditor.tabpanel[1] = guiCreateTabPanel(12, -158, 274, 15, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) GUIEditor.tabpanel[2] = guiCreateTabPanel(9, 20, 517, 371, false, GUIEditor.window[1]) GUIEditor.tab[2] = guiCreateTab("Paranoia", GUIEditor.tabpanel[2]) GUIEditor.memo[1] = guiCreateMemo(12, 11, 495, 326, "Paranoia is a zombie server and semi-rp and it is a server to let people enjoy the scripts ,etcs and Paranoia is based on Surviving , Fighting against the zombies and other teams. and Hope u guys Enjoy!", false, GUIEditor.tab[2]) guiMemoSetReadOnly(GUIEditor.memo[1], true) GUIEditor.tab[3] = guiCreateTab("Rules", GUIEditor.tabpanel[2]) GUIEditor.memo[2] = guiCreateMemo(14, 12, 493, 325, "Paranoia Rules:\n1. Do Not Ask For Staff Rank!\n2. Do Not Ask For Money\n3. Do Not Insult/Flame\n4. No Multi Accounting\n5. No Advertising Other Servers\n6. Stop Annoying Staffs\n7. No Deathmatching\n8. No Trolling!\n9. Do Not Helikill / Carkill!\n10. Do Not Spam the Chat!", false, GUIEditor.tab[3]) guiMemoSetReadOnly(GUIEditor.memo[2], true) GUIEditor.tab[4] = guiCreateTab("Updates", GUIEditor.tabpanel[2]) GUIEditor.memo[3] = guiCreateMemo(14, 11, 493, 326, "Updates:\nN/A", false, GUIEditor.tab[4]) guiMemoSetReadOnly(GUIEditor.memo[3], true) GUIEditor.tab[5] = guiCreateTab("Staff Team", GUIEditor.tabpanel[2]) GUIEditor.memo[4] = guiCreateMemo(12, 12, 495, 325, "Staff Team:\nOwner: Shaman\nHQ Staffs: N/A\nAdmins: N/A\nModerators: N/A\nProbationaries: N/A", false, GUIEditor.tab[5]) guiMemoSetReadOnly(GUIEditor.memo[4], true) end ) function toggleVisible ( ) guiSetVisible ( GUIEditor.window[1] , not guiGetVisible(GUIEditor.window[1]) ) if (guiGetVisible (GUIEditor.window[1]) == true) then showCursor (true) else showCursor (false) end end bindKey ("F2", "down", toggleVisible)
  14. LabiVila

    GUI Help!

    Didn't quite get you, you mean, if player is logged in, you won't be able to toggle that, right?
  15. LabiVila

    GUI Help!

    GUIEditor = { tab = {}, window = {}, tabpanel = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(356, 169, 536, 401, "Paranoia Server Information", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.77) GUIEditor.tabpanel[1] = guiCreateTabPanel(12, -158, 274, 15, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Tab", GUIEditor.tabpanel[1]) GUIEditor.tabpanel[2] = guiCreateTabPanel(9, 20, 517, 371, false, GUIEditor.window[1]) GUIEditor.tab[2] = guiCreateTab("Paranoia", GUIEditor.tabpanel[2]) GUIEditor.memo[1] = guiCreateMemo(12, 11, 495, 326, "Paranoia is a zombie server and semi-rp and it is a server to let people enjoy the scripts ,etcs and Paranoia is based on Surviving , Fighting against the zombies and other teams. and Hope u guys Enjoy!", false, GUIEditor.tab[2]) guiMemoSetReadOnly(GUIEditor.memo[1], true) GUIEditor.tab[3] = guiCreateTab("Rules", GUIEditor.tabpanel[2]) GUIEditor.memo[2] = guiCreateMemo(14, 12, 493, 325, "Paranoia Rules:\n1. Do Not Ask For Staff Rank!\n2. Do Not Ask For Money\n3. Do Not Insult/Flame\n4. No Multi Accounting\n5. No Advertising Other Servers\n6. Stop Annoying Staffs\n7. No Deathmatching\n8. No Trolling!\n9. Do Not Helikill / Carkill!\n10. Do Not Spam the Chat!", false, GUIEditor.tab[3]) guiMemoSetReadOnly(GUIEditor.memo[2], true) GUIEditor.tab[4] = guiCreateTab("Updates", GUIEditor.tabpanel[2]) GUIEditor.memo[3] = guiCreateMemo(14, 11, 493, 326, "Updates:\nN/A", false, GUIEditor.tab[4]) guiMemoSetReadOnly(GUIEditor.memo[3], true) GUIEditor.tab[5] = guiCreateTab("Staff Team", GUIEditor.tabpanel[2]) GUIEditor.memo[4] = guiCreateMemo(12, 12, 495, 325, "Staff Team:\nOwner: Shaman\nHQ Staffs: N/A\nAdmins: N/A\nModerators: N/A\nProbationaries: N/A", false, GUIEditor.tab[5]) guiMemoSetReadOnly(GUIEditor.memo[4], true) end ) function toggleVisible ( ) guiSetVisible ( GUIEditor.window[1] , not guiGetVisible(GUIEditor.window[1]) ) if (guiGetVisible (GUIEditor.window[1]) == true) then showCursor (true) else showCursor (false) end end bindKey( "F2", "down", toggleVisible) should work now
  16. Oh... now I get it. Any suggestion what to do tho?
  17. A better way of doing this is if you get into your server and you have admin, just write on console: /start runcode /run setFPSLimit (60)
  18. Thanks but it is not actually working
  19. So I want this, once I click the object, it outputs: "You selected a guy", if I do it again, it outputs the same text again, but I have a problem, it doesn't reply only one time but a lot like here: http://www.upload.ee/image/4432676/Untitled.png function mainWindow () main = guiCreateWindow (0.70, 0.20, 0.25, 0.25, "Auto-Converter", true) selectButton = guiCreateButton (0.15, 0.40, 0.30, 0.30, "Click", true, main) generate = guiCreateButton (0.60, 0.40, 0.30, 0.30, "G", true, main) addEventHandler ("onClientGUIClick", selectButton, function () outputChatBox ("Must select a shade (3458 or 8558).", 255, 255, 255) addEventHandler ("onClientClick", getRootElement(), function (button, state, absoluteX, absoluteY, worldX, worldY, worldZ, element) if (state == "down") then if (getElementType (element) == "object") and (getElementModel (element) == 8558 or getElementModel (element) == 3458) then outputChatBox ("You selected a shade") return end end end ) end ) outputDebugString ("Program Started") end addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource), mainWindow) I'd appreciate any help
  20. ERROR: Loading srcipt failed: test\server.lua:34: ')' expected (to close '(' at line 26) near 'end' this is what I get. Here's full script function test (resourcename) if (resourcename == getThisResource ()) then outputDebugString ("Resource "..getResourceName(resourcename).." loaded asd.") end end addEventHandler ("onResourceStart", getRootElement(), test) function spawn () spawnPlayer (source, 1959.55, -1714.46, 17) fadeCamera (source, true) setCameraTarget (source, source) setPlayerHudComponentVisible (source, "all", false) end addEventHandler ("onPlayerJoin", getRootElement(), spawn) local vehicle = { } addEvent ( "spawnEuro", true ) addEventHandler ("spawnEuro", root, function ( px, py, pz ) if isElement ( vehicle [source] ) then outputChatBox ( "Error - You already have a flash.", source, 255, 0, 0 ) return end vehicle [source] = createVehicle ( 565, px + 2, py + 2, pz ) outputChatBox ( "Flash was created successfully.", source, 0, 255, 0 ) end end ) addEventHandler ("onPlayerQuit", root, function ( ) if isElement ( vehicle [source] ) then destroyElement ( vehicle [source] ) vehicle [source] = nil end end )
  21. Yea, I did it but it isn't resulting successful. It isn't preventing the user to create another flash...
  22. So hey guys over again, I hope I'm not being repetitive. So I'm stuck somewhere... how can I see if the vehicle was already created? --server side addEvent ("spawnEuro", true) addEventHandler ("spawnEuro", getRootElement(), function (px, py, pz) createVehicle (565, px+2, py+2, pz) outputChatBox ("Flash was created successfully.", client, 255, 255, 255) end ) --client side (not needed I guess) addEventHandler ("onClientRender", root, function () dxDrawRectangle (x/1.225, y/2.1, x/5.75, y/7, tocolor (0, 0, 0, 100)) dxDrawText ("Commands: ", x/1.20, y/2, x, y, tocolor (255, 255, 255)) dxDrawText ("1: Spawn sanchez.", x/1.20, y/1.85, x, y, tocolor (255, 255, 255)) dxDrawText ("2: Spawn flash.", x/1.20, y/1.75, x, y, tocolor (255, 255, 255)) end ) how can I check if Flash has been successfully created once, so if I type 2 again, it won't create another car (flash).
  23. You got to write it server-side first, because guiCreateStaticImage isn't server-sided. Then you can edit how they appear client-side
×
×
  • Create New...