-
Posts
642 -
Joined
-
Last visited
Everything posted by Lloyd Logan
-
Hey, so i created a a script so that when you enter a marker the gui comes up and you can buy a veh! The problem is that the GUI is always there and nothing happens when you click "BUY" Thanks! GUIEditor = { button = {}, label = {}, window = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() Window = guiCreateWindow(385, 158, 478, 385, "Buy A Vehicle", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(26, 98, 326, 34, "Infernous : $30000", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "sa-header") GUIEditor.button[1] = guiCreateButton(373, 108, 86, 29, "BUY", false, GUIEditor.window[1]) end ) local buyVeh = createMarker(1940.5185546875, -1707.1162109375, 13.3828125, "cylinder", 1.5, 255, 255, 0, 170) function visibleGui(thePlayer) guiSetVisible(Window, true) showCursor ( true ) end addEventHandler("onMarkerHit", buyVeh, visibleGui) function onClickBtn ( button, state ) if (source == GUIEditor.button[1]) then local x, y, z = getElementPosition(thePlayer) createVehicle(411, x + 2, y, z) utputChatBox("You Have successfully bought an Infernous!", thePlayer) takePlayerMoney ( thePlayer, 30000) end end
-
gui error!
Lloyd Logan replied to Traxy's topic in Scandinavian (Danish / Dansk, Norwegian / Norsk, Swedish / Svenska)
Kan du legge inn script? Bare din klient GUI? -
I'm not the OP, but is it possible to add new ones?
-
I don't know if this has been said yet but, if it says "unable to load/find module sha", on my XP computer, you had to type loadmodule sha.dll, you know, with the ".dll" part. Just putting that out there. It worked for me.
-
Well Ghost, I can honestly say that I have only read it once, (it's too late for me to read it again, I also read the in depth tutorials) but I honestly feel I understand so much more about Lua, and when I was confused about the Arrays, I feel I know them inside out, bu lt once again the Link has improved me so much in the last hour or so and that's me read it for the first time! Thank you!
-
So Anderl, in one of my previous topics, you said "Array" would the aPos be an array? Is that what it is? And would the script work without the #? Thanks again guys
-
That's good! Have you had a look at the Wiki? Check the GUI tuturials section? It will help you with this stuff.
-
Thanks, could you explain to me what the "#" does before aPos? Thanks Lloyd
-
Hey, How would i create a script so that math.random(<--- I think its that) chooses from an array of Co-ordinates? I know all the onPlayerWasted and stuff, but how would i make it the math.random chooses from a list of Co-ordinates? addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 2000, 1, source, 2745.5830078125, -1608.7109375, 290.84722900391 ) --How would I make math.random choose from a list of co-ordinates? end )
-
I'm not really sure, you could try downgrading your MTA? You wouldn't be able to play on other servers though.
-
because my server does not appear in the server list?
Lloyd Logan replied to dogaofenix's topic in Servers
Have you forwarded your ports? -
Tyvm addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 2000, 1, source, 2745.5830078125, -1608.7109375, 290.84722900391 ) end ) Just replace the co-ordinates
-
That has actually made quite the difference thanks! Still a bit weird though!
-
So how would i apply multiple TXD's and DFF's?
-
Sorry Mate, i totally misunderstood, and thought your were the OP, tho i thought OP was operator or something Sorry
-
Hi there, very recently i have had a problem when i run MTA:SA, that there is a very wierd greenish colour, some other colours are distorted. I used to have this problem with my old GPU but considering i have a gaming rig, and everything is upto date, this should not be happening? I don't know if i should run Towncivillian's MTA Diag, or not. Anyone else who has had this problem please help, it really destroys the enjoyment of the game having all the display messed up, Thanks Again Lloyd
-
Ah, i see, and are the other no Admins able to use the commands?
-
They are in something called a "resource" inside your server folder, this will help you... https://wiki.multitheftauto.com/wiki/Scr ... troduction Err I already know what a command and a resource is. Well the commands in which people enter would be under addCommandHandler, in your resource file, in the server side script?
-
I am now confused as to what i am doing
-
Right it is working, but how will i make it so that when the player passes the Login screen the gui will show? I tried onPlayerLogin, but i couldn't get it function CreateSelectorWindow() wdwselector = guiCreateWindow(0.438,0.880,0.15,0.10,"Skinslector v1.0",true) guiWindowSetMovable(wdwselector,false) btnLeft = guiCreateButton(0.0,0.4,0.200,0.350,"<-",true,wdwselector) btnRight = guiCreateButton(0.76,0.4,0.200,0.350,"->",true,wdwselector) btnSelect = guiCreateButton(0.30,0.4,0.400,0.350,"Select",true,wdwselector) guiSetVisible(wdwselector, false) end function selectorenable () CreateSelectorWindow() addEventHandler("onClientGUIClick", btnLeft, clientSkinLeft, false) addEventHandler("onClientGUIClick", btnSelect, clientSkinSelect, false) addEventHandler("onClientGUIClick", btnRight, clientSkinRight, false) if (wdwselector ~= nil) then guiSetVisible(wdwselector, true) triggerServerEvent("FrontCamera", getRootElement()) end showCursor(true) end addEventHandler("onPlayerLogin", rootElement, selectorenable)
-
I done that but nothing, could this be messing it up? local spawnX, spawnY, spawnZ = 2745.5830078125, -1608.7109375, 290.84722900391 function joinHandler() spawnPlayer(source, spawnX, spawnY, spawnZ) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to One In the Chamber", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) addEventHandler( "onPlayerWasted", getRootElement( ), function() setTimer( spawnPlayer, 2000, 1, source, 2745.5830078125, -1608.7109375, 290.84722900391 ) end )
-
Not before i added your code, but here it is, with this i honestly have no idea what i'm doing.... local g_pSkins = { [7] = { 0, 0, 5 }, [219] = { 0, 0, 0 }, [220] = { 0, 0, 0 } }; addEventHandler( "onPlayerSpawn", root, function( _, _, _, _, _, nSkin ) if ( g_pSkins[nSkin] ) then local pTeam, nRotation, nInterior, nDimension = getPlayerTeam( source ), getElementRotation( source ), getElementInterior( source ), getElementDimension( source ); spawnPlayer( source, g_pSkins[nSkin][1], g_pSkins[nSkin][2], g_pSkins[nSkin][3], nRotation, nSkin, nInterior, nDimension, pTeam ); end end ); I am not sure about the rotation, but the posistion is a i sead before and the dimension is 0
-
I am extremely stuck with this, i want it so that if you have id 7, you will spawn at... 2745.5830078125, -1608.7109375, 290.84722900391, but absoulutley nothing happens when i select id 7?
