Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. -- client side: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(216,165,349,283,"GuiDeathWarping",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Button[1] = guiCreateButton(10,219,205,47,"DeathWarp",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[1],"sa-header") GUIEditor_Image[1] = guiCreateStaticImage(28,33,280,116,"images/logobkz.png",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(39,146,272,28,"Server y GUI Creada por ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],0, 255, 0) guiSetFont(GUIEditor_Label[1],"clear-normal") addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], function ( ) triggerServerEvent ( "deathWarp", localPlayer ) end ,false ) -- server side: addEvent ( "deathWarp", true ) addEventHandler ( "deathWarp", root, function ( ) spawnPlayer ( source, 0, 0, 5 ) -- Change 0, 0, 5 to your spawn coordinates. end )
  2. You want to spawn the player when he presses the button "DeathWarp"?
  3. Te di las funciones que me pediste, ahora estudialas y averigua como crear lo que vos queres.
  4. createObject createExplosion getCameraMatrix getWorldFromScreenPosition processLineOfSight getDistanceBetweenPoints3D
  5. mapEdit = guiCreateEdit(140,339,117,26,"date xml",false,MemoPanel) elseif (source == mapbott7) then -- botton for create xml with name from edit exportDate = guiGetText(mapEdit) exportText = guiGetText(myMemo) local FinalText = xmlCreateFile(exportDate ..".xml",exportText) xmlSaveFile ( FinalText ) xmlUnloadFile ( FinalText )
  6. That's the key "enter", not the control name, they are not the same thing.
  7. Vos no queres que yo te ayude, vos queres que yo lo haga por vos.
  8. There's no such control "enter", you've just forgot about the "_exit" .
  9. Podes estudiar ese recurso y tambien el interstate69. https://community.multitheftauto.com/index.php?p= ... ails&id=32
  10. You're welcome. About that, you must use guiSetInputEnabled to disable the binds and so on.
  11. Eso no es tan facil, existe un recurso que es un avion tipo el Call of Duty que podes disparar desde los costados. https://community.multitheftauto.com/index.php?p= ... ls&id=3919
  12. function memo () myMemo = guiCreateMemo(19,58,360,275,"",false,MemoPanel) --------------------------------------------------------------------------- elseif (source == mapbott2) then -- botton open memo memo () -- work LoadText() -- work elseif (source == mapbott6) then -- botton close memo SaveText() -- work function LoadText() local mapText = xmlLoadFile("img/maptest.xml") if (mapText) then local value = xmlNodeGetValue(mapText) guiSetText(myMemo, tostring(value)) xmlUnloadFile(mapText) end end function SaveText() local mapText = xmlLoadFile("img/maptest.xml") if (mapText) then xmlNodeSetValue(mapText, guiGetText(myMemo)) xmlSaveFile(mapText) xmlUnloadFile(mapText) end end You have the file "resourceName/img/maptest.xml" at downloaded client side folder, right?
  13. --------------------------------------------------------------------------------- -- -- Nitro shader -- -- --------------------------------------------------------------------------------- addEventHandler("onClientResourceStart",resourceRoot, function() nitroShader = dxCreateShader("nitro.fx") setTimer(updateNitroColor,1000,1,0,255,0) end) -- This function will set the new color of the nitro function updateNitroColor(r,g,b) if nitroShader then if r and g and b then engineApplyShaderToWorldTexture (nitroShader,"smoke") dxSetShaderValue (nitroShader, "gNitroColor", r/255, g/0, b/0 ) end end end -- This function will reset the nitro back to the original function resetNitroColor() if nitroShader then engineRemoveShaderFromWorldTexture(nitroShader,"smoke") end end -- Example command use addCommandHandler("nitro", function(command,r,g,b) if r and g and b then local r,g,b = tonumber(r),tonumber(g),tonumber(b) if r <= 255 and g <= 255 and b <= 255 then updateNitroColor(r,g,b) outputChatBox("Nitro color updated!",255,255,255,true) else outputChatBox("Colors must be between 0 and 255",255,255,255,true) end else resetNitroColor() outputChatBox("Nitro color reset to original!",255,255,255,true) end end)
  14. We don't help people with stolen scripts. Topic locked.
  15. -- client side: local sMessage = '' function fStart(sText) sMessage = sText end function fDraw() if sMessage ~= '' then dxDrawText("message :", 17.0, 189.0, 61.0, 206.0, tocolor(255, 0, 0, 255), 1.0, "default-bold", "left", "top", false, false, false) dxDrawText(sMessage, 61.0, 189.0, 264.0, 226.0, tocolor(255, 225, 225, 255), 1.0, "default-bold", "left", "top", false, false, false) end end addEvent("new", true) addEventHandler("new", root, fStart) addEventHandler("onClientRender", root, fDraw) -- server side: local restriction = {} addCommandHandler("roll", function(player, cmd) local playerName = getPlayerName ( player ) if restriction[player] then local sMessage = "You have to wait 30 seconds" outputChatBox(sMessage, player, 255, 0, 0) else restriction[player] = true setTimer(restrictionEnd, 30000, 1, player) local randomroll = math.random(1, 3000) local roller = math.random(1, 4) local weapon = math.random(1, 40) if ( roller == 1 ) then givePlayerMoney(player, randomroll) local sMessage = playerName .. '#FFFF00 roll and wins ' .. randomroll .. ' !' triggerClientEvent("new", root, sMessage) elseif ( roller == 2 ) then local sMessage = playerName .. ' roll and is now changed the Weapon ' .. getWeaponNameFromID ( weapon ) .. '!' giveWeapon(player, weapon) triggerClientEvent("new", root, sMessage) else local sMessage = "Good luck next time!" outputChatBox ( sMessage, player, 255, 0, 0) end end end ) function restrictionEnd(player) restriction[player] = nil end
  16. Castillo

    Col Shape

    local uRadar = createRadarArea( -466.317, -468.559, -150, -90, 255, 255, 0, 175 ) local uRectangle = createColRectangle( -624, -563, 158, 95 ) function fColshapeManager ( uElement, bDim ) if getElementType( uElement ) == 'player' then outputChatBox( eventName == 'onColShapeHit' and 'You entered the zone. Welcome!' or eventName == 'onColShapeLeave' and 'You left the zone. Bye bye!', uElement, 0, 255, 0 ) end end addEventHandler ( 'onColShapeHit', uRectangle, fColshapeManager ) addEventHandler ( 'onColShapeLeave', uRectangle, fColshapeManager ) Your colshape wasn't the same size as the radar area, must be because of the negative values.
  17. Castillo

    [solved]

    You want to make GUI-label to move it from left to right? If so, I suggest to the client animation library by arc_. --[[ Client animation library by arc_ Version 1.0.0 Licence ---------------- You are free to modify this file and redistribute it with your changes. However, always mention that you changed it (and eventually what changes you made) and keep the original author, version number and licence intact. Selling this script or a derivative of it is not allowed. Documentation ---------------- Terminology - Animation: a sequence of phases that act on one or more elements and follow each other sequentially in time. Multiple animations can be running at the same time. All defined animations run in parallel. An animation is in fact one phase with several subphases (see below), with animation specific functions available. - Phase: a part of an animation sequence. A phase consists of a paramater that linearly goes from a given starting value to a given ending value, over the specified amount of time, and is applied to one certain element. While a phase is running, its callback function will be called onClientRender with the following arguments: phase.fn(element elem, float param, table phase) Specifying time and callback function is optional. If no time is specified but a function is, phase.fn(elem) will be called once. If no function is specified but a time is, the phase consists of simply waiting during that time, doing nothing. A phase can be run once, repeated multiple times or loop infinitely. Phases can also contain phases. In that case the parent phase consists of completing all child phases, in order. This allows you to f.e. make an element move left and right continuously: define a phase for moving it to the left, followed by a phase for moving it back to the right, and encapsulate these two phases in a parent phase that loops forever. Phases can be nested to arbitrary depth. The element a subphase works on is inherited from its parent phase (or, if the parent phase doesn't specify an element, from the grandparent, etc). Definition of a phase A phase is simply a table containing properties and (optionally) subphases. Available phase properties are: (the values for the properties are examples, not default values) phase = { from = 0, -- the starting value of the parameter to = 1, -- the ending value of the parameter [time = 1000,] -- the time (in ms) in which to go from start to end [fn = callback,] -- the function to call on each frame update [repeats = 5,] -- how many times to run this phase before going on to -- the next. defaults to 1 [subphase1,] -- optional subphases. if one or more of these are included, [subphase2,] -- only the "repeats" property is valid for this parent phase ... } Available functions anim = Animation.create(elem, phase1, phase2, ...) Creates and returns a new animation. This means nothing more than creating a new phase, putting the specified phases in it as subphases, and making the functions of the Animation class available to it. Once an animation is created, it is not yet running. anim = Animation.createAndPlay(elem, phase1, phase2, ...) Creates a new animation and immediately starts playing it. anim = Animation.createNamed(name, elem, ...) If an animation with the specified name exists, returns that animation. Otherwise creates a new named animation. You can look the animation up again later with Animation.getNamed(name). anim = Animation.createNamedAndPlay(name, elem, ...) Self explanatory. anim = Animation.getNamed(name) Returns the animation with the specified name if it exists, false otherwise. anim:play() Start playing a newly created animation or resume a paused animation. anim:pause() Pauses the animation. Resume it later with anim:play() or delete it with anim:remove(). anim:remove() Deletes the animation completely. It can not be resumed anymore. anim:isPlaying() Returns true if the animation is currently playing, false if not. Animation.playingAnimationsExist() Returns true if there is any animation that is currently playing. anim:addPhase(phase3), phase2:addPhase(phase3) Appends a new subphase to the animation or phase. Can be done while the animation is playing. Note that to be able to use phase2:addPhase(), phase2 first has to be processed (default values filled in, made part of the Phase class) by being passed as an argument to Animation.create[AndPlay] or addPhase. Examples Fade in a picture: local pict = guiCreateStaticImage(...) Animation.createAndPlay(pict, { from = 0, to = 1, time = 2000, fn = guiSetAlpha }) Fade in a picture using a preset (for more presets, see the end of this file): local pict = guiCreateStaticImage(...) Animation.createAndPlay(pict, Animation.presets.guiFadeIn(2000)) Move a label to the right while fading it in: local label = guiCreateLabel(10, 100, 150, 20, 'Test', false) Animation.createAndPlay(label, Animation.presets.guiMove(200, 100, 2000)) Animation.createAndPlay(label, Animation.presets.guiFadeIn(2000)) Move a label left and right forever, without presets: function guiSetX(elem, x) local curX, curY = guiGetPosition(elem, false) guiSetPosition(elem, x, curY, false) end local label = guiCreateLabel(10, 100, 150, 20, 'Test', false) Animation.createAndPlay( label, { repeats = 0, { from = 10, to = 200, time = 2000, fn = guiSetX }, { from = 200, to = 10, time = 2000, fn = guiSetX } } ) ]]-- Phase = {} Phase.__index = Phase Animation = setmetatable({}, { __index = Phase }) Animation.__index = Animation Animation.collection = {} function Animation.create(elem, ...) local anim = setmetatable({ elem = elem, ... }, Animation) anim:_setup() return anim end function Animation.createAndPlay(elem, ...) local anim = Animation.create(elem, ...) anim:play() return anim end function Animation.createNamed(name, elem, ...) local anim = Animation.getNamed(name) or Animation.create(elem, ...) anim.name = name return anim end function Animation.createNamedAndPlay(name, elem, ...) local anim = Animation.createNamed(name, elem, ...) anim:play() return anim end function Animation.getNamed(name) local i, anim = table.find(Animation.collection, 'name', name) return i and anim end function Animation:isPlaying() return self.playing or false end function Animation.playingAnimationsExist() return table.find(Animation.collection, 'playing', true) and true end function Animation:play() if self.playing then return end if not table.find(Animation.collection, self) then table.insert(Animation.collection, self) end if not Animation.playingAnimationsExist() then addEventHandler('onClientRender', getRootElement(), updateAnim) end self.playing = true end function Animation:pause() self.playing = false if not Animation.playingAnimationsExist() then removeEventHandler('onClientRender', getRootElement(), updateAnim) end end function Animation:remove() table.removevalue(Animation.collection, self) if not Animation.playingAnimationsExist() then removeEventHandler('onClientRender', getRootElement(), updateAnim) end self.playing = false end function Phase:_setup(parent) self.parent = parent if self[1] then for i,phase in ipairs(self) do if type(phase) == 'function' then phase = { fn = phase } self[i] = phase end setmetatable(phase, Phase) phase:_setup(self) end self.curphase = 1 elseif self.time then self.from = self.from or 0 self.to = self.to or 1 self.speed = (self.to - self.from) / self.time end self.repeats = self.repeats
  18. Vehiculos con armas, o poder disparar desde el vehiculo? Si es lo segundo, entonces inicia el recurso "realdriveby".
  19. Castillo

    How ?

    You can ask them how they'd it maybe.
  20. Castillo

    How ?

    If you want to translate player name to another language, then I don't know if it's possible.
×
×
  • Create New...