
Xeno
Members-
Posts
728 -
Joined
-
Last visited
Everything posted by Xeno
-
function createTeamsOnStart () teameJraM = createTeam ( "eJraM", 255, 0, 0 ) t1 = getTeamFromName("eJraM") setTeamFriendlyFire(t1, false) teamMaFia = createTeam ( "MaFia", 0, 255, 0 ) t2 = getTeamFromName("MaFia") setTeamFriendlyFire(t2, false) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) --we attach
-
This is not the place to post this. Go on the server forum instead.
-
function consoleShowMarker ( thePlayer, commandName ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) local theMarker = createMarker (x,y, z, "cylinder", 1.5, 255, 0, 0, 170 ) if ( theMarker ) then setTimer (destroyElement, 3000, 1, theMarker ) end end end addCommandHandler ( "showAdminMarker", consoleShowMarker )
-
Sorry. I turned the destroyMarker into a timer to make it easier.. If you want to continue, use an onMarkerHit event and trigger another function that uses setElementPosition to move the perosn.
-
function consoleShowMarker ( thePlayer, commandName ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) local theMarker = createMarker ( some X, some Y, some Z, "cylinder", 1.5, 255, 0, 0, 170 ) if ( theMarker ) then setTimer (destroyElement, 3000, 1, theMarker ) end end end addCommandHandler ( "showAdminMarker", consoleShowMarker )
-
team = createTeam("Team1", 255,0,0) t1 = getTeamFromName ( "Team1" ) setTeamFriendlyFire(t1, false) Try that.
-
Wow this is nice, I suppose it could be used for road blocks in RP severs aswell
-
Oh ok, never mind then.
-
As far as I know, getPlayerIdleTime is bugged ( I think )
-
People are not just going to make you things, but I think theres one on the community somewhere... I recommend you make a col shape around your base, and when a guest enters the col it kills them automatically.
-
function onResourceStart() skin1 = engineLoadTXD("veg.txd", 22) skin2 = engineLoadDFF("veg.dff", 22) engineImportTXD(skin1, 22) engineReplaceModel(skin2, 22) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart)
-
If what Slothman said doesnt work, it may be an error with the actual skin.
-
Ah I understand you now. This is proberly going to confuse you, but if its an onClientGUIClick and the GUI is inside a function, you put the Event inside of it like this: addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource(), function GUI1() createLoginWindow() outputChatBox("Bem vindo/a ao TBG - RealPlay!") -- BUTTON IS CREATED HERE OR WHATEVER ;3 if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else outputChatBox("Ocorreu um inesperado erro no carregamento no painel de Login, tente reconectar!") end showCursor(true) guiSetInputEnabled(true) addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) end ) Then you need to make a function called clientSubmitLogin which has all the stuff the button does when its clicked.
-
Oh hai StormFox. If the script doesnt work , just post back. And also: I would recommend you put these at the end of the script.
-
Your not ignorant at all, your just asking a question but what Im glad to see is that your actually trying to learn LUA. In the future when you get an error, login as admin in your server and type /debugscript 3 that will display a GUI that shows the errors on the script, post the errors here and then we can narrow down whats wrong.
-
At the end of each function you need to add () function GUI () What are "Width" and "Height"? local altura = 0.50 local largura = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "TBG - Painel de Login!", true) altura and lagura im guessing are the Width and Height, so you need to change the 3rd line too: wdwLogin = guiCreateWindow(X, Y,altura,largura, "TBG - Painel de Login!", true) So the final code is: function GUI () local X = 0.375 local Y = 0.375 local altura = 0.50 local largura = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "TBG - Painel de Login!", true) X = 0.0825 Y = 0.2 altura = 0.25 largura = 0.25 guiCreateLabel(X, Y, Width, Height, "Login", true, wdwLogin) Y = 0.5 guiCreateLabel(X, Y, Width, Height, "Senha", true, wdwLogin) X = 0.415 Y = 0.2 altura = 0.5 largura = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "Seu login aqui", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "Sua senha aqui", true, wdwLogin) guiEditSetMaxLength(edtUser, 15) guiEditSetMaxLength(edtPass, 20) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) guiSetVisible(wdwLogin, true) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createLoginWindow() outputChatBox("Bem vindo/a ao TBG - RealPlay!") if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else outputChatBox("Ocorreu um inesperado erro no carregamento no painel de Login, tente reconectar!") end showCursor(true) guiSetInputEnabled(true) end
-
The problem is only "guiCreateWindow" to "guiCreateStaticImage" Now i convert to ANSI and work the compiler perfect. Tnx Xeno No problem, but as Solidsnake said, make sure theres no errors in the script, or it wont work
-
Thats a very nice GUI design you have there. If your using Notepad ++, open your file in it and go to Encoding > and change it to ANSI, then try and compile it.
-
I have no clue what you going on about, but try this instead: addEventHandler('onResourceStart', getRootElement(), database:SQLTable )
-
Which line is line 14? Yours only go up to 6.