-
Posts
44 -
Joined
-
Last visited
Posts posted by MYSOTO
-
-
function funk (source) setElementFrozen(source, true) -- Freeze player Movement bindKey (source, "K", "up", desbloquear) --Add key to desbloquear funtion next:giveItem(source, "Chocolate", 1) end function desbloquear (source) setElementFrozen(source, false) -- desbloquea el movimiento del jugador end
-
you dont have resource "Vehicles_auxiliar", you need put the resource name vehicles_auxiliar in you resources folder
-
Remplace this line:
if isObjectInACLGroup( "user." .. p[ player ].username, aclGetGroup( value.aclGroup ) ) and value.nametagColor then
For this:
if (isObjectInACLGroup( "user." .. p[ player ].username, aclGetGroup( groups[key].aclGroup ) ) and groups[key].nametagColor) then
You can test this -
Hello, I come to suggest that it would be good to put the particles inside the mta map editor, I know that there are already functions to create particles but it would be nice and flexible that these can be added from the editor to avoid the user having to add them outside of it itself, this would save players time
-
-
I would use this, to calculate the position of the lights or vehicle components, then you could use the export function to create the light in the car
https://wiki.multitheftauto.com/wiki/GetVehicleComponentPosition
exports.dynamic_lighting:createPointLight( )
-
you can add new groups here in the acl file MTA San Andreas 1.5\server\mods\deathmatch\acl.xml
<group name="military">
<acl name="military"></acl>
<object name="user.pepe"></object> - ---USERS IN ACL PEPE
</group>, Below is an example of how to add military to your code
function chatbox( text, type) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#08BCD0~| Admin |~ #1AEBC1 " .. getPlayerName ( source ) .. ":#00FF36 " .. text, getRootElement(), r, g, b, true ) outputServerLog("CHAT: [Admin] " .. getPlayerName ( source ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Moderator")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#EB064F~| Moderator |~#1AEBC1 " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) outputServerLog("CHAT: [Moderator] " .. getPlayerName ( source ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("military")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#08BCD0~| military |~ #1AEBC1 " .. getPlayerName ( source ) .. ":#00FF36 " .. text, getRootElement(), r, g, b, true ) outputServerLog("CHAT: [military] " .. getPlayerName ( source ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("SuperModerator")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#EB064F~|> SMOD <|~##1AEBC1 " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) outputServerLog("CHAT: [SMOD] " .. getPlayerName ( source ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Diamante")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#EB064F~|> VIP Diamante <|~##1AEBC1 " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) outputServerLog("CHAT: [VIP DIAMANTE] " .. getPlayerName ( source ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Gold")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#EB064F~|> VIP GOLD <|~##1AEBC1 " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) outputServerLog("CHAT: [VIP GOLD] " .. getPlayerName ( source ) .. ": " .. text) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Soporte")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#08BCD0~| Sop |~#1AEBC1 " .. getPlayerName ( source ) .. ":#FF0005 " .. text, getRootElement(), r, g, b, true ) outputServerLog("CHAT: [sop] " .. getPlayerName ( source ) .. ": " .. text) elseif type == 0 then cancelEvent ( ) local r, g, b = getPlayerNametagColor(source) outputChatBox ( " " .. getPlayerName ( source ) .. ":#FFFFFF " .. text, getRootElement(), r, g, b, true ) outputServerLog( "CHAT: " .. getPlayerName ( source ) .. ": " .. text ) end end addEventHandler("onPlayerChat", getRootElement(), chatbox)
-
Remember to have saved the file in case it is not saved, possibly you did not restart it in the console, it may be the code editor, it also happens to me that sometimes it is bugea I recommend you restart the program or change it for another editor, I recommend atom or sublimetext to edit code -
MTA San Andreas 1.5\MTA\cgui\images this is the path, there is the mta splashart inside its respective folder the file is called background.png
-
You can do this with database, I would use the GetPedWeapon, takeAllWeapons and giveWeapon functions. You could use setElementData to manipulate the mta database below I leave you an example to remove all the weapons when doing the command.
------server.lua-----
function tkw ( source ) takeAllWeapons ( source ) end addCommandHandler ( "takeweapon", tkw )
-
Podrías usar:
setWorldSoundEnabled - para deshabilitar el sonido base que deseas cambiar
y PlaySound3D para poner el sonido (real) en tu caso depende si quieres cambiar el sonido de un vehículo o armas puedes usar onClientKey para poner
el sonido en una tecla por ejemplo al presionar click
-
This is a copy for my rs: https://community.multitheftauto.com/?p=resources&s=details&id=16529
My rs : https://community.multitheftauto.com/?p=resources&s=details&id=16207
he copy my idea
DENIED - it's not a copy, he used his own code. Ideas cannot be protected.
-
for i, thePlayer in ipairs ( getElementsByType( "player" ) ) do
if ( sasori ~= thePlayer ) then
local px, py, pz = getElementPosition( thePlayer )
local tx, ty, tz = getElementPosition( player )
if ( getDistanceBetweenPoints3D( px, py, pz, tx, ty, tz ) <= 50 ) then
setElementHealth( thePlayer, ( getElementHealth( sasori ) - 80 )
end
end
endHola tengo ese pequeño script pero quiero que le quite vida a los que están cerca del jugador pero no al jugador porfa tengo esa duda
-
hello I have a problem rather a doubt someone knows how it could be done to make some parts of the body of the player, I know it is done with shaders but someone could pass me a script or some way of doing it since I do not know anything about shaders or pass an editable script, please
for example:
-
Firstly I recommend using attachElements which is optimal, so you could use this function detachElements and then destroyElement so that it does not stay in the player and if that doesn't work; instead use bone attach, which uses best attach element is more easy
-
Hola bueno quería pedirles si me pueden ayudar con este script que ise lo que pasa es que ya funciona todos los botones y eso pero al momento de logearme me sale que esta mal la contraseña o no existe y al momento de registrarme me sale que ya existe queria saber si me ayudan a repararlo no se si es un problema de algun evento grid o algo por favor llevo todo el dia intentando y no me sale que podra ser el error
cliente:
GUIEditor = { button = {}, window = {}, edit = {}, staticimage = {}, label = {} } zero = "" two = "" GUIEditor.window[1] = guiCreateWindow(0.38, 0.31, 0.22, 0.32, "Login", true) guiWindowSetSizable(GUIEditor.window[1], false) showCursor(true) logon = guiCreateButton(0.03, 0.82, 0.46, 0.15, "Login", true, GUIEditor.window[1]) guiSetFont(logon, "default-bold-small") GUIEditor.button[2] = guiCreateButton(0.52, 0.82, 0.46, 0.15, "Registro", true, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") GUIEditor.staticimage[1] = guiCreateStaticImage(0.02, 0.06, 0.96, 0.26, ":guieditor/images/plus.png", true, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(0.41, 0.34, 0.20, 0.08, "Usuario", true, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[1], "center") GUIEditor.label[2] = guiCreateLabel(0.41, 0.55, 0.20, 0.08, "contraseña", true, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) guiLabelSetVerticalAlign(GUIEditor.label[2], "center") GUIEditor.edit[1] = guiCreateEdit(0.28, 0.42, 0.47, 0.11, "", true, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(0.28, 0.65, 0.47, 0.10, "", true, GUIEditor.window[1]) guiEditSetMasked ( password, true ) usuario = guiGetText ( GUIEditor.edit[1] ) guiGetText ( GUIEditor.edit[2] ) function onregister ( ) triggerServerEvent("rg",getLocalPlayer(),usuario,contra) end addEventHandler ( "onClientGUIClick", GUIEditor.button[2], onregister) function onlogin ( ) triggerServerEvent("lg",getLocalPlayer(),usuario,contra) end addEventHandler ( "onClientGUIClick", logon, onlogin) function ocu ( ) guiSetVisible( GUIEditor.window[1], false ) showCursor(false) end addEvent ( "ocultar", true ) addEventHandler ( "ocultar", getLocalPlayer(), ocu) button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "OK", true ) --Create an edit box and define it as "editBox". editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, "", true ) guiEditSetMaxLength ( editBox, 128 ) --the max chatbox length is 128, so force this --setup our function to output the message to the chatbox function outputEditBox () local text = guiGetText ( editBox )--get the text from the edit box outputChatBox ( contra ) --output that text end addEventHandler ( "onClientGUIClick", button, outputEditBox )
y servidor
function rg(usuario,contra) if (addAccount(usuario,contra)) then triggerClientEvent(source,"ocultar",source) logIn (source,getAccount(usuario,contra),contra) else outputChatBox("la cuenta ya existe") end end addEvent("rg",true) addEventHandler("rg",getRootElement(), rg) function lg(usuario,contra) cuenta = getAccount(usuario,contra) if (cuenta) then triggerClientEvent(source,"ocultar",source) logIn (source,getAccount(usuario,contra),contra) outputChatBox("te logeaste correctamente") setCameraTarget(source) else outputChatBox("la cuenta no existe o la contraseña esta mal") end end addEvent("lg",true) addEventHandler("lg",getRootElement(), lg) addEventHandler ( "onPlayerJoin", getRootElement(),function () triggerClientEvent(source,"abrir",source) end) function setCameraOnPlayerJoin() -- slowly fade the camera in to make the screen visible fadeCamera(source, true, 5) -- set the player's camera to a fixed position, looking at a fixed point setCameraMatrix(source, -1568, 540, 80, -400000, 10000000, 99.881813049316) end addEventHandler("onPlayerJoin", root, setCameraOnPlayerJoin) addEventHandler ( "onResourceStart", getRootElement(), setCameraOnPlayerJoin )
-
hmmm donde estan x y z ponle digamos creo que la de la espalda es 2 donde dice x,y,z ponle x,y,z+2 o ve calculando osea xyz son las cordenadas
-
-
On 12/12/2017 at 00:12, MadnessReloaded said:
Vale, entonces necesitas:
function funcion(jugador,comando,parametro1) end addCommandHandler ("modopasivo",funcion)--asigna la funcion al comando "modopasivo"
Dentro de esta funcion mira si está activado y usa
setElementData (jugador,"modoPasivo",true) --Define al jugador si está en modo pasivo, true si lo está, false si no.
para poder identificar al jugador con el modo pasivo.
Ahora, para desactivar la capacidad de disparar usa:
addEventHandler ("onElementDataChange",root,function(nombre) --Ocurre cuando se le hace un setElementData a alguien local modopasivo = getElementData (source,"modoPasivo") --Mira a ver si el modoPasivo está activado if nombre == "modoPasivo" then --Si el elementData que se ha cambiado es modoPasivo... if modopasivo then -- y modopasivo está activado toggleControl (jugador,"fire",false) --desactiva la capacidad de disparar. else --si no está activado toggleControl (jugador,"fire",true) --activa la capacidad de disparar end end end) --Mirate la lista de control names en la wiki de MTA
Y por último
function invencibilidadPasivo (atacante) if getElementData (source,"modoPasivo") then --¿Está en modo pasivo? cancelEvent() --Sí, pues cancela el daño. end end addEventHandler ("onClientPlayerDamage",root,invencibilidadPasivo) --Asigna la funcion a solo cuando un jugador se daña --ESTA FUNCIÓN ES DE CLIENTE
gracias bro me ayudaste mucho
-
hola es que en mi server me gustaría poner un rs de modo pasivo pero que si el jugador activo el modo no pueda disparar y tenga que desactivarlo para poder disparar ademas que cuando este activado tenga inmortalidad
-
On 22/11/2017 at 23:54, Uknown. said:
function playerTargetCheck ( ) for i, thePlayer in ipairs ( getElementsByType( "player" ) ) do if ( player ~= thePlayer ) then local px, py, pz = getElementPosition( thePlayer ) local tx, ty, tz = getElementPosition( player ) if ( getDistanceBetweenPoints3D( px, py, pz, tx, ty, tz ) <= 50 ) then setElementHealth( player, ( getElementHealth( player ) - 50 < 0 ) and 0 or getElementHealth( player ) - 50 ) end end end end addCommandHandler ( "sharigano", playerTargetCheck )
gracias me ayudaste mucho xddd
-
22 hours ago, [A]kame said:
Revisa este tiene una distancia de 20m parece.
cual?
-
Hola tengo este pequeño script y lo que pasa que no se porque se bugea y no toma solo a los jugadores que les apunto o están cerca sino también toma a lejanos me gustaría saber como podría hacer que a una distancia corta solo le baje vida a los jugadores cercanos pero no al reproductor
function playerTargetCheck ( )
local target
for i, thePlayer in ipairs ( getElementsByType("player") ) do -- iterate over all players
target = getPedTarget ( thePlayer ) -
if ( target ) then -- if there was a target
local health = getElementHealth(target)
setElementHealth (target, health - 50 )end
end
end
addCommandHandler ( "sharigano", playerTargetCheck ) -
1 hour ago, MystoganScripter said:
[help!]I can't configure item selection.
in Scripting
Posted
You can use this