-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
Oh, really? [2012-04-16 18:04:09] WARNING: 124: Bad argument @ 'addEventHandler' [Expected element at argument 2, got boolean] [2012-04-16 18:04:09] WARNING: 125: Bad argument @ 'addEventHandler' [Expected element at argument 2, got boolean] [2012-04-16 18:04:09] WARNING: 123: Bad argument @ 'createColPolygon' [2012-04-16 18:04:09] WARNING: 124: Bad argument @ 'addEventHandler' [Expected element at argument 2, got boolean] [2012-04-16 18:04:09] WARNING: 125: Bad argument @ 'addEventHandler' [Expected element at argument 2, got boolean] [2012-04-16 18:04:09] WARNING: 130: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil] [2012-04-16 18:04:09] WARNING: 131: Bad argument @ 'addEventHandler' [Expected element at argument 2, got boolean] [2012-04-16 18:04:09] WARNING: 130: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil] [2012-04-16 18:04:09] WARNING: 131: Bad argument @ 'addEventHandler' [Expected element at argument 2, got boolean] local rAreas = { }; local gAreas = { }; local tRedAreas = { { fX = 200, fY = 100, fWidth = 500, fHeight = 500 }; { fX = 300, fY = 50, fWidth = 250, fHeight = 300 }; } local tGreenAreas = { { fX = 200, fY = 100, fWidth = 500, fHeight = 500 }; { fX = 300, fY = 50, fWidth = 250, fHeight = 300 }; } addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, rArea in ipairs ( tRedAreas ) do rAreas[_] = createColRectangle ( rArea.fX, rArea.fY, rArea.fWidth, rArea.fHeight ); addEventHandler ( 'onColShapeHit', rAreas[_], onRectangleHit ); addEventHandler ( 'onColShapeLeave', rAreas[_], onRectangleLeave ); end for _, gArea in ipairs ( tGreenAreas ) do gAreas[_] = createColRectangle ( gArea.fX, gArea.fY, gArea.fWidth, gArea.fHeight ); addEventHandler ( 'onColShapeHit', gAreas[_], onRectangleHit ); addEventHandler ( 'onColShapeLeave', gAreas[_], onRectangleLeave ); end end ) onRectangleHit = function ( uPlayer ) outputChatBox ( getPlayerName ( uPlayer ) .. ' entered the ColShape!', root, 255, 255, 255, false ); end onRectangleLeave = function ( uPlayer ) outputChatBox ( getPlayerName ( uPlayer ) .. ' left the ColShape!', root, 255, 255, 255, false ); end You had many errors in your code, Draken. 1: Your table contained strings, not numbers. 2: You had "rAreas" instead of "gAreas" in the second loop. Do you even test what you post? because you're not helping if you don't.
-
Which script is that? could you post it?
-
I'm guessing this is a client-side script. local isHudVisible = true bindKey ( "i", "down", function ( ) isHudVisible = ( not isHudVisible ) showPlayerHudComponent ( "all", isHudVisible ) end )
-
May I ask what are you trying to achieve?
-
Borre tu post porque era off-topic, no tenia nada quever con el tema.
-
Es muy facil, usa la funcion: redirectPlayer + addCommandHandler..
-
You should start with easier things, e.g, saving / loading simple texts and so on.
-
As I said, read the example in that page.
-
Check the example here: https://wiki.multitheftauto.com/wiki/XmlNodeSetValue
-
The function xmlLoadFile is used to load a XMlL file, then you have to write with other XML functions.
-
Map editor has a feature to get world models.
-
ebacol = createColSphere( -1276.9361572266, 54.15234375, 65.905364990234, 7 ) state = createColPolygon ( 0, 0, -4000, -4000, -4000, 4000, 4000, 4000, 4000, -4000 ) blips = { } function atcDut ( source ) local isittrue = isElementWithinColShape ( source, ebacol ) if ( isittrue == true ) then local atcvehs = getElementsWithinColShape( state, "vehicle" ) for index, vehicle in ipairs ( atcvehs ) do local vehmod = getElementModel ( vehicle ) if ( vehmod == 487 ) then table.insert ( blips, createBlipAttachedTo ( atcvehs, 0, 2, 0, 200, 255, 255, 0, 99999, source ) ) end end outputChatBox ( "You are now on ATC Duty", source ) end end addCommandHandler ( "atcduty", atcDut ) function eatcDut ( source ) local isittrue = isElementWithinColShape ( source, ebacol ) if ( isittrue == true ) then for index, blip in ipairs ( blips ) do if ( isElement ( blip ) ) then destroyElement ( blip ) end end outputChatBox ( "You are now off ATC Duty", source ) end end addCommandHandler ( "endduty", eatcDut ) Should store each blip on "blips" table then loop it and destroy the blips.
-
So what? if he posts here, I'll reply here.
-
Yeah, I supposed someone was going to reply about that . Anyway, getRootElement ( ) will trigger for everything, won't it? player, resources, vehicles?
-
You haven't answered my question, or you already solved your problem?
-
To be able to edit the server scripts, you must have access to them. Oh, and editing the scripts on: "MTA San Andreas 1.3\mods\deathmatch\resources\" won't make any effect, as they're downloaded each time you join a server.
-
local vehicles = { "Patriot" } function openGUI ( ) window = guiCreateWindow (0.3,0.2,0.3,0.6,"SACR Car spawn",true) gridlist = guiCreateGridList (0.1,0.1,0.8,0.7,true,window) column = guiGridListAddColumn( gridlist, "Vehicles:", 0.85 ) for index, vehicle in ipairs ( vehicles ) do local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, column, tostring ( vehicle ), false, false ) end button = guiCreateButton (0.8,0.8,0.2,0.2,"Spawn",true,window) close = guiCreateButton(0,0.85,0.45,0.1,"Close",true,window) showCursor ( true ) end addEvent ( "openGUI", true ) addEventHandler ( "openGUI", root, openGUI ) function destroyGUI() destroyElement(window) showCursor (false) window = nil end function buttonClick ( ) if ( source == button ) then -- "row" is not a GUI element. local row, col = guiGridListGetSelectedItem ( gridlist ) -- Get the selected item from the grid list. if ( row and col and row ~= -1 and col ~= -1 ) then -- If he has a selected item. local vehicleName = guiGridListGetItemText ( gridlist, row, col ) -- Get the text of it. triggerServerEvent ( "vehicle", localPlayer, getVehicleModelFromName ( vehicleName ) ) -- Trigger the "vehicle" event with a vehicle model argument. destroyGUI () end elseif ( source == close ) then destroyGUI () end end addEventHandler ( "onClientGUIClick", getRootElement(), buttonClick )
-
@Khtsjefen: What you're trying to achieve is to create blips on each Maverick and destroy them when you write /endduty ?
-
-- client side: local sWidth,sHeight = guiGetScreenSize ( ) local find = "The Word: Welcome!" function drawDXText ( ) dxDrawText ( find, sWidth - 700, sHeight - 200, sWidth - 350, sHeight - 100, tocolor ( 255, 255, 0 ), 1.0, "bankgothic", "right", "top", false, false, false ) end addEvent ( "drawTheText", true ) addEventHandler ( "drawTheText", root, function ( ) addEventHandler ( "onClientRender", root, drawDXText ) end ) -- server side: addCommandHandler ( "drawWel", function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do triggerClientEvent ( player, "drawTheText", player ) end end )
-
Heligrab resource: https://community.multitheftauto.com/index.php?p= ... ls&id=4480 Original: https://community.multitheftauto.com/index.php?p= ... ils&id=357
-
You're talking about freeroam? if so, then you'll have to edit the script itself to translate it.
-
GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(0.2324,0.3033,0.4258,0.3617,"GUI Reproductora de Musica",true) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Label[1] = guiCreateLabel(41,48,339,19,"Porfavor Pon la URL de la cancion que quieres hacer sonar",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(40,70,373,33,"",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(312,109,101,43,"Escuchar",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(17,113,287,19,"Para escuchar una cancion necesitas pagar $3000",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(18,155,62,15,"VOLUMEN",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(16,179,29,27,"+",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(47,179,29,27,"-",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(106,172,73,35,"Pausar",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(184,172,73,35,"Detener",false,GUIEditor_Window[1]) GUIEditor_Label[4] = guiCreateLabel(277,177,141,16,"GUI Creada POR ELMOTA",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],255,0,255) guiSetFont(GUIEditor_Label[4],"default-bold-small") guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) --[[ local volume = true --]] local sound = true function onGuiClick (button, state, absoluteX, absoluteY) if (source == GUIEditor_Button[1]) then triggerServerEvent ( "m", getLocalPlayer() ) if ( sound == true ) then local URL = guiGetText ( GUIEditor_Edit[1] ) sp = playSound(URL) outputChatBox ( "Sonido cargandose en Unos Segundos", getLocalPlayer(), 255, 0, 0, true ) outputChatBox ( "La Musica a comenzado !", getLocalPlayer, 255, 0, 0, true ) end elseif (source == GUIEditor_Button[2]) then local svol = getSoundVolume(sp)+1 while not setSoundVolume ( sp, svol ) do svol = svol + 1 end elseif (source == GUIEditor_Button[3]) then local svol = getSoundVolume(sp)-1 while not setSoundVolume ( sp, svol ) do svol = svol -1 end end end addEventHandler ( "onClientGUIClick", getRootElement(), onGuiClick ) function show ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end bindKey ( "i","down", show ) Te faltaba un "end".
-
function qm ( ) local money = getPlayerMoney ( source ) if ( money >= 3000 ) then takePlayerMoney ( source, 3000 ) else outputChatBox ( "No Tienes Suficiente Dinero", source ) end end addEvent( "m", true ) addEventHandler( "m", getRootElement(), qm ) Tus errores: 1: Estabas usando "thePlayer" en lugar de "source" @ getPlayerMoney. 2: Te habias olviado de poner el argumento de jugador @ takePlayerMoney.
-
Vehicle mods: https://community.multitheftauto.com/index.php?p= ... ls&id=4470 https://community.multitheftauto.com/index.php?p= ... ls&id=4471
-
Sin ofender, pero no decia nada de eso en el primer post: