depato123 Posted November 13, 2013 Share Posted November 13, 2013 Hola, tengo un problema con este script: function frenodedMano ( ) if ( isPedInVehicle ( source ) ) then local veh = isElementFrozen ( source ) if ( isElementFrozen ( veh ) == true ) then setElementFrozen ( veh, false ) local px, py, pz = getElementPosition ( source ) for _, v in ipairs ( getElementsByType ( "player" ) ) do if isPlayerInRangeOfPoint ( v, px, py, pz, chat_range ) then outputChatBox ( "*".. getPlayerName ( source ) .." ah puesto el freno de mano.", v, 255, 40, 80 ) end end else setElementFrozen ( veh, true ) local px, py, pz = getElementPosition ( source ) for _, v in ipairs ( getElementsByType ( "player" ) ) do if isPlayerInRangeOfPoint ( v, px, py, pz, chat_range ) then outputChatBox ( "*".. getPlayerName ( source ) .." ah removido el freno de mano.", v, 255, 40, 80 ) end end end else outputChatBox ("You aren't in a vehicle!", source, 255, 0, 0) end end addEvent ( "frenodeMano",true ) addEventHandler ( "frenodeMano", getRootElement(), frenodedMano ) El error [2013-11-13 14:18:49] WARNING: vehicles\server.lua:4: Bad argument @ 'isElementFrozen' [Expected element at argument 1, got boolean] [2013-11-13 14:18:49] WARNING: vehicles\server.lua:13: Bad argument @ 'setElementFrozen' [Expected element at argument 1, got boolean] [2013-11-13 14:18:52] WARNING: vehicles\server.lua:4: Bad argument @ 'isElementFrozen' [Expected element at argument 1, got boolean] [2013-11-13 14:18:52] WARNING: vehicles\server.lua:13: Bad argument @ 'setElementFrozen' [Expected element at argument 1, got boolean] Lo que tendria que pasar si el resource funcionara es lo siguiente: Al apretar un boton que esta trigeado el vehiculo se congela. Pero eso no pasa y sale el error de arriba. !!Ayuda¡¡ Link to comment
Sensacion Posted November 13, 2013 Share Posted November 13, 2013 Tienes que definir al vehículo Link to comment
depato123 Posted November 13, 2013 Author Share Posted November 13, 2013 Tienes que definir al vehículo ¿Como? si ya esta definido así local veh = isElementFrozen ( source ) Link to comment
MTA Team 0xCiBeR Posted November 13, 2013 MTA Team Share Posted November 13, 2013 No esta definido, pone esto: function frenodedMano ( ) if ( isPedInVehicle ( source ) ) then local veh = getPedOccupiedVehicle ( source ) if ( isElementFrozen ( veh ) == true ) then setElementFrozen ( veh, false ) local px, py, pz = getElementPosition ( source ) for _, v in ipairs ( getElementsByType ( "player" ) ) do if isPlayerInRangeOfPoint ( v, px, py, pz, chat_range ) then outputChatBox ( "*".. getPlayerName ( source ) .." ah puesto el freno de mano.", v, 255, 40, 80 ) end end else setElementFrozen ( veh, true ) local px, py, pz = getElementPosition ( source ) for _, v in ipairs ( getElementsByType ( "player" ) ) do if isPlayerInRangeOfPoint ( v, px, py, pz, chat_range ) then outputChatBox ( "*".. getPlayerName ( source ) .." ah removido el freno de mano.", v, 255, 40, 80 ) end end end else outputChatBox ("You aren't in a vehicle!", source, 255, 0, 0) end end addEvent ( "frenodeMano",true ) addEventHandler ( "frenodeMano", getRootElement(), frenodedMano ) Link to comment
depato123 Posted November 13, 2013 Author Share Posted November 13, 2013 Perdon. Y gracias Link to comment
Recommended Posts