Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Maybe because you never used it? function Break(player) if (not isPedInVehicle(player)) then return end local vehicle = getPedOccupiedVehicle(player) local handling = getVehicleHandling(vehicle) setElementData(vehicle, "slowing", vehicle) setVehicleHandling(vehicle, "brakeDeceleration", 20.08) setVehicleHandling(vehicle, "tractionMultiplier", 2.08) setTimer (Breakoff, 5000, 0, vehicle) end addCommandHandler ( "break", Break ) function Breakoff(vehicle) local handling = getElementData(vehicle, "slowing") setVehicleHandling(vehicle, "brakeDeceleration", slowing) setVehicleHandling(vehicle, "tractionMultiplier", slowing) end
  2. Castillo

    dc-Output

    It doesn't matter who gave it to you, it matters that you've uploaded something from another person claiming it to be yours.
  3. Castillo

    dc-Output

    And who's your friend? because you've uploaded that to the MTA community as "your first script".
  4. The best thing you can do is try.
  5. firstmarker = createMarker(1372.04126, -1600.24585, 13.24007,"checkpoint", 1.5, 0, 255, 0, false) setElementVisibleTo( firstmarker, getRootElement(), false ) setElementVisibleTo(firstmarker, source, true) -- then show it to the source -- this is inside a function that is triggerd from client that works fine.
  6. You only have the GUI code, which is the easy part, now you need to learn on how to make the rest. Functions that you may need: guiGridListAddRow guiGridListGetSelectedItem guiGridListGetItemText guiGridListSetItemText getElementsByType getPlayerName triggerServerEvent getPlayerMoney takePlayerMoney givePlayerMoney getPlayerFromName
  7. Castillo

    dc-Output

    That's what I mean, he didn't script this.
  8. Castillo

    dc-Output

    Because it is the same.
  9. Mabako's paradise gamemode hint script: https://community.multitheftauto.com/index.php?p= ... ls&id=3299
  10. I suggest you this: go back to the wiki and redo the tutorial.
  11. Castillo

    dc-Output

    Mabako's hint script: --[[ 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 screenX, screenY = guiGetScreenSize( ) local cursorX, cursorY = -1, -1 local defaultWidth = 360 local width = defaultWidth local height = 70 local x = ( screenX - width ) / 2 local y = screenY - height - 60 local line_height = 16 -- local title, text, icon, color, start, duration -- addEventHandler( "onClientRender", root, function( ) if start and duration then local tick = getTickCount( ) if tick > start + duration then title = nil text = nil icon = nil color = nil start = nil duration = nil else local alpha = 1 if start + duration / 2 < tick then alpha = ( start + duration - tick ) / duration * 2 end dxDrawRectangle( x - 5, y - 5, width + 10, height + 10, tocolor( color[1], color[2], color[3], color[4] * alpha ), true ) dxDrawImage( x, y + ( height - 64 ) / 2, 64, 64, "images/" .. icon .. ".png", 0, 0, 0, tocolor( 255, 255, 255, 255 * alpha ), true ) dxDrawText( title, x + 65, y, x + width, y + 18, tocolor( 255, 255, 255, 255 * alpha ), 0.6, "bankgothic", "left", "top", true, false, true ) dxDrawText( text, x + 70, y + 18, x + width, y + height, tocolor( 255, 255, 255, 255 * alpha ), 1, "default", "left", "top", true, true, true ) end end end ) -- function hint( ti, te, ic, dur ) if ic == 1 then icon = "okay" color = { 0, 93, 0, 193 } elseif ic == 2 then icon = "warning" color = { 127, 97, 31, 193 } elseif ic == 3 then icon = "error" color = { 127, 31, 31, 193 } else icon = "info" color = { 31, 127, 127, 193 } end start = getTickCount( ) if type( dur ) ~= "number" or dur < 500 then duration = 10000 else duration = dur end title = ti text = te return true end addEvent( "gui:hint", true ) addEventHandler( "gui:hint", getLocalPlayer( ), hint ) "Your" script: local screenX, screenY = guiGetScreenSize( ) local cursorX, cursorY = -1, -1 local defaultWidth = 230 local width = defaultWidth local height = 150 local x = ( screenX - width ) local y = screenY - height - 60 local line_height = 16 -- local title, text, icon, color, start, duration,tcolor -- addEventHandler( "onClientRender", root, function(player) if start and duration then local tick = getTickCount( ) if tick > start + duration then title = nil text = nil icon = nil color = nil start = nil duration = nil tcolor = nil else local alpha = 1 if start + duration / 2 < tick then alpha = ( start + duration - tick ) / duration * 2 end dxDrawRectangle( x , 0, width + 20, height + 2, tocolor( color[1], color[2], color[3], color[4] ), true ) dxDrawText( title, x, 0, x + width, y + 18, tocolor( 255, 255, 255, 255), 0.5, "bankgothic", "left", "top", true, false, true ) dxDrawText( text, x +2 ,25, x + width, y + height, tocolor( tcolor[1], tcolor[2], tcolor[3], tcolor[4] ), 0.6, "bankgothic", "left", "top", true, true, true ) end end end ) -- function logo( ti, te, ic, dur ) if ic == 1 then icon = "okay" color = { 0, 0,0, 255 } tcolor = {204,204,0,255} --playSoundFrontEnd(12,source) elseif ic == 2 then icon = "warning" color = {0, 0, 0, 255 } tcolor = {255,204,0,255} --playSoundFrontEnd(12,source) elseif ic == 3 then icon = "error" color = { 0, 0, 0, 255 } tcolor = {255,0,0,255} --playSoundFrontEnd(11,source) else icon = "info" color = { 0, 0, 0,255 } tcolor = {255,255,0,255} playSoundFrontEnd(12,source) end start = getTickCount( ) if type( dur ) ~= "number" or dur < 500 then duration = 4000 else duration = dur end title = ti text = te return true end addEvent( "aoutput",true ) addEventHandler( "aoutput", getLocalPlayer( ), logo ) -- Usage -- triggerEvent("aoutput",getLocalPlayer(),"Msg","Hello World")
  12. Castillo

    dc-Output

    You haven't scripted this from scratch, it's using parts of mabako's hint script.
  13. addEventHandler('onClientPlayerJoin', root, function() outputChatBox('* ' .. getPlayerName(source):gsub("#%x%x%x%x%x%x","") .. ' has joined the game', 255, 100, 100) end ) addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick) outputChatBox('* ' .. oldNick:gsub("#%x%x%x%x%x%x","") .. ' is now known as ' .. newNick:gsub("#%x%x%x%x%x%x",""), 255, 100, 100) end ) addEventHandler('onClientPlayerQuit', root, function(reason) outputChatBox('* ' .. getPlayerName(source):gsub("#%x%x%x%x%x%x","") .. ' has left the game [' .. reason .. ']', 255, 100, 100) end )
  14. Supongo que queres decir remplazar modelos existentes, no crear nuevos porque eso no es posible. Para remplazar un vehiculo necesitas usar las funciones de "Engine", hay un ejemplo de como remplazar el Euros en la wiki. https://wiki.multitheftauto.com/wiki/Cli ... _functions
  15. Post your join quit script. P.S: This should go in the Scripting section.
  16. You can't resize a GUI label, but you can change it's font and color using: guiSetFont and guiLabelSetColor
  17. This seems like part of the wiki example, I'am right? if so, I think you've messed up the client and the server side.
  18. If you want to destroy the label after some time, you must use destroyElement
  19. Castillo

    spawn

    Ok, please stop the off-topic. @kieren1: You said you was going to PM me his IP and Serial, but you didn't.
  20. I don't really have much experience with handling related stuff, you should ask to Remi-X maybe.
  21. Works perfectly fine here, no errors or anything.
  22. In what version of MTA are you running this? because the handling functions only works in MTA 1.1.
×
×
  • Create New...