-
Posts
82 -
Joined
-
Last visited
Everything posted by Cuervo_fi
-
yo uso uno por cuentas y AccountData getAccountData setAccountData onPlayerLogin onPlayerQuit tu podrias hacerlo de la misma forma, para que cada ves que alguien entre y esn uevo se le asigne una ID, o el mismo serial como AccoundData, y asi chequeas.
-
Intenta pedir ayuda de script en la seccion scripting, no has agregado un comando que ejecute la funcion isPlayerAdmin y eso esta en server side.
-
Lo maximo es 1000, y es server side como dijo solid
-
Ok, gracias Solid y Alvarez
-
Hay forma de hacer que un outputChatBox salga solo a miembros de un ACL ? Gracias por comentar.
-
ES: no sé si aqui eliminen los resources robados que suben en la comunidad, quiero reportar este resource robado y subido en la comunidad. https://community.multitheftauto.com/ind ... ls&id=8103 el ladron que lo ha robado es tan poco inteligente que ni cambio lo que dice "zk" ni el outPutChatBox que dice los derechos de autor. También esta este script de un diseño de una moto que yo cree para mi servidor. https://community.multitheftauto.com/ind ... ls&id=8105 EN: I do not know if here stolen eliminate climbing resources in the community, I want to report stolen and uploaded this resource in the community. https://community.multitheftauto.com/ind ... ls&id=8103 the thief who stole it is so unintelligent that neither change what it says "zk" neither outPutChatBox says copyright. This script is also a design of a bike that I feel for my server. https://community.multitheftauto.com/ind ... ls&id=8105 PD: perdon por la traducción. DONE
-
Supongo que debes ponerle para que se ejecuten los sonidos despues de logearse, o si no usas login podrias usar: setTimer -- para ejecutar el sonido a su respectivo tiempo despues de entrar al server. onPlayerJoin -- para saber cuando entro un player y ejecutarle el setTimer. stopSound -- para detener el sonido. podrias ponerle para que al entrar se ejecute el sonido a un debido tiempo en el que se detiene la musica de tu login.
-
Solo editas el "3000" que es tiempo y el "4" que son las veces que se repite el setPedOnFire. addCommandHandler("fireme", function (thePlayer) local onFire = setTimer(setPedOnFire, 3000, 4, thePlayer, true) outputChatBox("* ".. getPlayerName(thePlayer) .." #0080FFesta en #FF8000fuego#0080FF!",getRootElement(),255,255,255,true) end)
-
haha, dale chaz. todos nos confundimos alguna ves
-
Ponelo asi como dice NodZen. y "marker_salida" no esta definido, por si no lo tenias agregado.. marker_entrada = createMarker(1837,-1682,14,"arrow",1,0,255,255,255) function entrada(source) setElementInterior (source, 17,493.390991,-22.722799,1000.679687) setElementInterior (marker_salida, 17 ) end addEventHandler("onMarkerHit",marker_entrada,entrada)
-
Este es el resource original, editalo a tu gusto. CLIENT: function createTeleportWindow() window = guiCreateWindow(0.3852,0.2075,0.2344,0.2688,"P-Teleport",true) guiSetAlpha(window,0.80000001192093) editX = guiCreateEdit(128,31,161,27,"",false,window) guiSetAlpha(editX,1) editY = guiCreateEdit(128,68,161,27,"",false,window) guiSetAlpha(editY,1) editZ = guiCreateEdit(128,105,161,27,"",false,window) guiSetAlpha(editZ,1) editInterior = guiCreateEdit(128,142,161,27,"",false,window) guiSetAlpha(editInterior,1) buttonTeleport = guiCreateButton(12,179,277,24,"Teleport me!",false,window) guiSetAlpha(buttonTeleport,1) labelX = guiCreateLabel(12,37,106,15,"Insert X",false,window) guiSetAlpha(labelX,1) guiLabelSetColor(labelX,255,255,255) guiLabelSetVerticalAlign(labelX,"top") guiLabelSetHorizontalAlign(labelX,"right",false) labelY = guiCreateLabel(12,75,106,15,"Insert Y",false,window) guiSetAlpha(labelY,1) guiLabelSetColor(labelY,255,255,255) guiLabelSetVerticalAlign(labelY,"top") guiLabelSetHorizontalAlign(labelY,"right",false) labelZ = guiCreateLabel(12,112,106,15,"Insert Z",false,window) guiSetAlpha(labelZ,1) guiLabelSetColor(labelZ,255,255,255) guiLabelSetVerticalAlign(labelZ,"top") guiLabelSetHorizontalAlign(labelZ,"right",false) labelInterior = guiCreateLabel(12,148,106,15,"Insert Interior ID",false,window) guiSetAlpha(labelInterior,1) guiLabelSetColor(labelInterior,255,255,255) guiLabelSetVerticalAlign(labelInterior,"top") guiLabelSetHorizontalAlign(labelInterior,"right",false) guiSetVisible(window, false) addEventHandler("onClientGUIClick", buttonTeleport, clientSubmitTeleport, false) end function startTeleportWindow() createTeleportWindow() guiSetVisible(window, true) showCursor(true) guiSetInputEnabled(true) end addEvent("onAdminTeleport", true) addEventHandler("onAdminTeleport", getRootElement(), startTeleportWindow) function clientSubmitTeleport(button,state) if button == "left" and state == "up" then local teleX = guiGetText(editX) local teleY = guiGetText(editY) local teleZ = guiGetText(editZ) local teleI = guiGetText(editInterior) localPlayer = getLocalPlayer() setElementInterior(localPlayer, teleI, teleX, teleY, teleZ) guiSetInputEnabled(false) guiSetVisible(window, false) showCursor(false) end end SERVER: function checkAdminTeleport (thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent(thePlayer, "onAdminTeleport", getRootElement()) else outputChatBox("Este comando es solo para Administradores.",player,255,12,15) end end addCommandHandler("teleport", checkAdminTeleport ) EDIT: me confundi en el evento !. ya lo arregle.
-
Lo que quiero esque al poner un comando me remueva el tag del dxDrawText, una ayudita pls PD: este script es de la comunidad. srfont = dxCreateFont("tag.ttf",13) g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_Players = getElementsByType('player') g_Me = getLocalPlayer() nametag = {} local nametags = {} local g_screenX,g_screenY = guiGetScreenSize() local bHideNametags = false local NAMETAG_SCALE = 0.3 --Overall adjustment of the nametag, use this to resize but constrain proportions local NAMETAG_ALPHA_DISTANCE = 50 --Distance to start fading out local NAMETAG_DISTANCE = 100 --Distance until we're gone local NAMETAG_ALPHA = 255 --The overall alpha level of the nametag --The following arent actual pixel measurements, they're just proportional constraints local NAMETAG_TEXT_BAR_SPACE = 2 local NAMETAG_WIDTH = 50 local NAMETAG_HEIGHT = 5 local NAMETAG_TEXTSIZE = 0.3 local NAMETAG_OUTLINE_THICKNESS = 1.2 -- local NAMETAG_ALPHA_DIFF = NAMETAG_DISTANCE - NAMETAG_ALPHA_DISTANCE NAMETAG_SCALE = 1/NAMETAG_SCALE * 800 / g_screenY -- Ensure the name tag doesn't get too big local maxScaleCurve = { {0, 0}, {3, 3}, {13, 5} } -- Ensure the text doesn't get too small/unreadable local textScaleCurve = { {0, 0.8}, {0.8, 1.2}, {99, 99} } -- Make the text a bit brighter and fade more gradually local textAlphaCurve = { {0, 0}, {25, 100}, {120, 190}, {255, 190} } function nametag.create ( player ) nametags[player] = true end function nametag.destroy ( player ) nametags[player] = nil end addEventHandler ( "onClientRender", g_Root, function() -- Hideous quick fix -- for i,player in ipairs(g_Players) do if isElement(player) then if player ~= g_Me then setPlayerNametagShowing ( player, false ) if not nametags[player] then nametag.create ( player ) end end end end if bHideNametags then return end local x,y,z = getCameraMatrix() for player in pairs(nametags) do while true do if not isElement(player) then break end if getElementDimension(player) ~= getElementDimension(g_Me) then break end local px,py,pz = getElementPosition ( player ) if processLineOfSight(x, y, z, px, py, pz, true, false, false, true, false, true) then break end local pdistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if pdistance <= NAMETAG_DISTANCE then --Get screenposition local sx,sy = getScreenFromWorldPosition ( px, py, pz+0.95, 0.06 ) if not sx or not sy then break end --Calculate our components local scale = 1/(NAMETAG_SCALE * (pdistance / NAMETAG_DISTANCE)) local alpha = ((pdistance - NAMETAG_ALPHA_DISTANCE) / NAMETAG_ALPHA_DIFF) alpha = (alpha < 0) and NAMETAG_ALPHA or NAMETAG_ALPHA-(alpha*NAMETAG_ALPHA) scale = math.evalCurve(maxScaleCurve,scale) local textscale = math.evalCurve(textScaleCurve,scale) local textalpha = math.evalCurve(textAlphaCurve,alpha) local outlineThickness = NAMETAG_OUTLINE_THICKNESS*(scale) --Draw our text local r,g,b = getPlayerNametagColor(player) local offset = (scale) * NAMETAG_TEXT_BAR_SPACE/2 local w = dxGetTextWidth(getPlayerNameR(player), textscale * NAMETAG_TEXTSIZE, srfont) / 2 dxDrawText ( getPlayerNameR(player), sx, sy - offset, sx, sy - offset, tocolor(0,0,0,255), textscale*NAMETAG_TEXTSIZE, srfont, "center", "bottom", false, false, false ) dxDrawColorText ( getPlayerName(player), sx-w, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, srfont, "center", "bottom", false, false, false ) local drawX = sx - NAMETAG_WIDTH*scale/2 drawY = sy + offset local width,height = NAMETAG_WIDTH*scale, NAMETAG_HEIGHT*scale dxDrawRectangle ( drawX, drawY, width, height, tocolor(255,0,0,50) ) --Next the inner background local health local p local r,g health = getElementHealth ( player ) health = math.max(health, 0)/100 p = -510*(health^2) r,g = math.max(math.min(p + 255*health + 255, 255), 0), math.max(math.min(p + 765*health, 255), 0) if health > 1.0 then health = 1.0 end dxDrawRectangle ( drawX + outlineThickness, drawY + outlineThickness, width - outlineThickness*2, height - outlineThickness*2, tocolor(0,0,0,50) ) --Finally, the actual health dxDrawRectangle ( drawX + outlineThickness, drawY + outlineThickness, health*(width - outlineThickness*2), height - outlineThickness*2, tocolor(0,255,50,150) ) end break end end end ) ---------------THE FOLLOWING IS THE MANAGEMENT OF NAMETAGS----------------- addEventHandler('onClientResourceStart', g_ResRoot, function() for i,player in ipairs(getElementsByType"player") do if player ~= g_Me then nametag.create ( player ) end end end ) addEventHandler ( "onClientPlayerJoin", g_Root, function() if source == g_Me then return end setPlayerNametagShowing ( source, false ) nametag.create ( source ) end ) addEventHandler ( "onClientPlayerQuit", g_Root, function() nametag.destroy ( source ) end ) -- Math functions function math.lerp(from,to,alpha) return from + (to-from) * alpha end -- curve is { {x1, y1}, {x2, y2}, {x3, y3} ... } function math.evalCurve( curve, input ) -- First value if input[1][1] then return curve[1][2] end -- Interp value for idx=2,#curve do if input[idx][1] then local x1 = curve[idx-1][1] local y1 = curve[idx-1][2] local x2 = curve[idx][1] local y2 = curve[idx][2] -- Find pos between input points local alpha = (input - x1)/(x2 - x1); -- Map to output points return math.lerp(y1,y2,alpha) end end -- Last value return curve[#curve][2] end function removeColorCoding ( name ) return type(name)=='string' and string.gsub ( name, '#%x%x%x%x%x%x', '' ) or name end function getPlayerNameR ( player ) return removeColorCoding ( getPlayerName ( player ) ) end function dxDrawColorText(str, ax, ay, bx, by, color, scale, font,alignX,alignY,clip, wordBreak, postGUI) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font,alignX,alignY,clip, wordBreak, postGUI) ax = ax + w color = tocolor(tonumber("0x"..string.sub(col, 1, 2)), tonumber("0x"..string.sub(col, 3, 4)), tonumber("0x"..string.sub(col, 5, 6)), 255) end last = e+1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font,alignX,alignY,clip, wordBreak, postGUI) end end
-
si usas attach y remplazas otro objeto para que sea parecida a un arma podrias hacerlo así el arma se dispare no seria remplazada pero si el objeto que lo este cubriendo .
-
Linea 9 outputChatBox ("*".. getPlayerName(source) .." ah encendido el Vehiculo.", Source, 255, 30, 50) cambia el 'Source' por 'source' edit: no ley completo D: Guiate de aqui: https://forum.multitheftauto.com/viewtopic.php?f=91&t=53376&p=518382&hilit=localchat#p518382
-
AccountData.
-
entendi esto addCommandHandler("vehposition", function(thePlayer, command) local vehicle = getPedOccupiedVehicle ( thePlayer ) if vehicle then local x, y, z = getElementPosition(vehicle) outputChatBox("La posicion de tu vehiculo es: #00ff00"..x..", "..y..", "..z, thePlayer, 0,255,255, true) else outputChatBox("Debes estar en un vehiculo !", thePlayer, 255,0,0, true) end end ) pero lo que quieres es sacar la posicion de un objeto pegado a un vehiculo, podes usar esto attachElements createMarker createVehicle onResourceStart
-
el quiere guardar los autos por elementData y no por xml
-
quizas hacer un resource con exports y si exportas a ese resource para chekear alguna clave o algo.. de esa forma el script q exporte que esta compilado no funcionaria sin el codigo del exports es una idea no mas..
-
jaja si olvide poner esos detalles, gracias solid.
-
asignalos al mismo team local team = getTeamFromName ( "el team") function elbot () elbot = exports [ "slothbot" ]:spawnBot bla bla.. end addEventHandler("onBotSpawned",getRootElement(), function ( ) setBotTeam(elbot,team) end )
-
createRadarArea -- para hacer el are visible por medio de un color.. createColRectangle -- para crear el alcance del area.. getElementType -- para definir el player.. setElementData -- para darle al player un elemento que lo haga saber que entro antes.- getElementData -- para saber si ya estuvo en el area antes.. onColShapeHit -- para saber si el player entro al area.. onPlayerLogin -- para saber cuando se ha logeado.. onElementDataChange -- para saber si el player cambio de data.. logOut -- para des logear.. y no se que mas, haha.. espero que alguien te ayude y aporte, suerte (Y)
-
talves te ignoran ya que comentas cosas no necesarias..
-
el setTimer es para cacular el tiempo en que la descarga termina, de esa forma se quita al tiempo del setTimer. creo que no existe alguna funcion para saber si ya terminaste de descargar..
-
Quizas sea algun otro recurso que los hace perderlas, y si las pierde el mismo save system guardara como si no tiene las armas. de esa forma no las recupera