Jump to content

Master_11

Members
  • Posts

    37
  • Joined

  • Last visited

1 Follower

About Master_11

  • Birthday 02/01/2000

Details

  • Gang
    nil
  • Location
    India
  • Occupation
    Writer
  • Interests
    Scripting

Recent Profile Visitors

1,172 profile views

Master_11's Achievements

Rat

Rat (9/54)

7

Reputation

  1. I made a simple GUI to warp player (It's not yet completed) but the thing is, I made it so like, It is only opened whenever it is used and does not stays open in the background. The problem is, if you just logged in, you will have to step inside the marker twice, Eg > You logged in > You hit the marker for the first time and it won't open, but when you hit the marker for the second time, it will open imminently, and then again if you reconnect or logout it happens again, why is that so? I don't understand what wrong code I have made. Client: function MakeJPanel() if (JoinPanel) then return true end local screenW, screenH = guiGetScreenSize() JoinPanel = guiCreateWindow((screenW - 665) / 2, (screenH - 350) / 2, 665, 350, "Welcome To The MTA Server!", false) guiWindowSetSizable(JoinPanel, false) guiSetProperty(JoinPanel, "CaptionColour", "FFD1039E") WelcomeLable = guiCreateLabel(8, 19, 647, 60, "Blah BLah", false, JoinPanel) guiLabelSetColor(WelcomeLable, 150, 251, 89) LSClothButton = guiCreateButton(155, 164, 112, 22, "Cloth Shop", false, JoinPanel) guiSetProperty(LSClothButton, "NormalTextColour", "FFAAAAAA") LSVehicleButton = guiCreateButton(399, 164, 112, 22, "Vehicle Shop", false, JoinPanel) guiSetProperty(LSVehicleButton, "NormalTextColour", "FFAAAAAA") LVbutton = guiCreateButton(277, 132, 112, 22, "LV", false, JoinPanel) guiSetProperty(LVbutton, "NormalTextColour", "FF9B0DA7") LSButton = guiCreateButton((665 - 112) / 2, (350 - 22) / 2, 112, 22, "LS", false, JoinPanel) guiSetProperty(LSButton, "NormalTextColour", "FF1122A2") SFButton = guiCreateButton(277, 196, 112, 22, "SF", false, JoinPanel) guiSetProperty(SFButton, "NormalTextColour", "FFE9F038") CloseButton = guiCreateButton(296, 320, 73, 20, "Close", false, JoinPanel) guiSetProperty(CloseButton, "NormalTextColour", "FFAAAAAA") InfoLable = guiCreateLabel(9, 228, 646, 85, "Blah Blah", false, JoinPanel) guiLabelSetColor(InfoLable, 255, 0, 0) addEventHandler("onClientGUIClick", CloseButton, closeJGUI, false) end function openJPanel() if (not JoinPanel) then MakeJPanel() end local visible = not guiGetVisible(JoinPanel) guiSetVisible(JoinPanel, visible) showCursor(visible) end addEvent("startJPanel", true) addEventHandler("startJPanel", localPlayer, openJPanel) function closeJGUI(button) if (button ~= "left") then return false end openJPanel() end Server: local theMarker = createMarker(497.16632080078, -75.45479309082, 997.7378125, "cylinder", 1.6, 0, 120, 200, 255) function Markers() setElementDimension(theMarker, 99) setElementInterior(theMarker, 11) end addEventHandler("onResourceStart", resourceRoot, Markers) function openJGUI(client) if (isGuestAccount(getPlayerAccount(client))) then return false end if (getElementDimension(client) ~= 99 or getElementInterior(client) ~= 11) then return false end triggerClientEvent(client, "startJPanel", client) end addEventHandler("onMarkerHit", theMarker, openJGUI)
  2. Very well then, looks like I need to restart my server. I'll check your script again tonight. Thanks!
  3. Well, checked them all, HassoN's script isn't working, same problem as mine. Rockyz's script is working, however, thanks Holuzs for helping, but I guess, Rockyz script is more stable to use, however, I would like to see if HassoN's script is fixable too, as his scripting style matches with mine the most, would be easy for me to make further changes in future. Thanks all! Good work, Rockyz.
  4. Well, while testing this script, and making a few changes to it (With or without making changes) when the player is wasted, it makes the player re-spawn to only one location (Jefferson) out of the 8 provided in the table. I don't understand what's wrong with this script, would be very helpful if you guys give me a hand in checking. Also, this script isn't showing any debug error/warning in both In game debugger and on the console. (Most annoying) hosp_loc = { {-2655, 635, 14, 180}, -- San Fierro {2038, -1411, 17, 130}, --Jefferson {1173, -1323, 15, 270}, -- All Saints {1242, 327, 19, 340}, -- Red County {1609, 1816, 12, 360}, -- Las Venturas {-2200, -2311, 30, 320}, -- Angel Pine {-320, 1049, 20, 0}, --Fort Carson - Bone County {-1514.5, 2524, 56, 0} --Tierra Robada } function getDistance(thePlayer) local px, py, pz = getElementPosition(thePlayer) local closestDistance local closestPoint for i = 1, #hosp_loc do local hx, hy, hz = hosp_loc[i][1], hosp_loc[i][2], hosp_loc[i][3] local distance = getDistanceBetweenPoints3D(hx, hy, hz, px, py, pz) if (not closestDistance or distance < closestDistance) then closestDistance = distance closestPoint = hosp_loc[i] end end local x = (tostring(closestPoint[1])) --x local y = (tostring(closestPoint[2])) --y local z = (tostring(closestPoint[3])) --z local r = (tostring(closestPoint[4])) --rotation skin = getElementData(thePlayer, "respawn-skin") spawnPlayer(thePlayer, x, y, z, r, skin) setElementModel(thePlayer, skin) fadeCamera(thePlayer, true, 2.5) end function Respawn() local skinid = getElementModel(source) setElementData(source, "respawn-skin", skinid) setTimer(getDistance, 7500, 1, source) end addEventHandler("onPlayerWasted", root, Respawn)
  5. Hey, @LopSided_ I read the tutorial, did some changes in my code, but I am pretty much confused, I might need some help in person, is it okay if I PM you?
  6. Salh, your help is really appreciated but I guess, LopSided is right, the username and password are stored in the plain text. I'll check the tutorial provided by LopSided_, looks safer. Thank-you both.
  7. Hello, I have been working on a login panel, and I need to know, how can one make a functioning "Remember Credentials" checkbox which will then auto write username in the username text box and password in the password text box. What user have to do next is just click the login button instead of typing all the stuff again. Now... How?
  8. Change the x, y, z once again and check if it makes a difference.
  9. Nothing is wrong with the script I gave you. Try using this command in game: "/debugscript 3"
  10. marker1 = createMarker(648.93481445313, -2883.2438964844, 52.553970336914, "arrow", 1.5, 230, 251, 3, 153) marker2 = createMarker(636.20654296875, -2847.8757324219, 1637.8680419922, "arrow", 1.5, 230, 251, 3, 153) Use the space after coma ", " Also, try changing the coords. And provide SetElementPosition line too
  11. Just change the x, y, z in the code. if you have already changed, show me the edited code.
  12. Try copying from here: Server: https://pastebin.com/EME9GTj3 Client: https://pastebin.com/n8hdWAfD @RandomRambo
  13. Hello, @RandomRambo Server: marker1 = createMarker(1800.4868164063, -2141.1555175781, 14.146875, "arrow", 1.5, 0, 250, 0, 153) marker2 = createMarker(1801.6746826172, -2137.8212890625, 14.146875, "arrow", 1.5, 250, 0, 0, 153) function teleport(client) if (source == marker1 and getElementType(client) == "player") then setElementPosition(client, 1793.2797851563, -2151.337890625, 13.681822776794) setElementFrozen(client, false) setTimer(setElementFrozen, 1000, 1, client, false) triggerClientEvent(client, "onPlayerTP", client) elseif (source == marker2 and getElementType(client) == "player") then setElementPosition(client, 1793.4161376953, -2124.8742675781, 13.546875) setElementFrozen(client, false) setTimer(setElementFrozen, 1000, 1, client, false) triggerClientEvent(client, "onPlayerTP", client) end end addEventHandler("onMarkerHit", resourceRoot, teleport) Client: local screenW, screenH = guiGetScreenSize() mainWindow = guiCreateWindow((screenW - 1546) / 2, (screenH - 834) / 2, 1546, 834, "News", false) guiWindowSetSizable(mainWindow, false) --GUI Objects-- closeButton = guiCreateButton(9, 770, 1527, 54, "Close", false, mainWindow) newsLogo = guiCreateStaticImage(9, 32, 1527, 733, ":news/logotip.png", false, mainWindow) function resStarts() guiSetVisible(mainWindow, false) showCursor(false) end addEventHandler("onClientResourceStart", resourceRoot, resStarts) function openNewsPanel() guiSetVisible(mainWindow, true) showCursor(true) end addEvent("onPlayerTP", true) addEventHandler("onPlayerTP", localPlayer, openNewsPanel) function closeNewsPanel(button) if (button ~= "left") then return false end guiSetVisible(mainWindow, false) showCursor(false) end addEventHandler("onClientGUIClick", closeButton, closeNewsPanel, false) Meta: <meta> <script src="client.lua" type="client" /> <script src="server.lua" type="server" /> <file src="logotip.png" /> </meta> Remember, check the full code and see what I have changed and think why I did that. Also, change the image location at client.lua: line 6 {":news/logotip.png"} in this case, my script folder name was "news". I had to create a new client program as your one was pretty much buggy and unorganized. If you still find any problem, let us know.
×
×
  • Create New...