Araa
Members-
Posts
64 -
Joined
-
Last visited
Everything posted by Araa
-
function peds() poli1 = createPed ( 71, 2042.18, 1621.4, 1023.01 ) poli2 = createPed ( 71, 2046.12, 1622.28, 1023.01 ) setElementInterior( poli1, 1 ) setElementDimension( poli1, 15 ) setElementInterior( poli2, 1 ) setElementDimension( poli2, 15 ) setElementRotation(poli1,0, 0, 190) setElementRotation(poli2,0, 0, 180) setPedControlState ( poli1, "fire", true ) setPedControlState ( poli2, "fire", true ) triggerServerEvent ( "Start.Arma", root, poli1, poli2 ) end addEvent( "Start.Ped", true ) addEventHandler( "Start.Ped", root, peds ) function armas(poli1, poli2) giveWeapon ( poli1, 22, 200 ) giveWeapon ( poli2, 22, 200 ) end addEvent( "Start.Arma", true ) addEventHandler( "Start.Arma", root, armas ) Proba ahora.
-
-- Server Side function fogata( thePlayer, cmd ) local x,y,z = getElementPosition( thePlayer ) z = z - 1 local libro1 = createObject( 2894, x, y, z ) x = x + 0.4 local libro2 = createObject( 2894, x, y, z ) y = y + 0.4 x = x - 0.2 local libro3 = createObject( 2894, x, y, z ) x = x - 0.2 y = y - 0.4 triggerClientEvent( "createFire", root, x, y, z ) end addCommandHandler( "hacerfogata", fogata ) -- Client Side: function crearElFuego( x, y, z ) createFire( x, y, z, 10 ) end addEvent( "createFire", true ) addEventHandler( "createFire", root, crearElFuego, x, y, z )
-
aun: badArgument @getElementModel
-
attempt to call a global 'getPedOccupiedVehicleSeat' (a nil value)
-
Tengo un problema en mi script, el blip y el marker se crean cuando entro al vehiculo, pero cuando le doy hit a un marker me dice Bad Argument @getElementModel . Intente mucho pero no lo puedo arreglar, alguna idea del porque? function getNewLocation(player, seat) local vehicle = getPedOccupiedVehicle(player) local id = getElementModel(vehicle) if ( id == 448 ) and ( seat == 0 )then outputChatBox("A new location has been marker in your map, deliver you pizza on time!") num = math.random(#markersPosition) marker = createMarker(markersPosition[num][1], markersPosition[num][2], markersPosition[num][3], "checkpoint", 1.5, 100, 150, 50) blip = createBlipAttachedTo(marker, 51) addEventHandler("onClientMarkerHit", marker, function() destroyElement(marker) destroyElement(blip) setTimer(getNewLocation,2000,1) end) end end addEventHandler("onClientVehicleEnter", root, getNewLocation) Gracias.
-
No estoy segura pero creo que es porque usas ' ' en lugar de " " para las cadenas de caracteres.
-
https://wiki.multitheftauto.com/wiki/GuiGetText https://wiki.multitheftauto.com/wiki/CreateTeam https://wiki.multitheftauto.com/wiki/AddEvent https://wiki.multitheftauto.com/wiki/TriggerServerEvent https://wiki.multitheftauto.com/wiki/OnClientGUIClick Esas son las funciones y eventos que tenes que usar.
-
Ehm bueno, alfinal hice algo, gracias por la ayuda, ahora tengo un problema mas: -- Server function startDancing(player) if (isPedOnGround) then setPedAnimation(player,"DANCING", "dnce_m_b") end end addCommandHandler("dance",startDancing) function stopDancingEvent(player) setPedAnimation(player,false) end addEvent("stopDancing",true) addEventHandler("stopWalking",getRootElement(),stopDancingEvent) -- Client function stopDancing(button,press) if (press) then if (button == "w") then triggerServerEvent("stopDancing",getLocalPlayer()) end end end addEventHandler("onClientKey", root,stopDancing) El problema es que no se detiene y me dice que el argumento en setPedAnimation no es valido, alguna idea?
-
Ehm bueno, lo que les queria preguntar es si existe algun evento que trigee una funcion cuando el jugador se mueve, o cuando apunta un arma. Por ejemplo: function back(player) outputChatBox("You are no longer AFK",255,0,0,player) end para que muestre el mensaje cuando el jugador se mueva o apunte un arma, muchas gracias.
-
Bueno, les quería hacer una pregunta, en esta parte la lista de jugadores se actualiza, todo perfecto... Pero como esto es para un server muy concurrido, con aproximadamente 700 jugadores regularmente, cuando cambian nick, o loguean, se desmarca el jugador seleccionado, me gustaria saber como remarcarlo o que no se desmarque. function updateList() guiGridListClear(StatsGrid) for id, players in ipairs (getElementsByType("player")) do local row = guiGridListAddRow(StatsGrid) guiGridListSetItemText(StatsGrid,row,1,(getPlayerName(players)),false,false) end end addEventHandler("onClientPlayerJoin",root,updateList) addEventHandler("onClientPlayerQuit",root,updateList) addEventHandler("onClientPlayerChangeNick",root,updateList) addEventHandler("onClientResourceStart",root,updateList) Gracias.
-
You haven't add the function, you posted the same code as before. It should be like: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} function guiMyCwindow(w,h,t) local x,y = guiGetScreenSize() return guiCreateWindow((x-w)/2,(y-h)/2,w,h,t,false) end GUIEditor_Window[1] = guiMyCwindow(359,185,"Play Sound From URL") guiSetVisible(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) URLE = guiCreateEdit(16,72,328,38,"",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(21,44,75,18,"Sound URL :",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(11,116,330,20,"* File Extensions : mp3 , wav, ogg, riff , mod, xm, it , s3m",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],255,0,0) PlayStop = guiCreateButton(204,140,127,36,"Play",false,GUIEditor_Window[1]) GUIEditor_Label[3] = guiCreateLabel(11,159,25,15,"By :",false,GUIEditor_Window[1]) GUIEditor_Label[4] = guiCreateLabel(37,160,101,18,"|S.s|SoRa",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],255,0,0) GUIEditor_Label[5] = guiCreateLabel(97,25,47,16,"Speed :",false,GUIEditor_Window[1]) sup = guiCreateButton(161,24,27,23,"+",false,GUIEditor_Window[1]) sdown = guiCreateButton(189,24,27,23,"-",false,GUIEditor_Window[1]) sn = guiCreateLabel(144,26,16,18,"0",false,GUIEditor_Window[1]) guiLabelSetColor(sn,0,255,0) GUIEditor_Label[7] = guiCreateLabel(220,26,50,18,"Volume :",false,GUIEditor_Window[1]) sv = guiCreateLabel(272,28,18,21,"0",false,GUIEditor_Window[1]) guiLabelSetColor(sv,255,255,0) vup = guiCreateButton(292,24,27,23,"+",false,GUIEditor_Window[1]) vdown = guiCreateButton(322,24,26,23,"-",false,GUIEditor_Window[1]) guiSetInputMode ("no_binds_when_editing") --[[ local volume = true local speed = true --]] local sound = true function onGuiClick (button, state, absoluteX, absoluteY) if (source == PlayStop) then if sound == true then local URL = guiGetText ( URLE ) sp = playSound(URL) outputChatBox ( "Sound loading maybe take time ...", getLocalPlayer(), 255, 0, 0, true ) outputChatBox ( "Sound starting !", getLocalPlayer, 255, 0, 0, true ) guiSetText(PlayStop,"Stop") sound = false else stopSound(sp) guiSetText(PlayStop,"Play") outputChatBox ( "Sound stopped !", getLocalPlayer(), 255, 0, 0, true ) guiSetText(sn,"1") guiSetText(sv,"1") sound = true end end end addEventHandler ("onClientGUIClick", getRootElement(), onGuiClick) function GuiClick (button, state, absoluteX, absoluteY) if (source == sup) then local ss = getSoundSpeed(sp)+1 while not setSoundSpeed ( sp, ss ) do ss = ss + 1 end guiSetText(sn,""..ss.."") elseif (source == sdown) then local ss = getSoundSpeed(sp)-1 while not setSoundSpeed ( sp, ss ) do ss = ss - 1 end guiSetText(sn,""..ss.."") elseif (source == vup) then local svol = getSoundVolume(sp)+1 while not setSoundVolume ( sp, svol ) do svol = svol + 1 end guiSetText(sv,""..svol.."") elseif (source == vdown) then local svol = getSoundVolume(sp)-1 while not setSoundVolume ( sp, svol ) do svol = svol -1 end guiSetText(sv,""..svol.."") end end addEventHandler ("onClientGUIClick", getRootElement(), GuiClick) function show() if guiGetVisible(GUIEditor_Window[1]) == true then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) else guiSetVisible(GUIEditor_Window[1],true) showCursor(true) end end addCommandHandler("su",show)
-
exports [ "scoreboard" ]:addScoreboardColumn ("Estado", 3 ) function actualizarEstado() for index, player in ipairs ( getElementsByType ( "player" ) ) do estado = getElementData (player, "afk") if (estado) then setElementData ( player, "Estado", tostring(estado)) else setElementData ( player, "Estado", "Normal") end end end setTimer ( actualizarEstado, 2500, 0 ) function goafk (player, command) data = getElementData (player, "afk") if not (data == "AFK") then setElementData (player, "afk", "AFK") else setElementData (player, "afk", "Normal") end end addCommandHandler ("afk", goafk) Si, le faltaba un check para ver si tenia o no ElementData. Ya lo arregle.
-
guiSetInputMode ("no_binds") T, Y and any other binds will be disabled when the GUI is open. guiSetInputMode ("no_binds_when_editing") T, Y and any other binds will be disbled when you are editing a field in the GUI.
-
exports [ "scoreboard" ]:addScoreboardColumn ("Estado", 3 ) function actualizarEstado() for index, player in ipairs ( getElementsByType ( "player" ) ) do estado = getElementData (player, "afk") setElementData ( player, "Estado", tostring(estado)) end end setTimer ( actualizarEstado, 2500, 0 ) function goafk (player, command) data = getElementData (player, "afk") if not (data == "AFK") then setElementData (player, "afk", "AFK") else setElementData (player, "afk", "Normal") end end addCommandHandler ("goafk", goafk) Usa, /goafk para cambiar de modo AFK a normal y de Normal a AFK.
-
Te doy un ejemplo. function crearGrupo (jugador, comando, grupoNuevo) grupo = aclGetGroup ( grupoNuevo ) cuenta = getAccountName ( getPlayerAccount ( jugador ) ) if isObjectInACLGroup ("user."..cuenta, aclGetGroup ( "Admin" ) ) then if not grupo then ourGroup = aclCreateGroup ( grupoNuevo ) else outputChatBox ("El grupo que intentas crear ya existe", jugador) end else outputChatBox ("No puedes crear un grupo porque no eres administrador", jugador) end end addCommandHandler ("creargrupo", crearGrupo) Si el jugador que quiere crear un grupo es Administrador, entonces este se creara (Si es que no existe aun). Si cualquier otro jugador intenta hacerlo no podra, ahi te demuestro como funciona cada funcion, espero que te sirva.
-
if (guiGetVisible( Main_Window )) == true then guiSetVisible ( Main_Window, false ) showCursor ( false ) elseif (guiGetVisible( Main_Window )) == false then guiSetVisible ( Main_Window, true ) showCursor ( true ) end Si no es uno es el otro, no pongas el ishidden porque no tiene sentido.
-
local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10 function joinHandler() spawnPlayer(source, spawnX, spawnY, spawnZ) fadeCamera(source, true) setCameraTarget(source, source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) Eso esta en la wiki, "Inroduction to scripting". Pero no entiendo, si queres que cada vez que el jugador se desloguee se guarde la posicion y cuando entre de nuevo aparezca ahi? O que es lo que estas buscando?
-
function menuReglas() ventana = guiCreateWindow(604,304,264,228,"Reglas:",false) label = guiCreateLabel(8,27,162,19,"*No Pedir Ser Administrador.",false,ventana) label2 = guiCreateLabel(7,46,218,18,"*No Hacer Spam O Tendras Problemas.",false,ventana) label3 = guiCreateLabel(7,65,239,22,"*Respetar A Los User Y Administradores.",false,ventana) label4 = guiCreateLabel(7,85,235,20,"*No Insultar A Los User Y Administradores.",false,ventana) label5 = guiCreateLabel(14,131,196,16,"Estas Son Las Reglas Del Servidor...",false,ventana) label6 = guiCreateLabel(15,147,168,16,"Respeta Las Reglas O Tendras Problemas!",false,ventana) label7 = guiCreateLabel(141,193,122,21,"By:[XTE][M]aauroo",false,ventana) boton = guiCreateButton(14,190,115,24,">> Aceptar <<",false,ventana) showCursor (true) end addEventHandler("onClientResourceStart", getRootElement(), menuReglas) addEventHandler("onClientGUIClick",getRootElement(), function (player) if (source == boton) then guiSetVisible (ventana,false) showCursor (false) end end) Proba asi. EDIT: Si queres hacer un renglon abajo no es necesario que hagas otro label podes crear una tabla o directamente usar \n (eso hara que el texto pase a la siguiente linea)
-
addEventHandler("onClientGUIClick",getRootElement(), function (player) if (source == GUIEditor_Button[1]) then guiSetVisible (GUIEditor_Window[1],false) showCursor (false) end end Ah.. y te recomiendo usar variables, es mas ordenado.
-
Mmm... funciona, pero cuando el player esta unmuted el texto sigue
-
Bueno, hola.. tengo un pequeño problema ._. cuando intento correr el script, este dice "Bad Argument @ 'is Player Muted'" Perdon si es un super fail me cuesta bastante esto, lo que tendria que hacer es mostrar el drawText si el player esta muteado, no siempre... Gracias. --SERVER function mutecheck (thePlayer) if isPlayerMuted ( thePlayer ) then return true else return false end setTimer(mutecheck, 5000,1) addEvent ("checker", true, mutecheck) --CLIENT function showing( ) local px, py, pz, tx, ty, tz, dist px, py, pz = getCameraMatrix( ) for _, v in ipairs( getElementsByType 'player' ) do tx, ty, tz = getElementPosition( v ) dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) if dist < 30.0 then if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then local sx, sy, sz = getPedBonePosition( v, 1 ) local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 ) if x and triggerServerEvent ("checker", v) == true then dxDrawText( "Muted ", x, y, x, y, tocolor(150, 0, 0), 0.85 + ( 15 - dist ) * 0.02, "pricedown", "center" ) end end end end end addEventHandler( "onClientRender",root,showing) setTimer (showing, 5000,1) Segun esto
