Jump to content

KnoxScripter

Members
  • Posts

    38
  • Joined

  • Last visited

Everything posted by KnoxScripter

  1. 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
  2. Use this https://community.multitheftauto.com/index.php?p=resources&s=details&id=11265
  3. 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( )
  4. 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)
  5. 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
  6. 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
  7. 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 )
  8. 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
  9. 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.
  10. 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 end Hola 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
  11. 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: https://www.youwwwube.com/watch?v=sOTDHReX2rs
  12. 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
  13. 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 )
  14. 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
  15. usa esto https://community.multitheftauto.com/index.php?p=resources&s=details&id=2540
  16. 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
  17. 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 )
  18. If I use triggerclientvent you think it will look server side
  19. Sorry I already put it in the correct language
  20. Hi believe this rs what happens is that the effects are only seen on the side of the user osea client and the others can not see it I would like to help me to turn it server side x, y, z = getElementPosition(player) fx2 = createEffect("flame", x, y, z-1000) fx3 = createEffect("flame", x, y, z-1000) fx4 = createEffect("flame", x, y, z-1000) function fire() setEffectDensity(fx2, 2) setEffectSpeed(fx2, 1) setObjectScale ( fx2, 0.5) attachElements (fx,localPlayer, 0, 0, 5 ) setWeaponProperty(8, "damage", 100) end addCommandHandler("fire", fire) function disableMinigunOnSwitch ( player, prevSlot, newSlot ) if getPedWeapon(player(),newSlot) == 8 then --if the switched weapon is the minigun exports.bone_attach:attachElementToBone(fx2,player,12,0,0,0.1,0,0,0) exports.bone_attach:attachElementToBone(fx3,player,12,-1,0,0.1,0,0,0) exports.bone_attach:attachElementToBone(fx4,player,12,-0.5,0,0.1,0,0,0) else --if it isnt the minigun exports.bone_attach:detachElementFromBone(fx) exports.bone_attach:detachElementFromBone(fx2) exports.bone_attach:detachElementFromBone(fx3) exports.bone_attach:detachElementFromBone(fx4) setElementPosition ( fx2, x, y, z-1000 ) setElementPosition ( fx3, x, y, z-1000 ) setElementPosition ( fx4, x, y, z-1000 ) end end addEventHandler ( "onClientPlayerWeaponSwitch", getRootElement(), disableMinigunOnSwitch ) function stopMinigunDamage ( attacker, weapon, bodypart ) if ( weapon == 8 ) then --if the weapon used was the minigun createFire(x, y, z, 2) --cancel the event end end addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage )
×
×
  • Create New...