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_Window[1] = guiCreateWindow(0.3,0.2,0.4,0.5,"",true) guiSetAlpha(GUIEditor_Window[1],225) guiCreateStaticImage ( 0, 0, 1, 0.8,"imageicecream.png",true,GUIEditor_Window[1]) guiSetVisible(GUIEditor_Window[1],false) GUIEditor_Button[1] = guiCreateButton(0.52,0.85,0.45,0.1,"Buy $2",true,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(0,0.85,0.45,0.1,"Don't want",true,GUIEditor_Window[1]) function showGUIwhoopie ( ) guiSetVisible ( GUIEditor_Window[1], true ) showCursor ( true ) end addEvent ( "showGUIwhoopie", true ) addEventHandler ( "showGUIwhoopie", getRootElement(), showGUIwhoopie ) addEvent ( "hideGUIwhoopie", true ) addEventHandler ( "hideGUIwhoopie", getRootElement(), function ( ) guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[2] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) elseif ( source == GUIEditor_Button[1] ) then local money = getPlayerMoney ( ) if ( money >= 2 ) then triggerServerEvent ( 'TakeAndGive', localPlayer ) end end end ) -- server side: local whoopieVehicle = createVehicle ( 423, 2433.6787109375, -1655.0888671875, 13.162685394287, 0, 0, 90 ) local whoopieMarker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 5 ) attachElements ( whoopieMarker, whoopieVehicle, 1.2, -0.35, 0.8 ) local mrwhoopieSkin = 264 local mrwhoopieVehicle = 423 addEventHandler ( 'onMarkerHit', whoopieMarker, function ( Hit ) if ( getElementType ( Hit ) == 'player' ) then triggerClientEvent ( Hit,"showGUIwhoopie", Hit ) end end ) addEventHandler ( "onMarkerLeave", whoopieMarker, function ( leavePlayer ) if ( getElementType ( leavePlayer ) == 'player' ) then triggerClientEvent ( leavePlayer, "hideGUIwhoopie", leavePlayer ) end end ) function enterVehicle ( thePlayer, seat, jacked ) if ( mrwhoopieVehicle == getElementModel ( source ) ) and ( mrwhoopieSkin ~= getElementModel ( thePlayer ) ) and ( seat == 0 ) then setTimer ( blowVehicle, 6500, 1, source ) setTimer ( outputChatBox, 4000, 1, "You are not Mr.Whoopie, Car explode in few seconds.", thePlayer, 255, 0, 0 ) else setTimer ( outputChatBox, 4000, 1, "Sell ice creams to earn money.", thePlayer, 255, 0, 0 ) blipwhoopie = createBlipAttachedTo ( whoopieVehicle,56, 2, 255, 0, 0, 255, 0, 200 ) end end addEventHandler ( "onVehicleStartEnter", root, enterVehicle ) function removeBlipOnExit ( thePlayer, seat, jacked ) if ( mrwhoopieVehicle == getElementModel ( source ) ) then destroyElement ( blipwhoopie ) end end addEventHandler ( "onVehicleExit", getRootElement(), removeBlipOnExit ) addEvent ( 'TakeAndGive', true ) addEventHandler ( 'TakeAndGive', root , function ( ) local Driver = getVehicleController ( whoopieVehicle ) if ( Driver ) then givePlayerMoney ( Driver, 2 ) takePlayerMoney ( source, 2 ) setElementHealth ( source, getElementHealth ( source ) + 20 ) outputChatBox ( "You Bought an Ice cream", source, 225, 225, 0 ) end end )
  2. function dxDrawBorderedText( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded ) local text_ = text:gsub ( "#%x%x%x%x%x%x", "" ) dxDrawText ( text_, x - 2, y - 2, w - 2, h - 2, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false, true ) -- black dxDrawText ( text_, x + 2, y - 2, w + 2, h - 2, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false, true ) dxDrawText ( text_, x - 2, y + 2, w - 2, h + 2, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false, true ) dxDrawText ( text_, x + 2, y + 2, w + 2, h + 2, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false, true ) dxDrawText ( text_, x - 2, y, w - 2, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false, true ) dxDrawText ( text_, x + 2, y, w + 2, h, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false, true ) dxDrawText ( text_, x, y - 2, w, h - 2, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false, true ) dxDrawText ( text_, x, y + 2, w, h + 2, tocolor ( 0, 0, 0, 255 ), scale, font, alignX, alignY, clip, wordBreak, false, true ) dxDrawText ( text, x, y, w, h, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded ) end Try it.
  3. Castillo

    Camaras!

    Inicialo, deberia funcionar solo, nunca lo use igual.
  4. We don't give support with leaked scripts. Topic locked.
  5. Castillo

    Camaras!

    No, volve a ejecutar el coamndo.
  6. Post the edited: "dxDrawBorderedText" function.
  7. The text looks like that?
  8. When hit the marker, check if the player is on a vehicle with: isPedInVehicle About waiting timer, you can either use timers: setTimer isTimer or calculate the time passed with: getTickCount
  9. Castillo

    Camaras!

    Esta iniciado el recurso "freecam"? pusiste ese script como CLIENT side?
  10. Castillo

    Camaras!

    Tenes que poner el script ese que cree en un recurso nuevo. Tenes que habilitar la opcion desde el panel de admin en el recurso: scoreboard: "allowColorcodedNames".
  11. It's disabled, you must enable that argument.
  12. Inside: "dxDrawBorderedText" function do you have colorCoded argument enabled?
  13. You can search on the MTA community center or around the forums. Community: https://community.multitheftauto.com/
  14. Castillo

    Camaras!

    Con este simple comando podes activar y desactivar la camara libre: addCommandHandler ( "freecam", function ( ) if ( exports.freecam:isFreecamEnabled ( ) ) then exports.freecam:setFreecamDisabled ( ) else exports.freecam:setFreecamEnabled ( ) end end ) Es client side.
  15. addEventHandler ( "onPlayerChat", root, function ( msg ) local team = getPlayerTeam ( source ) if ( not team ) then return end local r, g, b = getTeamColor ( team ) local teamName = getTeamName ( team ) cancelEvent ( ) local myName = getPlayerName ( source ) if ( team and teamName == "Drift" or teamName == "Hajwalah" ) then for _, v in ipairs ( getPlayersInTeam ( team ) ) do outputChatBox ( "* [ ".. teamName .." ] : ".. myName .."#FFFFFF : #ffffff".. msg, v, r, g, b, true ) end elseif ( team and teamName == "Ksa~1" or teamName == "Ksa~2" ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do local team = getPlayerTeam ( player ) if ( team ) then local teamName = getTeamName ( team ) if ( teamName == "Ksa~1" or teamName == "Ksa~2" ) then outputChatBox ( "* [ War ] : ".. myName .."#FFFFFF : #ffffff".. msg, player, r, g, b, true ) end end end end end )
  16. That's called global, if you don't put "local" infront of it, it'll be a global variable, table, etc.
  17. Mind explaining what is the problem?
  18. What you are saying is, that you remove the buildings on map editor, save the map, start it on your server, and the buildings don't get removed?
  19. You can get a RP game mode from here: https://github.com/mabako/mta-paradise It doesn't has a lot of features, but it's a start.
  20. I personally don't like Counter Strike at all, but the idea is good, and looks promising, good luck .
  21. Don't take this the wrong way, but you read what he said and what I quoted? he doesn't want to get the server name, he wants to SET it.
  22. There was a function ( if I recall correctly ), but it got disabled.
×
×
  • Create New...