-
Posts
302 -
Joined
-
Last visited
Everything posted by alex17
-
le diste permisos de Admin a tu script de login ?
-
no hay problema suerte
-
Para que funcione bien el evento onClientClick necesitamos comparar la posicion x , y del cursor con la posicion absoluta x, y del cursor (eso nos formara nuestro boton imaginario ) La posicion x, y la hayamos en los dos primeros argumentos del dxDrawRectangle sin embargo los otros dos siguientes argumentos no son mas que el largo y ancho . Para ayar la posicion absoluta x, y solo sumamos , la posicion x con el ancho total del Rectangle y la posicion y con la altura total de Rectangle . PD: soy muy malo explicando no se si me habras entendido algo
-
Bueno tal ves un poco tarde pero para el que lo necesite solucione el codigo de @lLinux ya lo prove y funciona addEventHandler("onClientRender", getRootElement(), function() dxDrawRectangle(610, 186, 126, 24, tocolor(255, 255, 255, 255), true) end ) showCursor(true) addEventHandler("onClientClick", getRootElement(), function( button, state, px, py ) if ( button == "left" and state == "down" ) then if ( px > 610 and px < 736) and ( py > 186 and py < 210 ) then outputChatBox("funciona") end end end )
-
puedes mirar este post es lo mismo que estas pidiendo https://forum.multitheftauto.com/viewtopic.php?f=146&t=75760
-
aca te dejo un ejemplo function RGColor_interpol(percent) local r,g,b = 255,255,0 percent = math.floor(math.min(math.max(percent,0),100)) local RGVAR = ((255*2)*percent*.01)-255 if RGVAR == 0 then r,g,b =255,255,0 end if RGVAR < 0 then g =255+RGVAR end if RGVAR > 0 then r = 255-RGVAR end return r,g,b,255 end addEventHandler("onClientRender", root, function drawhealth() local health = getElementHealth( getLocalPlayer() ) local r, g, b = RGColor_interpol((health)) local barra = 175* ( health / 100 ) dxDrawRectangle(400,100, 175, 35,tocolor( 0, 0, 0, 100 ), false) dxDrawRectangle(400,100, barra, 35,tocolor(r, g, b, 200 ), false) end )
-
si entendi bien lo que quieres creo que lo puedes logar con guiGetText
-
prueva con esto no estoy seguro jamas he utilizado el gang_system local gate3 = createObject(10841, -1078.9000244141, -1647.3000488281, 83.199996948242, 0, 0, 267.99499511719 ) open = false function OpenObjectt ( thePlayer ) local gangName = getElementData ( thePlayer, "gang" ) if ( gangName =="SOH") then if not open then moveObject(gate3, 1000, -1079, -1647.0999755859, 90.199996948242, 0, 0, 0 ) open = true outputChatBox ( "#00FF00Abriendo Puerta", thePlayer, 255, 255, 255, true ) elseif open then moveObject(gate3, 1000, -1078.9000244141, -1647.3000488281, 83.199996948242, 0, 0, 0 ) open = false outputChatBox ( "#ff0000Cerrando Puerta", thePlayer, 255, 255, 255, true ) end end end addCommandHandler("soh", OpenObjectt )
-
Aqui tienes editale el mensaje a tu gusto local gate3 = createObject(10841, -1078.9000244141, -1647.3000488281, 83.199996948242, 0, 0, 267.99499511719 ) open = false function OpenObjectt ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "SOH" ) ) then if not open then moveObject(gate3, 1000, -1079, -1647.0999755859, 90.199996948242, 0, 0, 0 ) open = true outputChatBox ( "#00FF00Abriendo Puerta", thePlayer, 255, 255, 255, true ) elseif open then moveObject(gate3, 1000, -1078.9000244141, -1647.3000488281, 83.199996948242, 0, 0, 0 ) open = false outputChatBox ( "#ff0000Cerrando Puerta", thePlayer, 255, 255, 255, true ) end end end addCommandHandler("soh", OpenObjectt )
-
de nada suerte
-
explicate bien que es lo que quieres para que quieres que se reinicie cada 10 s
-
de nada
-
en el resource freeroam hay un archivo llamdo fr_server.lua abrelo y dirigete a la linea 217 hay encontraras la funcion setMySkin reemplaza toda esa funcion por esto function setMySkin(skinid) if isPedDead(source) then local x, y, z = getElementPosition(source) if isPedTerminated(source) then x = 0 y = 0 z = 3 end local r = getPedRotation(source) local interior = getElementInterior(source) spawnPlayer(source, x, y, z, r, skinid) setElementInterior(source, interior) setCameraInterior(source, interior) else if skinid == 59 then if isObjectInACLGroup ("user."..getAccountName( getPlayerAccount (source) ), aclGetGroup ( "Admin" ) ) then setElementModel(source, skinid) setElementHealth(source, 100) else outputChatBox("Este skin es solo para Administradores", source, 100,0,0) end else setElementModel(source, skinid) setElementHealth(source, 100) end end setCameraTarget(source, source) setCameraInterior(source, getElementInterior(source)) end
-
ese script es lado server asi que tendras que usar un trigger para poder hacer un mensaje con dx o gui offtopic : ese script no es tuyo lo e visto en otros servidores
-
local gate3 = createObject(2951, 233.5, 1822.3000488281, 6.4000000953674, 0, 0, 270 ) open = false function OpenObjectt ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Burning Crusaders" ) ) then if not open then moveObject(gate3, 4000, 233.5, 1818.8000488281, 6.4000000953674 , 0, 0, 0 ) open = true elseif open then moveObject(gate3, 4000, 233.5, 1822.3000488281, 6.4000000953674, 0, 0, 0 ) open = false end end end addCommandHandler("warroom", OpenObjectt )
-
yo te lo di bien ya por que no lo provaste la razon de que al principio no te funcionara es por que escribiste mal el evento pusiste "OnResourceStart" y es "onResourceStart" addEventHandler("onResourceStart", getRootElement(), LoginExtras)
-
function LoginExtras() --Carros --Hunter createVehicle ( 425, 1291.14233, -793.24280, 97.50362 ) --Infernus 1 createVehicle ( 411, 1290.42725, -829.14185, 82.65894 ) --Old garage... createObject ( 11387, 2299.8999, -1370.5, 678.90002, 0, 0, 0 ) ---Barreras... createObject ( 8651, 2299.7, -1338.8, 676.5, 0, 0, 0 ) createObject ( 8651, 2299.7, -1338.8, 678.5, 0, 0, 0 ) createObject ( 8651, 2299.7, -1338.2, 676.79999, 0, 0, 92 ) createObject ( 8651, 2299.7, -1338.8, 678.5, 0, 0, 0 ) createObject ( 8651, 2281, -1385.4, 678.5, 0, 0, 0 ) createObject ( 8651, 2281, -1385.4, 676.5, 0, 0, 0) createObject ( 8651, 2280.8, -1370.7, 676.5, 0, 0, 92 ) createObject ( 8651, 2299.7, -1338.8, 678.5, 0, 0, 92 ) ----Edificios.... createObject ( 4004, 2269.7, -1322.6, 687.59998, 0, 0, 90 ) createObject ( 4004, 2302.8, -1406.8, 686.59998, 0, 0, 0 ) ----Carro & ped... createVehicle ( 411, 2309.5, -1362.8, 676.29999 ) createPed(25, 52312, -1360.7, 676.70001) end addEventHandler("onResourceStart", getRootElement(), LoginExtras)
-
es por que no esta iniciado el resource del scoreboard
-
Etube mirando el freeroam y la parte donde se cambia el skin con un comando esta en lado CLIENT por lo que deberas de usar un trigger
-
1- error estas asiendo tu script en el mismo script del scoreboard, y esa parte del scoreboard es "client" y tu script es lado "server" 2- Haslo en un script aparte al del scoreboard para evitar confuciones recuerda que es lado server exports.scoreprg:addScoreboardColumn('Home') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Home",":admin/client/images/flags/"..flag..".png") else flag = "N/A" end end addEventHandler("onPlayerJoin",getRootElement(),showcountry)
-
puedes mostrar tu codigo para poder ayudarte mejor
-
eso solo funcionara cuando el jugador spawnea
-
postea la parte de ese codigo con la que cambias el skin asi podria ayudarte mejor
-
1 - error esta en el evento el nombre no empiesa con " o " mayuscula empiesa con "o" minuscula error addEventHandler( "OnClientVehicleEnter", getRootElement(), MR ) forma correcta addEventHandler( "onClientVehicleEnter", getRootElement(), MR ) 2- Si es server o client .. el mismo nombre del evento te dice " onClient... " estonces el script es client al final te debe quedarte asi function MR() outputChatBox ( "Mensaje Anonimo", getRootElement(), 255, 0, 0, true ) end addEventHandler( "onClientVehicleEnter", getRootElement(), MR )