-
Posts
551 -
Joined
-
Last visited
Everything posted by depato123
-
Hola, queria saber como puedo agregar skins que tengan permisos para hacer la prueba que el script habla crossMissionStartMarker = createMarker (-2493.21,2511.90,17.49,"cylinder",1.2,0,255,255) addEventHandler ("onMarkerHit", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then if ( getElementModel ( player ) == 25 ) then outputChatBox ("Prueba de manejo.", player, 127, 0, 255, false) outputChatBox (" Bienvenido a la prueba de manejo", player, 255, 255, 255, false) outputChatBox (" Por 100$ podras acceder a un circuito de prueba", player, 255, 255, 255, false) outputChatBox (" Podras ganar 500$ como ayuda para tu auto si pasas la prueba", player, 255, 255, 255, false) outputChatBox (" Para comenzar di /startprueba", player, 255, 255, 255, false) else outputChatBox ("Ya haz pasado la prueba.", player, 255, 0, 0, true) end end end) osea quisiera que ademas del skin 25 también el 23 y el 10 puedan hacer la prueba del script
-
Ya lo resolví ahora tengo otra duda -- Anuncios para ventas u demas cosas -- Ejemplo: /an Vendo Bullet barato #49546566 function publicChat(thePlayer, commandName, ...) local players = getElementsByType("player") local playerName = getClientName ( thePlayer ) local chatContent = {...} for index, player in ipairs ( players ) do outputChatBox( "[Anuncio] ".. playerName.. ": " ..table.concat ( chatContent, " "), player, 50, 200, 100) end end addCommandHandler( "an", publicChat ) ¿como puedo sacar el playerName de la linea 8? así nadie sabe quien envió el anuncio
-
si, no me reconoce el comando, osea que escribo /u texto y el texto no se manda a todo el server, nisiquiera a una parte
-
Hola amigos, tengo un resource de chat global para roleplays pero escribo el comando que le puse y no funciona function globalOOC( thePlayer, commandName, ... ) if getElementData(thePlayer, "loggedin") == true then if getElementData( thePlayer, "ooc" ) == 1 then local message = table.concat( { ... }, " " ) if #message > 0 then outputChatBox( "" .. string.gsub(getPlayerName( thePlayer ), "_", " ") .. " [GlobalOOC]: " .. message .. "", root, 0, 104, 139 ) else outputChatBox( "Usage: /" .. commandName .. " [OOC text]", thePlayer, 255, 255, 255 ) end end end end addCommandHandler("u", globalOOC) addCommandHandler("GlobalOOC", globalOOC) lo que pasa en el server: Say: /u Estoesunaprueba
-
Hola, necesito ayuda con un resource de nametag que encontré por internet, el problema es que solo sirve si alguien esta usando un vehículo y no funciona sin estar dentro de uno Aquí el link del resource: http://www.mediafire.com/download/y9vjl ... metags.zip --[[ Copyright (c) 2010 MTA: Paradise This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ]] local p = { } addEvent( "nametags:chatbubble", true ) addEventHandler( "nametags:chatbubble", root, function( state ) if source == client then -- since you can't request the state for your local player anyway, here we go for syncing it if state == true or state == false or state == 1 then if state == true then p[ source ] = true else p[ source ] = nil end local x, y, z = getElementPosition( source ) local dimension = getElementDimension( source ) local interior = getElementInterior( source ) for key, player in ipairs( getElementsByType( "player" ) ) do if player ~= source and getElementDimension( player ) == dimension and getElementInterior( player ) == interior and getDistanceBetweenPoints3D( x, y, z, getElementPosition( player ) ) < 250 then triggerClientEvent( player, "nametags:chatbubble", source, state ) end end end else -- remote player has a chat bubble, thus tell the client. if not, this is called by streaming in and can be ignored if p[ source ] then triggerClientEvent( client, "nametags:chatbubble", source, true ) end end end ) addEventHandler( "onPlayerQuit", root, function( ) p[ source ] = nil end ) --[[ Copyright (c) 2010 MTA: Paradise This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ]] local nametags = { } -- settings local _max_distance = 120 -- max. distance it's visible local _min_distance = 7.5 -- minimum distance, if a player is nearer his nametag size wont change local _alpha_distance = 20 -- nametag is faded out after this distance local _nametag_alpha = 170 -- alpha of the nametag (max.) local _bar_alpha = 120 -- alpha of the bar (max.) local _scale = 0.2 -- change this to keep it looking good (proportions) local _nametag_textsize = 0.6 -- change to increase nametag text local _chatbubble_size = 15 local _bar_width = 40 local _bar_height = 6 local _bar_border = 1.2 -- adjust settings local _, screenY = guiGetScreenSize( ) real_scale = screenY / ( _scale * 800 ) local _alpha_distance_diff = _max_distance - _alpha_distance local localPlayer = getLocalPlayer( ) addEventHandler( 'onClientRender', root, function( ) -- get the camera position of the local player local cx, cy, cz = getCameraMatrix( ) local dimension = getElementDimension( localPlayer ) local interior = getElementInterior( localPlayer ) -- loop through all players for player, chaticon in pairs( nametags ) do if getElementDimension( player ) == dimension and getElementInterior( player ) == interior and isElementOnScreen( player ) then local px, py, pz = getElementPosition( player ) local distance = getDistanceBetweenPoints3D( px, py, pz, cx, cy, cz ) if distance <= _max_distance and ( getElementData( localPlayer, "collisionless" ) or isLineOfSightClear( cx, cy, cz, px, py, pz, true, true, false, true, false, false, true, getPedOccupiedVehicle( player ) ) ) then local dz = 1 + 2 * math.min( 1, distance / _min_distance ) * _scale if isPedDucked( player ) then dz = dz / 2 end pz = pz + dz local sx, sy = getScreenFromWorldPosition( px, py, pz ) if sx and sy then local cx = sx -- how large should it be drawn distance = math.max( distance, _min_distance ) local scale = _max_distance / ( real_scale * distance ) -- visibility local alpha = ( ( distance - _alpha_distance ) / _alpha_distance_diff ) local bar_alpha = ( ( alpha < 0 ) and _bar_alpha or _bar_alpha - (alpha * _bar_alpha) ) * ( getElementData( localPlayer, "collisionless" ) and 1 or getElementAlpha( player ) / 255 ) if bar_alpha > 0 then local nametag_alpha = bar_alpha / _bar_alpha * _nametag_alpha -- draw the player's name local r, g, b = getPlayerNametagColor( player ) dxDrawText( getPlayerNametagText( player ), sx, sy, sx, sy, tocolor( r, g, b, nametag_alpha ), scale * _nametag_textsize, 'default', 'center', 'bottom' ) -- draw the health bar local width, height = math.ceil( _bar_width * scale ), math.ceil( _bar_height * scale ) local sx = sx - width / 2 local border = math.ceil( _bar_border * scale ) -- draw the armor bar local armor = math.min( 100, getPedArmor( player ) ) if armor > 0 then -- outer background dxDrawRectangle( sx, sy, width, height, tocolor( 0, 0, 0, bar_alpha ) ) -- get the colors local r, g, b = 255, 255, 255 -- inner background, which fills the whole bar but is somewhat transparent dxDrawRectangle( sx + border, sy + border, width - 2 * border, height - 2 * border, tocolor( r, g, b, 0.4 * bar_alpha ) ) -- fill it with the actual armor dxDrawRectangle( sx + border, sy + border, math.floor( ( width - 2 * border ) / 100 * getPedArmor( player ) ), height - 2 * border, tocolor( r, g, b, bar_alpha ) ) -- set the nametag below sy = sy + 1.2 * height end -- outer background dxDrawRectangle( sx, sy, width, height, tocolor( 0, 0, 0, bar_alpha ) ) -- get the colors local health = math.min( 100, getElementHealth( player ) ) local r, g, b = 255 - 255 * health / 100, 255 * health / 100, 0 -- inner background, which fills the whole bar but is somewhat transparent dxDrawRectangle( sx + border, sy + border, width - 2 * border, height - 2 * border, tocolor( r, g, b, 0.4 * bar_alpha ) ) -- fill it with the actual health dxDrawRectangle( sx + border, sy + border, math.floor( ( width - 2 * border ) / 100 * health ), height - 2 * border, tocolor( r, g, b, bar_alpha ) ) -- chat icon if the player has one if chaticon then local square = math.ceil( _chatbubble_size * scale ) local sy = sy + square / 1.9 local r, g, b = 255 - 128 * health / 100, 127 + 128 * health / 100, 127 dxDrawImage( cx, sy, square, square, chaticon == true and "chat.png" or "console.png", 0, 0, 0, tocolor( r, g, b, nametag_alpha ) ) end end end end end end end ) addEventHandler( 'onClientResourceStart', getResourceRootElement( ), function( ) for _, player in pairs( getElementsByType( 'player' ) ) do if player ~= localPlayer then -- hide the default nametag setPlayerNametagShowing( player, false ) if isElementStreamedIn( player ) then -- save the player data nametags[ player ] = false end end end end ) addEventHandler( 'onClientResourceStop', getResourceRootElement( ), function( ) -- handle stopping this resource for player in pairs( nametags ) do -- restore the nametag setPlayerNametagShowing( player, true ) -- remove saved data nametags[ player ] = nil end end ) addEventHandler ( 'onClientPlayerJoin', root, function( ) -- hide the nametag setPlayerNametagShowing( source, false ) end ) addEventHandler ( 'onClientElementStreamIn', root, function( ) if source ~= localPlayer and getElementType( source ) == "player" then -- save the player data nametags[ source ] = false triggerServerEvent( "nametags:chatbubble", source ) end end ) addEventHandler ( 'onClientElementStreamOut', root, function( ) if nametags[ source ] then -- cleanup nametags[ source ] = nil end end ) addEventHandler ( 'onClientPlayerQuit', root, function( ) if nametags[ source ] then -- cleanup nametags[ source ] = nil end end ) -- local oldConsoleState = false local oldInputState = false addEventHandler( "onClientRender", root, function( ) local newConsoleState = isConsoleActive( ) if newConsoleState ~= oldConsoleState then triggerServerEvent( "nametags:chatbubble", localPlayer, newConsoleState and 1 or false ) oldConsoleState = newConsoleState else local newInputState = isChatBoxInputActive( ) if newInputState ~= oldInputState then triggerServerEvent( "nametags:chatbubble", localPlayer, newInputState ) oldInputState = newInputState end end end ) addEvent( "nametags:chatbubble", true ) addEventHandler( "nametags:chatbubble", root, function( state ) if nametags[ source ] ~= nil and ( state == true or state == false or state == 1 ) then nametags[ source ] = state end end ) Edit: me olvide, esos 2 .lua no se que función cumplen, la verdad creo que es muy avanzado pero si tiene solución al problema que les dije estaré muy agradecido
-
¿Los mapas tambien hay que convertirlos?
-
¿Que es "UTF-8"? la verdad pregunto esto porque me estan saliendo un monton de errores en la consola de algo "UTF-8" WARNING: vehiculos/speedo.lua [Client] is encoded in ANSI instead of UTF-8- Please convert your file to UTF-8 Some files in "vehiculos" use deprecated functions ¿Que diablos es ese error? Edit: No es urgente, no afecta nada pero quisiera saber
-
Ha conque era eso... yo entendí otra cosa, pero igual ya lo solucione. Gracias igual
-
¿Puedo hacer esto? --> if ( getElementModel ( player ) == 201 , 23 , 25 and seat == 0 ) then ¿o sin espacios? if ( getElementModel ( player ) == 201,23,25 and seat == 0 ) then
-
Perdón por la pregunta, pero...¿cuales?
-
no se sienta
-
Tengo otra pregunta. ¿Se pueden agregar skins bloqueados? por ejemplo si yo quiero bloquear el 201,23 y 25 ¿se puede?
-
setPedAnimation(ped1, "INT_OFFICE", "OFF_Sit_Idle_Loop") esa es la animación de sentarse
-
Gracias. ¿Y como hago para que el ped haga la acción de sentarse?
-
function makePed() ped1 = createPed ( 211, -2494.5, 2511.89, 18.5 ) setPedRotation(ped1, 270) setPedAnimation(ped1, "INT_OFFICE", "OFF_Sit_Idle_Loop") end addEventHandler ( "onResourceStart", getResourceRootElement(), makePed ) Ya lo arregle pero no ejecuta la acción de sentarse ayudaaa
-
Hola amigos, intente crear un ped, darle una animación y un skin pero no crea el ped el resource tengo esto function makePed() ped1 = createPed(211, -2494.5, 2511.89, 18.5) setPedRotation(ped1, 270) setPedAnimation( ped1, "FOOD", "FF_Sit_Loop") end
-
Hola, queria agradecer a todos los que me ayudaron a hacer mi "super gamemode real life" (si así podemos decirle) se que hice irritar a mucha gente con mis preguntas que de algún modo u otro fueron estúpidas y casi irrelevantes, pero me ayudaron y eso es admirable. Gracias
-
Le sacas el animo de hacer algo a cualquier persona. En fin, lo intente poner entre la linea 5 y 6, 7 y 9 pero no funcionan en ninguno de las 2
-
No me funciona eso ¿en que linea lo pondría?
-
1º ¿Hay alguna manera de remplazar el "teamsay" por otro nombre que diga "Radio"? por favor denmen ejemplos estoy buscando desde hace mucho hacer este resource. me dijeron que era muy complicado por eso no me anime a hacerlo 2º crossMissionStartMarker = createMarker (-2515.83,2353.17,3.98,"cylinder",1.5,0,255,255) addEventHandler ("onMarkerHit", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then outputChatBox ("Prueba de manejo.", player, 127, 0, 255, false) outputChatBox (" Bienvenido a la prueba de manejo", player, 255, 255, 255, false) outputChatBox (" Por 100$ podras acceder a un circuito de prueba", player, 255, 255, 255, false) outputChatBox (" Podras ganar 500$ como ayuda para tu auto si pasas la prueba", player, 255, 255, 255, false) outputChatBox (" Para comenzar di /startprueba", player, 255, 255, 255, false) end end) addEventHandler ("onMarkerLeave", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then outputChatBox ("Te has ido de la prueba.", player, 127, 0, 255, false) end end) addCommandHandler ("startprueba", function(player, command) if (isElementWithinMarker (player, crossMissionStartMarker)) and (getPlayerMoney (player) >= 500) then takePlayerMoney (player, 500) outputChatBox ("Mission started!", player, 255, 0, 0, false) local missionVehicle = createVehicle(410, -2506.69, 2347.30, 4.69, 0, 0, 180) setElementInterior (missionVehicle, 0) setElementDimension (missionVehicle, 10) setElementInterior (player, 0) setElementDimension (player, 10) warpPedIntoVehicle (player, missionVehicle) showPlayerHudComponent (player, "ammo", false) showPlayerHudComponent (player, "area_name", false) showPlayerHudComponent (player, "armour", false) showPlayerHudComponent (player, "breath", false) showPlayerHudComponent (player, "clock", false) showPlayerHudComponent (player, "health", false) showPlayerHudComponent (player, "money", false) showPlayerHudComponent (player, "radar", false) showPlayerHudComponent (player, "vehicle_name", false) showPlayerHudComponent (player, "weapon", false) setTimer (onEndMission, 120000, 1, player, getPedOccupiedVehicle (player)) end end) function onEndMission (player, vehicle) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (vehicle) == 410) then destroyElement (vehicle) showPlayerHudComponent (player, "ammo", true) showPlayerHudComponent (player, "area_name", true) showPlayerHudComponent (player, "armour", true) showPlayerHudComponent (player, "breath", true) showPlayerHudComponent (player, "clock", true) showPlayerHudComponent (player, "health", true) showPlayerHudComponent (player, "money", true) showPlayerHudComponent (player, "radar", true) showPlayerHudComponent (player, "vehicle_name", true) showPlayerHudComponent (player, "weapon", true) setElementDimension (player, 0) setTimer (setElementInterior, 500, 1, player, 0) setTimer (setElementPosition, 1500, 1, player, -2515.75,2356.14,4.98) setTimer (setPedRotation, 0, 1, player, 0) outputChatBox ("La prueba ha terminado", player, 255, 0, 0, false) end end addEventHandler ("onVehicleExit", getRootElement(), function(player, seat, jacked) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (source) == 410) then setTimer (warpPedIntoVehicle, 500, 1, player, source) outputChatBox ("Oops! you fall off!", player, 255, 0, 0, false) end end) addEventHandler ("onMarkerHit", getRootElement(), function(hitElement, matchingDimension) if (getElementType (hitElement) == "player") and (matchingDimension == true) and (getElementDimension (hitElement) == 10) and (getElementInterior (hitElement) == 0) and (getElementDimension (hitElement) == 10) then givePlayerMoney (hitElement, 100) playSoundFrontEnd (hitElement, 43) local x,y,z = getElementPosition (source) setTimer (createNewStuntMarker, 20000, 1, x,y,z) destroyElement(source) end end) function createNewStuntMarker(x,y,z) local coolMarker = createMarker (x,y,z,"corona",0.5,101,0,254,255,getRootElement()) setElementInterior (coolMarker, 0) setElementDimension (coolMarker, 10) end addEventHandler ("onPlayerQuit", getRootElement(), function() if (getElementDimension (source) == 10) then setElementInterior (player, 0) setElementPosition (player, -2515.75,2356.14,4.98) end end) ¿Hay alguna manera de evitar que los usuarios que tengan otro skin que no sea el 25 no puedan hacer la prueba que esta en el .lua? PD: me di cuenta que lo postie mal
-
https://community.multitheftauto.com/in ... ls&id=1305 [url=https://community.multitheftauto.com/index.php?p=resources&s=details&id=]https://community.multitheftauto.com/in ... etails&id=[/url]1305
-
¿eso donde iría? ¿que argumento suplanta?
-
¿Como puedo pasar todo esto a client-side? y ademas ¿como hacer que el marker del principio solamente lo puedan usar los que tengan el skin 25? y si alguien tiene otro skin no lo deje y le aparezca un mensaje de: Ya has hecho la prueba crossMissionStartMarker = createMarker (-2515.83,2353.17,3.98,"cylinder",1.5,0,255,255) addEventHandler ("onMarkerHit", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then outputChatBox ("Prueba de manejo.", player, 127, 0, 255, false) outputChatBox (" Bienvenido a la prueba de manejo", player, 255, 255, 255, false) outputChatBox (" Por 100$ podras acceder a un circuito de prueba", player, 255, 255, 255, false) outputChatBox (" Podras ganar 500$ como ayuda para tu auto si pasas la prueba", player, 255, 255, 255, false) outputChatBox (" Para comenzar di /startprueba", player, 255, 255, 255, false) end end) addEventHandler ("onMarkerLeave", getRootElement(), function(player) if (source == crossMissionStartMarker) and (getElementType (player) == "player") then outputChatBox ("Te has ido de la prueba.", player, 127, 0, 255, false) end end) addCommandHandler ("startprueba", function(player, command) if (isElementWithinMarker (player, crossMissionStartMarker)) and (getPlayerMoney (player) >= 500) then takePlayerMoney (player, 500) outputChatBox ("Mission started!", player, 255, 0, 0, false) local missionVehicle = createVehicle(410, -2506.69, 2347.30, 4.69, 0, 0, 180) setElementInterior (missionVehicle, 0) setElementDimension (missionVehicle, 10) setElementInterior (player, 0) setElementDimension (player, 10) warpPedIntoVehicle (player, missionVehicle) showPlayerHudComponent (player, "ammo", false) showPlayerHudComponent (player, "area_name", false) showPlayerHudComponent (player, "armour", false) showPlayerHudComponent (player, "breath", false) showPlayerHudComponent (player, "clock", false) showPlayerHudComponent (player, "health", false) showPlayerHudComponent (player, "money", false) showPlayerHudComponent (player, "radar", false) showPlayerHudComponent (player, "vehicle_name", false) showPlayerHudComponent (player, "weapon", false) setTimer (onEndMission, 120000, 1, player, getPedOccupiedVehicle (player)) end end) function onEndMission (player, vehicle) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (vehicle) == 410) then destroyElement (vehicle) showPlayerHudComponent (player, "ammo", true) showPlayerHudComponent (player, "area_name", true) showPlayerHudComponent (player, "armour", true) showPlayerHudComponent (player, "breath", true) showPlayerHudComponent (player, "clock", true) showPlayerHudComponent (player, "health", true) showPlayerHudComponent (player, "money", true) showPlayerHudComponent (player, "radar", true) showPlayerHudComponent (player, "vehicle_name", true) showPlayerHudComponent (player, "weapon", true) setElementDimension (player, 0) setTimer (setElementInterior, 500, 1, player, 0) setTimer (setElementPosition, 1500, 1, player, -2515.75,2356.14,4.98) setTimer (setPedRotation, 0, 1, player, 0) outputChatBox ("La prueba ha terminado", player, 255, 0, 0, false) end end addEventHandler ("onVehicleExit", getRootElement(), function(player, seat, jacked) if (getElementDimension (player) == 10) and (getElementInterior (player) == 0) and (getElementModel (source) == 410) then setTimer (warpPedIntoVehicle, 500, 1, player, source) outputChatBox ("Oops! you fall off!", player, 255, 0, 0, false) end end) addEventHandler ("onMarkerHit", getRootElement(), function(hitElement, matchingDimension) if (getElementType (hitElement) == "player") and (matchingDimension == true) and (getElementDimension (hitElement) == 10) and (getElementInterior (hitElement) == 0) and (getElementDimension (hitElement) == 10) then givePlayerMoney (hitElement, 100) playSoundFrontEnd (hitElement, 43) local x,y,z = getElementPosition (source) setTimer (createNewStuntMarker, 20000, 1, x,y,z) destroyElement(source) end end) function createNewStuntMarker(x,y,z) local coolMarker = createMarker (x,y,z,"corona",0.5,101,0,254,255,getRootElement()) setElementInterior (coolMarker, 0) setElementDimension (coolMarker, 10) end addEventHandler ("onPlayerQuit", getRootElement(), function() if (getElementDimension (source) == 10) then setElementInterior (player, 0) setElementPosition (player, -2515.75,2356.14,4.98) end end)
