-
Posts
1,708 -
Joined
-
Last visited
Everything posted by iFoReX
-
Puse el spawn gui de 50p, que esta mal ahora ?, porque no aparece la ventana de notificaciones ? addEvent("camera",true) addEventHandler("camera",root,function() setCameraMatrix(source,1719.13440, -1171.10083, 290.30188, 1559.32959, -1341.17761, 282.98361) end ) function loginHandler(username,password) if ( username ) then local acc = getAccount(username, password) if (acc) then logIn ( source, acc, password ) triggerClientEvent ( source, "closeLoginGUI", source ) outputChatBox("Logeado Correctamente!!", source, 0, 255, 255, 255, true) outputChatBox(""..getPlayerName(source)..", se ha logeado con la cuenta ' " ..username.. " ' ", getRootElement(), 0, 255, 255, 255, true) for i,v in ipairs(getElementsByType"player") do exports.notifications:showBox("info",""..getPlayerName(source)..", se ha logeado con la cuenta ' " ..username.. " ' ") end else outputChatBox("Nick y/o usuario incorrecto porfavor vuelve a intentarlo.", source, 255, 0, 0, 255, true) end end end addEvent("submitLoginEM",true) addEventHandler("submitLoginEM",root, loginHandler) 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 ) elseif ( getAccount ( username ) ) then outputChatBox ( "Esta Cuenta Ya Existe..", source ) end if ( accountAdded ) then outputChatBox ( "Gracias " .. getPlayerName ( source ) .. ", Ya estas Registrado", source ) triggerClientEvent ( source, "closeLoginGUI", source ) local acc = getAccount(username, password) logIn ( source, acc, password ) elseif ( not accountAdded ) then outputChatBox ( "Error creando la Cuenta por Favor contacta a un Admin.", source ) end elseif ( not password ~= "" and password ~= nil and username ~= "" and username ~= nil ) then outputChatBox ( "Porfavor Pon tus datos Correctos.", source ) end end )
-
problema solucionado, pasando a otro tema porq no aparece esta ventana al logearse ? --[[------------------------------------------------- Notes: > This code is using a custom font. This will only work as long as the location it is from always exists, and the resource it is part of is running. To ensure it does not break, it is highly encouraged to move custom fonts into your local resource and reference them there. --]]------------------------------------------------- GUIEditor = { memo = {}, button = {}, gridlist = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(0, 183, 354, 296, "Elige el Spawn", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF00FFFF") GUIEditor.memo[1] = guiCreateMemo(10, 26, 229, 65, " Informacion", false, GUIEditor.window[1]) guiMemoSetReadOnly(GUIEditor.memo[1], true) GUIEditor.gridlist[1] = guiCreateGridList(9, 96, 117, 191, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Ciudades", 0.7) GUIEditor.gridlist[2] = guiCreateGridList(131, 96, 111, 114, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[2], "Spawns", 0.9) GUIEditor.gridlist[3] = guiCreateGridList(244, 24, 101, 69, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[3], "Arma 1", 0.6) GUIEditor.gridlist[4] = guiCreateGridList(245, 100, 100, 81, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[4], "Arma 2", 0.6) GUIEditor.gridlist[5] = guiCreateGridList(244, 205, 100, 81, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[5], "Arma 2", 0.6) GUIEditor.button[1] = guiCreateButton(128, 216, 114, 34, "SPAWN", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FFE3") local font_0 = guiCreateFont(":guieditor/fonts/PetitFormalScript.ttf") guiSetFont(GUIEditor.button[1], font_0) guiSetVisible(GUIEditor.window[1],false) addEvent("on:Visible:",true) addEventHandler("on:Visible",root,function() guiSetVisible(GUIEditor.window[1],true) showCursor(true) end ) addEventHandler("onPlayerJoin",root,function() triggerClientEvent(source,"on:Visible",source) end )
-
Porque me aparece que el evento "camera" no se pudo triggear ? codigos : cl-side : GUIEditor = { edit = {}, button = {}, label = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(154, 128, 336, 179, "Login/Register Window", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF00FFE3") GUIEditor.label[1] = guiCreateLabel(0, 33, 337, 28, "Nickname", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 0, 255, 227) guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) GUIEditor.edit[1] = guiCreateEdit(84, 56, 159, 20, "", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.edit[1], "NormalTextColour", "FFEB0000") GUIEditor.edit[2] = guiCreateEdit(84, 110, 159, 20, "", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.edit[2], "NormalTextColour", "FFEB0000") guiEditSetMasked(GUIEditor.edit[2], true) GUIEditor.label[2] = guiCreateLabel(0, 86, 337, 28, "Password", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[2], 0, 255, 227) guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) GUIEditor.button[1] = guiCreateButton(9, 138, 115, 30, "Login", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FFE3") GUIEditor.button[2] = guiCreateButton(213, 136, 114, 30, "Register", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF00FFE3") guiSetVisible(GUIEditor.window[1],false) addEventHandler("onClientResourceStart",resourceRoot,function() showCursor(true) guiSetVisible(GUIEditor.window[1],true) triggerServerEvent("camera",getLocalPlayer()) end ) addEvent ( "closeLoginGUI", true ) addEventHandler ( "closeLoginGUI", root, function ( ) guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) end ) function clientSubmitLogin ( button, state ) if ( button == "left" and state == "up" ) then local username = guiGetText(GUIEditor.edit[1]) local password = guiGetText(GUIEditor.edit[2]) if ( username and password ) then triggerServerEvent("submitLoginEM", localPlayer, username, password) else outputChatBox("Porfavor pon tu Nick y tu Contraseña correctos.") end end end addEventHandler("onClientGUIClick", GUIEditor.button[1], clientSubmitLogin, false) function clientSubmitaccount ( button, state ) if ( button == "left" and state == "up" ) then local username = guiGetText(GUIEditor.edit[1]) local password = guiGetText(GUIEditor.edit[2]) 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", GUIEditor.button[2], clientSubmitaccount, false) ------------------------------------------ ---Library--- ------------------------------------------ --[[ Client animation library by arc_ Version 1.0.0 Licence ---------------- You are free to modify this file and redistribute it with your changes. However, always mention that you changed it (and eventually what changes you made) and keep the original author, version number and licence intact. Selling this script or a derivative of it is not allowed. Documentation ---------------- Terminology - Animation: a sequence of phases that act on one or more elements and follow each other sequentially in time. Multiple animations can be running at the same time. All defined animations run in parallel. An animation is in fact one phase with several subphases (see below), with animation specific functions available. - Phase: a part of an animation sequence. A phase consists of a paramater that linearly goes from a given starting value to a given ending value, over the specified amount of time, and is applied to one certain element. While a phase is running, its callback function will be called onClientRender with the following arguments: phase.fn(element elem, float param, table phase) Specifying time and callback function is optional. If no time is specified but a function is, phase.fn(elem) will be called once. If no function is specified but a time is, the phase consists of simply waiting during that time, doing nothing. A phase can be run once, repeated multiple times or loop infinitely. Phases can also contain phases. In that case the parent phase consists of completing all child phases, in order. This allows you to f.e. make an element move left and right continuously: define a phase for moving it to the left, followed by a phase for moving it back to the right, and encapsulate these two phases in a parent phase that loops forever. Phases can be nested to arbitrary depth. The element a subphase works on is inherited from its parent phase (or, if the parent phase doesn't specify an element, from the grandparent, etc). Definition of a phase A phase is simply a table containing properties and (optionally) subphases. Available phase properties are: (the values for the properties are examples, not default values) phase = { from = 0, -- the starting value of the parameter to = 1, -- the ending value of the parameter [time = 1000,] -- the time (in ms) in which to go from start to end [fn = callback,] -- the function to call on each frame update [repeats = 5,] -- how many times to run this phase before going on to -- the next. defaults to 1 [subphase1,] -- optional subphases. if one or more of these are included, [subphase2,] -- only the "repeats" property is valid for this parent phase ... } Available functions anim = Animation.create(elem, phase1, phase2, ...) Creates and returns a new animation. This means nothing more than creating a new phase, putting the specified phases in it as subphases, and making the functions of the Animation class available to it. Once an animation is created, it is not yet running. anim = Animation.createAndPlay(elem, phase1, phase2, ...) Creates a new animation and immediately starts playing it. anim = Animation.createNamed(name, elem, ...) If an animation with the specified name exists, returns that animation. Otherwise creates a new named animation. You can look the animation up again later with Animation.getNamed(name). anim = Animation.createNamedAndPlay(name, elem, ...) Self explanatory. anim = Animation.getNamed(name) Returns the animation with the specified name if it exists, false otherwise. anim:play() Start playing a newly created animation or resume a paused animation. anim:pause() Pauses the animation. Resume it later with anim:play() or delete it with anim:remove(). anim:remove() Deletes the animation completely. It can not be resumed anymore. anim:isPlaying() Returns true if the animation is currently playing, false if not. Animation.playingAnimationsExist() Returns true if there is any animation that is currently playing. anim:addPhase(phase3), phase2:addPhase(phase3) Appends a new subphase to the animation or phase. Can be done while the animation is playing. Note that to be able to use phase2:addPhase(), phase2 first has to be processed (default values filled in, made part of the Phase class) by being passed as an argument to Animation.create[AndPlay] or addPhase. Examples Fade in a picture: local pict = guiCreateStaticImage(...) Animation.createAndPlay(pict, { from = 0, to = 1, time = 2000, fn = guiSetAlpha }) Fade in a picture using a preset (for more presets, see the end of this file): local pict = guiCreateStaticImage(...) Animation.createAndPlay(pict, Animation.presets.guiFadeIn(2000)) Move a label to the right while fading it in: local label = guiCreateLabel(10, 100, 150, 20, 'Test', false) Animation.createAndPlay(label, Animation.presets.guiMove(200, 100, 2000)) Animation.createAndPlay(label, Animation.presets.guiFadeIn(2000)) Move a label left and right forever, without presets: function guiSetX(elem, x) local curX, curY = guiGetPosition(elem, false) guiSetPosition(elem, x, curY, false) end local label = guiCreateLabel(10, 100, 150, 20, 'Test', false) Animation.createAndPlay( label, { repeats = 0, { from = 10, to = 200, time = 2000, fn = guiSetX }, { from = 200, to = 10, time = 2000, fn = guiSetX } } ) ]]-- Phase = {} Phase.__index = Phase Animation = setmetatable({}, { __index = Phase }) Animation.__index = Animation Animation.collection = {} function Animation.create(elem, ...) local anim = setmetatable({ elem = elem, ... }, Animation) anim:_setup() return anim end function Animation.createAndPlay(elem, ...) local anim = Animation.create(elem, ...) anim:play() return anim end
-
yo use esta funcion una vez ( me dio mucho lagg en mi server ), yo hice esto : function dxDrawGifImage ( x, y, w, h, path, iEnd, effectSpeed ) local gifElement = createElement ( "dx-gif" ) if ( gifElement ) then setElementData ( gifElement, "gifData", { x = x, y = y, w = w, h = h, imgPath = path, endID = iEnd, imgID = 1, speed = effectSpeed, tick = getTickCount ( ) } ) return gifElement else return false end end addEventHandler ( "onClientRender", root, function ( ) local currentTick = getTickCount ( ) for _, gif in ipairs ( getElementsByType ( "dx-gif" ) ) do local gifData = getElementData ( gif, "gifData" ) if ( gifData ) then if ( currentTick - gifData.tick >= gifData.speed ) then gifData.tick = currentTick gifData.imgID = ( gifData.imgID + 1 ) if gifData.imgID > gifData.endID then gifData.imgID = 1 end setElementData ( gif, "gifData", gifData ) end dxDrawImage ( gifData.x, gifData.y, gifData.w, gifData.h, string.format(gifData.imgPath,gifData.imgID) ) end end end ) local sWidth,sHeight = guiGetScreenSize() gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo1.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo2.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo3.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo4.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo5.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo6.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo7.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo8.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo9.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo10.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo11.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo12.png", 20, 120 ) gif = dxDrawGifImage (sWidth*0,sHeight*0,sWidth*0.5,sHeight*0.5, "img/logo13.png", 20, 120 )
-
Now work, I remember I need put a ':' xDD, Thank you
-
Im testing the Notifications resource : https://community.multitheftauto.com/index.php?p=resources&s=details&id=5812 But this doesnt work D: here my code : addCommandHandler("sb",function() exports.notifications.showBox("info","test") end ) in debugscript 3 doesnt appear any Error D:
-
Bueno, Hola otra vez, andaba creando un sistema para agregar / remover personas de un clan todavia no lo termino, pero hice el primer test y tenia muchos errores de boolean y nose como solucionarlos cl-side GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(209,161,559,460,"GetClan..\"Reclutamiento\"",false) GUIEditor_Grid[1] = guiCreateGridList(16,26,207,418,false,GUIEditor_Window[1]) col1 = guiGridListAddColumn(GUIEditor_Grid[1],"Jugadores",0.7) GUIEditor_Button[1] = guiCreateButton(227,25,131,50,"Reclutar",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(227,85,131,50,"Removerlo",false,GUIEditor_Window[1]) GUIEditor_Grid[2] = guiCreateGridList(364,21,186,427,false,GUIEditor_Window[1]) col2 = guiGridListAddColumn(GUIEditor_Grid[2],"Jugadores del Clan",0.7) guiSetVisible(GUIEditor_Window[1],false) showCursor(false) bindKey("R","down",function() if getKeyState"lctrl" then guiSetVisible(GUIEditor_Window[1],not guiGetVisible(GUIEditor_Window[1])) showCursor(guiGetVisible(GUIEditor_Window[1])) end end ) function grid() local limpiar = guiGridListClear(GUIEditor_Grid[1]) if limpiar then local row = guiGridListAddRow(GUIEditor_Grid[1]) for i,v in ipairs(getElementsByType"player") do guiGridListSetItemText(GUIEditor_Grid[1],row,col1,getPlayerName(v),false,false) end end end addEventHandler("onClientResourceStart",resourceRoot,grid) addEventHandler("onClientPlayerQuit",root,grid) addEventHandler("onClientPlayerChangeNick",root,grid) addEventHandler("onClientPlayerJoin",root,grid) addEventHandler( 'onClientGUIClick', root, function( ) if source == GUIEditor_Button[1] then local nRow, nColumn = guiGridListGetSelectedItem( source ) local elPlayer = getPlayerFromName(nRow) triggerServerEvent("agregarPlayer",getLocalPlayer(),elPlayer) end end ) srv-side addEvent("agregarPlayer",true) addEventHandler("agregarPlayer",root,function(elPlayer) local account = getAccountName(elPlayer) if not isObjectInACLGroup ( "user." .. account, aclGetGroup ( "STARS" ) ) then local adicion = aclGroupAddObject (aclGetGroup("STARS"), "user."..account) if adicion then outputChatBox(getPlayerName(elPlayer).." Agregado Correctamente !!",source,0,255,0,true) end elseif isObjectInACLGroup ( "user." .. account, aclGetGroup ( "STARS" ) ) then outputChatBox(getPlayerName(elPlayer).." Ya esta en este Clan !!",source,255,255,0,true) end end )
-
Si creo
-
y si pruebas con addEvent("onZombieSpawn") addEventHandler("onZombieSpawn",root, function() for i,v in ipairs(getElementsByType("ped")) do exports.extra_health:setElementExtraHealth ( v, AQUILAHEATH ) end end )
-
D: the notepad finder doesnt find it, but Manually I find it :3 xDD
-
a problem : I Change to a at-400, but I search the At-400 ID and it doesnt appear in the table , how I can fix it ?
-
I want Do a Random Marker for my DD, but when I hit on this marker, the car doesnt change :// marker = getElementByID("random") autos = { 602, 545, 496, 517, 401, 410, 518, 600, 527, 436, 589, 580, 419, 439, 533, 549, 526, 491, 474, 445, 467, 604, 426, 507, 547, 585, 405, 587, 409, 466, 550, 492, 566, 546, 540, 551, 421, 516, 529, 592, 553, 577, 488, 511, 497, 548, 563, 512, 476, 593, 447, 425, 519, 520, 460, 417, 469, 487, 513, 581, 510, 509, 522, 481, 461, 462, 448, 521, 468, 463, 586, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454, 485, 552, 431, 438, 437, 574, 420, 525, 408, 416, 596, 433, 597, 427, 599, 490, 432, 528, 601, 407, 428, 544, 523, 470, 598, 499, 588, 609, 403, 498, 514, 524, 423, 532, 414, 578, 443, 486, 515, 406, 531, 573, 456, 455, 459, 543, 422, 583, 482, 478, 605, 554, 530, 418, 572, 582, 413, 440, 536, 575, 534, 567, 535, 576, 412, 402, 542, 603, 475, 449, 537, 538, 441, 464, 501, 465, 564, 568, 557, 424, 471, 504, 495, 457, 539, 483, 508, 571, 500, 444, 556, 429, 411, 541, 559, 415, 561, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503, 579, 400, 404, 489, 505, 479, 442, 458, 606, 607, 610, 590, 569, 611, 584, 608, 435, 450, 591, 594 } addEventHandler("onMarkerHit",root,function( hitElement, matchingDimension ) if source == marker then local elV = getPedOccupiedVehicle(hitElement) local x,y,z = getElementPosition(elV) local rx,ry,rz = getElementRotation(elV) local elA = createVehicle(math.random(#autos),x,y,z,rx,ry,rz) local warpear = warpPedIntoVehicle(hitElement,elA) if warpear then destroyElement(elV) end end end )
-
no, ya funciona, si lo que no funciona es solo ese error, es que hare un save system mediante XML, entonces cada player tendra su XML, Y despues lo usare para muchos otros resources ( debido a que mi server sera RPG/DM )
-
es que si lo coloco en clientside no lo leera porque en clientside no significa que este en el resource, sino que es el que el player descarga
-
local file = xmlLoadFile( username .." .xml" ) creo ya use eso.
-
._. no entiendo lo podrias añadir al script plz
-
Gracias Solid funciona , pero luego al reconectar Aparece el panel Login, coloco la pass correctamente y me da error en la linea 56 del client, Bad Argument 'xmlNodeGetAttribute'
-
Bueno, como dice en el titulo, aparece este error en la console, 'aca' era mi nick, porfavor ayudenme a solucionarlo [2012-09-21 02:28:55] WARNING: ElMota\server.lua:19: Bad argument @ 'logIn' [Expected account at argument 2, got string 'aca'] client 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 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( node, "name" ), xmlNodeGetAttribute( node, "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 )
-
gracias solid funciona perfecto
-
Funciona ahora solo falta que la pregunta aparesca completa
-
Funciona Solid, pero pregunto 'Tu juegas MTA' y aparece 'ElMota, Ah preguntado: Tu' y luego aparece 'Respuesta: 2'
-
mm la verdad no entiendo como modificar ese script
-
addCommandHandler("pr",function(playerSource, commandName, pregunta) local respuestas = {Si,No} outputChatBox(getPlayerName(playerSource).."#00fbff,Ah preguntado : #fff000"..pregunta,getRootElement(),0,255,255,true) outputChatBox("Respuesta : " .. math.random ( #respuestas ),getRootElement(),0,255,255,true) end ) sigue con los mismos problemas $
-
outputChatBox(getPlayerName(playerSource)..",#00fbffAh preguntado : "..pregunta,getRootElement(),0,255,255,true) ._.