-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You want to use setElementDoubleSided in all your objects? not just these in "Objects" table?
-
function MyTestTextFunction ( ) if ( not text ) then display = textCreateDisplay ( ) -- create a new display, store the reference in a variable called display for index, player in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( display, player ) -- add an observer to it end text = textCreateTextItem ( "Report all the bugs you find with /report.", 0.01, 0.20 ) -- create a text item textItemSetScale ( text, 1.5) textDisplayAddText ( display, text ) -- Add the text item to the text display setTimer ( textDestroyTextItem, 20000, 1, text ) end end setTimer ( MyTestTextFunction, 15000, 0 ) addEventHandler ( "onResourceStart", resourceRoot, MyTestTextFunction )
-
Proba esto: function consoleGive ( thePlayer ) if exports.factions:isPlayerInFaction ( thePlayer, 1) then if ( getElementInterior(thePlayer) == 6 ) then giveWeapon ( thePlayer, 25, 200, true ) giveWeapon ( thePlayer, 24, 200, true ) end end end addCommandHandler ( "duty", consoleGive )
-
El script no tiene nada de malo por lo que yo veo, salvo esos dos argumentos extra que no deberian estar ahi, igual no causaria ningun problema dejarlos. Estas seguro de que el script esta puesto como server side en el meta.xml?
-
Well, if you don't give him the text to destroy, that won't work, also you're destroying it just after being created. function MyTestTextFunction ( ) display = textCreateDisplay ( ) -- create a new display, store the reference in a variable called display for index, player in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( display, player ) -- add an observer to it end text = textCreateTextItem ( "Hello World", 0.5, 0.5 ) -- create a text item textItemSetScale ( text, 2.0) textDisplayAddText ( display, text ) -- Add the text item to the text display setTimer ( textDestroyTextItem, 5000, 1, text ) end addEventHandler ( "onResourceStart", resourceRoot, MyTestTextFunction )
-
It's working, just in a wrong position I think, I removed this: "low", 255, 0, 0, 0, 1.0 and it worked.
-
Is a server side script, and you set it as client side ( type="client", must be type="server" ).
-
function MyTestTextFunction ( ) display = textCreateDisplay ( ) -- create a new display, store the reference in a variable called display for index, player in ipairs ( getElementsByType ( "player" ) ) do textDisplayAddObserver ( display, player ) -- add an observer to it end text = textCreateTextItem ( "Hello World", 0.5, 0.5, "low", 255, 0, 0, 0, 1.0 ) -- create a text item textDisplayAddText ( display, text ) -- Add the text item to the text display end addEventHandler ( "onResourceStart", resourceRoot, MyTestTextFunction )
-
-- client side: label = {} RGUI = guiCreateWindow(0.3703,0.3503,0.2914,0.2695,"Register Panel",true) guiWindowSetMovable(RGUI,false) guiWindowSetSizable(RGUI,false) label[1] = guiCreateLabel(25,47,317,20,"Registrate ya !, asi guardaras datos y todo eso...",false,RGUI) guiSetFont(label[1],"clear-normal") EPassword = guiCreateEdit(21,91,155,32,"",false,RGUI) Registrarme = guiCreateButton(181,90,92,32,"Registrarme !",false,RGUI) label[2] = guiCreateLabel(63,124,76,17,"CONTRASEÑA",false,RGUI) guiSetFont(label[2],"default-bold-small") label[3] = guiCreateLabel(15,149,183,21,"Ve ya a nuestro nuevo Foro ! ...",false,RGUI) label[4] = guiCreateLabel(107,174,171,18,"http://bhzserver.forochile.com",false,RGUI) LGUI = guiCreateWindow(0.4516,0.3112,0.1758,0.1237,"Loguin GUI(60 Sec)",true) guiWindowSetSizable(LGUI,false) Lpassword = guiCreateLabel(20,36,54,19,"Password",false,LGUI) EPasswordL = guiCreateEdit(77,28,137,33,"",false,LGUI) Login = guiCreateButton(16,64,200,22,"Login",false,LGUI) guiSetVisible(RGUI,false) showCursor(false) guiSetVisible(LGUI,false) addEventHandler("onClientResourceStart",resourceRoot, function() triggerServerEvent("on:Visible:", getLocalPlayer()) end ) function clientSubmitaccount ( button, state ) if ( button == "left" and state == "up" ) then local username = getPlayerName( getLocalPlayer() ) local password = guiGetText(EPassword) if ( username and password ) then triggerServerEvent("cuenta", localPlayer, username, password) else outputChatBox("Porfavor pon tu Nick y tu Contraseña.") end end end addEventHandler("onClientGUIClick", Registrarme, clientSubmitaccount, false) addEvent ( "closeLoginGUI", true ) addEventHandler ( "closeLoginGUI", root, function ( ) guiSetVisible ( RGUI, false ) showCursor ( false ) guiSetVisible( LGUI, false ) end ) function clientSubmitLogin ( button, state ) if ( button == "left" and state == "up" ) then triggerServerEvent("archivo", localPlayer, file) local username = xmlNodeGetAttribute( file, "name" ) local password = guiGetText(EPasswordL) if ( username and password ) then triggerServerEvent("submitLoginEM", localPlayer, username, password) else outputChatBox("Porfavor pon tu Nick y tu Contrase?a.") end end end addEventHandler("onClientGUIClick", Login, clientSubmitLogin, false) addEvent("openLGUI",true) addEventHandler("openLGUI", root, function() guiSetVisible(LGUI,true) showCursor(true) end ) addEvent("openRGUI",true) addEventHandler("openRGUI", root, function() guiSetVisible(RGUI,true) showCursor(true) end ) -- server side: addEvent("cuenta", true) addEventHandler("cuenta", root, function ( username, password ) if ( password ~= "" and password ~= nil and username ~= "" and username ~= nil ) then if ( not getAccount ( username ) ) then local accountAdded = addAccount ( username, password ) if ( accountAdded ) then outputChatBox ( "Gracias " .. getPlayerName ( source ) .. ", Ya estas Registrado y loggeado", source ) local file = xmlCreateFile(username .." .xml","root") local node = xmlCreateChild(file,"stats") xmlNodeSetAttribute( node, "name", username ) local check = xmlNodeSetAttribute( node, "pass", password) xmlSaveFile(file) if file then outputChatBox ( "Tu Character se a creado con exito !.", source ) triggerClientEvent ( source, "closeLoginGUI", source ) logIn ( source, xmlNodeGetAttribute( file, "name" ), xmlNodeGetAttribute( file, "pass" ) ) end else outputChatBox ( "Error creando la Cuenta por Favor contacta a un Admin.", source ) end else outputChatBox ( "Esta Cuenta Ya Existe..", source ) end else outputChatBox ( "Porfavor Pon tus datos Correctos.", source ) end end ) function loginHandler(username,password) if ( username ) then local acc = getAccount(username, password) if (acc) then logIn ( source, acc, password ) fadeCamera(source, true) setCameraTarget(source) triggerClientEvent ( source, "closeLoginGUI", source ) outputChatBox("Enjoy your time!", source) else outputChatBox("invalid username and password. Please re-connect and try again.", source) end end end addEvent("submitLoginEM",true) addEventHandler("submitLoginEM",root, loginHandler) addEvent("on:Visible:",true) addEventHandler("on:Visible:",root, function() local username = getPlayerName( source ) local file = xmlLoadFile( username .." .xml" ) if ( file ) then triggerClientEvent(source, "openLGUI", source) elseif not ( file ) then triggerClientEvent(source, "openRGUI", source) end end ) addEvent("archivo", true) addEventHandler("archivo", root, function( file ) local username = getPlayerName( source ) local file = xmlLoadFile( username .." .xml" ) end )
-
Tenes que pedir que te lo envie desde el client side con el evento: "onClientResourceStart", asi no necesitaras el loop y podras enviarselo al que haya terminado la descarga.
-
Eso es porque el evento se esta enviando antes de que el jugador haya descargado el client side.
-
Si, parece estarlo.
-
Seguis usando 'source' en el triggerClientEvent.
-
No, le estas mandando cualquiera. Tenes que hacer un for-loop con todos los jugadores online.
-
That's because you forgot all the commas after each object inserted in the table, copy my code again.
-
That's because setElementDoubleSided requires a object element, not a table of them. Objects = { createObject(16671,194.09960938,2051.33984375,28.77000046,0.00000000,0.00000000,357.03918457), --object(a51_extfence01) (1) createObject(16668,358.03906250,2049.00000000,25.45000076,0.00000000,0.00000000,180.55480957), --object(a51_extfence04) (1) createObject(16669,380.39941406,1914.63964844,26.04000092,0.00000000,0.00000000,201.68701172), --object(a51_extfence05) (1) createObject(16670,330.89941406,1813.00000000,22.17000008,0.00000000,0.00000000,0.74157715),--object(a51_extfence02) (2) createObject(16670,330.89843750,1813.00000000,26.39999962,0.00000000,0.00000000,0.74157715), --object(a51_extfence02) (2) createObject(16669,380.39941406,1914.63964844,21.79999924,0.00000000,0.00000000,201.68701172), --object(a51_extfence05) (1) createObject(16668,358.03906250,2049.00000000,21.20000076,0.00000000,0.00000000,180.55480957), --object(a51_extfence04) (1) createObject(16671,194.09960938,2051.33984375,24.50000000,0.00000000,0.00000000,357.03918457), --object(a51_extfence01) (1) createObject(10828,97.69999695,1757.50000000,28.00000000,0.00000000,0.00000000,90.00000000), --object(drydock1_sfse) (6) createObject(10828,148.60000610,1706.00000000,28.00000000,0.00000000,0.00000000,0.00000000), --object(drydock1_sfse) (9) createObject(10828,97.69921875,1792.79980469,28.00000000,0.00000000,0.00000000,90.00000000), --object(drydock1_sfse) (9) createObject(10828,114.09960938,1705.89941406,28.00000000,0.00000000,0.00000000,0.00000000), --object(drydock1_sfse) (9) createObject(10828,97.69921875,1722.19921875,28.00000000,0.00000000,0.00000000,90.00000000), --object(drydock1_sfse) (10) createObject(10828,183.19921875,1706.09960938,28.00000000,0.00000000,0.00000000,0.00000000), --object(drydock1_sfse) (9) createObject(10828,218.29980469,1706.19921875,28.00000000,0.00000000,0.00000000,0.00000000), --object(drydock1_sfse) (9) createObject(10828,253.19921875,1706.19921875,28.00000000,0.00000000,0.00000000,0.00000000), --object(drydock1_sfse) (9) createObject(10828,269.00000000,1706.39941406,28.00000000,0.00000000,0.00000000,0.00000000), --object(drydock1_sfse) (9) createObject(10828,294.59960938,1706.39941406,28.00000000,0.00000000,0.00000000,0.00000000), --object(drydock1_sfse) (9) createObject(10828,345.00000000,1729.00000000,28.00000000,0.00000000,0.00000000,47.99926758), --object(drydock1_sfse) (9) createObject(10828,356.20001221,1788.80004883,28.00000000,0.00000000,0.00000000,90.00000000), --object(drydock1_sfse) (10) createObject(10828,336.39941406,1719.39941406,28.00000000,0.00000000,0.00000000,47.99926758), --object(drydock1_sfse) (9) createObject(10828,356.29998779,1759.00000000,28.00000000,0.00000000,0.00000000,90.00000000), --object(drydock1_sfse) (10) createObject(7657,96.79980469,1920.50000000,31.39999962,0.00000000,270.00000000,269.99450684), --object(plasticsgate1) (1) createObject(3095,269.00000000,1883.59960938,16.10000038,0.00000000,0.00000000,0.00000000), --object(a51_jetdoor) (4) createObject(7244,210.00000000,1923.00000000,-80.80000305,0.00000000,0.00000000,0.00000000), --object(vgnpolicecparkug) (2) createObject(8661,260.79000854,1906.00000000,-81.00000000,90.00000000,0.00000000,90.00000000), --object(gnhtelgrnd_lvs) (1) createObject(8661,251.80000305,1954.30004883,-79.30000305,0.00000000,0.00000000,0.00000000), --object(gnhtelgrnd_lvs) (2) createObject(8661,260.78906250,1951.50000000,-73.80000305,90.00000000,0.00000000,90.00000000), --object(gnhtelgrnd_lvs) (3) createObject(8661,255.39941406,1950.39941406,-72.90000153,90.00000000,179.99450684,357.99499512), --object(gnhtelgrnd_lvs) (6) createObject(8547,190.89941406,1856.79980469,39.79999924,0.00000000,0.00000000,179.99450684), --object(fctrygrnd01_lvs) (1) createObject(8547,190.09960938,1859.79980469,39.81000137,0.00000000,0.00000000,358.99475098), --object(fctrygrnd01_lvs) (2) createObject(8547,190.79980469,1882.89941406,39.70000076,0.00000000,0.00000000,179.99450684) --object(fctrygrnd01_lvs) (4) } for index, object in ipairs ( Objects ) do setElementDoubleSided ( object, true ) end
-
I don't get what do you mean, you want to show a GUI window to the player who hit the marker? if so, then you can use the hitElement argument?
-
Eso es porque 'source' de "onResourceStart" es el recurso que acaba de iniciarse, no es un jugador.
-
It's not possible as far as I know.
-
You have to create a function to output the info message when hit, then add the event handler "onPickupHit" after you create the pickup and attach it to that pickup.
-
Woah, this is just awesome, keep up the good work dude
-
You can use the event handler: onClientGUIAccepted which is when you press "Enter" on a GUI-edit field.
-
There is a way to use colors in Memo texts?
Castillo replied to Stanley Sathler's topic in Scripting
You're welcome. -
Indeed, my opinion is the same, you better save your money for something else and learn on your free time. That's what I'd.