-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
objeto = createObject ( 980, 96.599998474121, 1921.4000244141, 20.89999961853, 0, 0, 90 ) addCommandHandler ( "puerta", function ( ) moveObject ( objeto, 50000, 96.599998474121, 1921.4000244141, 20.89999961853 ) end ) addCommandHandler ( "puerta", function ( ) moveObject ( objeto, 5000, 96.599998474121, 1921.4000244141, 20.89999961853 ) end )
-
Se inicio el recurso o no?
-
Tenes que recargar los recursos con "/refresh".
-
Tenes que recargar los recursos con "/refresh".
-
Mira http://www.mediafire.com/?ogwngbrjia4n03r Lo unico que hiciste fue agregar un punto al meta.xml y con eso lo arruinaste aun peor. Aca lo tenes arreglado: http://www.mediafire.com/?d9wvji3bx4m2whj
-
You're welcome.
-
Capaz que tengas un script que este haciendolo.
-
Si hiciste bien lo que te dije entonces tiene que funcionar.
-
Como va a funcionar si llamaste al archivo: "move.lua.txt", y en el meta.xml esta intentando cargar "move.lua". Cambiale el nombre al archivo que contiene el script a "move.lua".
-
What do you mean by interior objects?
-
Subi el recurso entero a mediafire.com y postea el link.
-
local modelsToReplace = {1915} local castleBasePosition, castleZRotation = {20, -1995, 5}, 0 --Located just west of Area 69. local castleObjects = {--{modelID, xOffset, yOffset, zOffset} {1915, -129.182, 0, 0, 0, 0, 270}, {1915, -129.182, -129.182, 0, 0, 0, 180}, {1915, 0, -129.182, 0, 0, 0, 90}, {1915, 0, 0, 0, 0, 0, 0}, } local function resourceStart() local castle = createElement("castle", "castlea") setElementPosition(castle, castleBasePosition[1], castleBasePosition[2], castleBasePosition[3]) setElementRotation(castle, 0, 0, castleZRotation) for i,v in ipairs(castleObjects) do local x, y, z = (castleBasePosition[1] + v[2]), (castleBasePosition[2] + v[3]), (castleBasePosition[3] + v[4]) local newObject = createObject(v[1], x, y, z, 0, 0, v[7]) setElementParent(newObject, castle) end for i,v in ipairs(modelsToReplace) do local texture = engineLoadTXD("castle.txd") engineImportTXD(texture, v) local colission = engineLoadCOL("castle.col") local model = engineLoadDFF("castle.dff", 1915) engineReplaceCOL(colission, v) engineReplaceModel(model, v) engineSetModelLODDistance(v, 500) end local castleBlip = createBlip(castleBasePosition[1], castleBasePosition[2], castleBasePosition[3], 19, 2, 255, 0, 0, 255, 0, 500) setElementParent(castleBlip, castle) --This is to reload the collision data when the local player gets near the castle local streamingColShape = createColCircle(castleBasePosition[1], castleBasePosition[2], 250) setElementParent(streamingColShape, castle) addEventHandler("onClientColShapeHit", streamingColShape, streamInCastle) --addEventHandler("onClientColShapeLeave", streamingColShape, streamOutCastle) end addEventHandler("onClientResourceStart", resourceRoot, resourceStart) --Streams the castle IN function streamInCastle(hitElement, dimensionMatch) if hitElement ~= localPlayer or not dimensionMatch then return end for i,v in ipairs(modelsToReplace) do local texture = engineLoadTXD("castle.txd") engineImportTXD(texture, v) local colission = engineLoadCOL("castle.col") local model = engineLoadDFF("castle.dff", 0) engineReplaceCOL(colission, v) engineReplaceModel(model, v) engineSetModelLODDistance(v, 500) end end Try that.
-
What's wrong with this script: model (re)placement?
Castillo replied to RobbieG-NL's topic in Scripting
Well, you solved it . You're welcome. -
That's because guiGridListGetSelectedItem returns the row and column index, not the text of it. For that you must use: guiGridListGetItemText. addEventHandler ( 'onClientResourceStart', resourceRoot, function ( ) local guiVehicle = guiCreateWindow( 0.3, 0.2, 0.4, 0.6, 'Vehicles', true ) local gridVehicles = guiCreateGridList( 0.05, 0.1, 0.5, 0.825, true, guiVehicle ) local hColumn = guiGridListAddColumn ( gridVehicles, 'Vehicles', 0.85 ) if ( hColumn ) then local hRow = guiGridListAddRow ( gridVehicles ) guiGridListSetItemText ( gridVehicles, hRow, hColumn, 'Dune', false, false ) addEventHandler ( 'onClientGUIClick', gridVehicles, function ( ) local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local name = guiGridListGetItemText ( source, row, hColumn ) if ( name == 'Dune' ) then outputChatBox ( 'You pressed on dune.', 255, 255, 255 ) end end end ,false ) end end )
-
What's wrong with this script: model (re)placement?
Castillo replied to RobbieG-NL's topic in Scripting
For what it seems, it failed to load every file. -
viewtopic.php?f=148&t=40809
-
local minDistance = 5 addEventHandler ( "onVehicleStartEnter", root, function ( p ) local m = getElementModel ( source ) if ( m == 598 or m == 596 or m == 597 or m == 599 or m == 523 ) then local px, py, pz = getElementPosition ( p ) local vx, vy, vz = getElementPosition ( source ) if ( getDistanceBetweenPoints3D ( px, py, pz, vx, vy, vz ) > minDistance ) then return end if ( getPlayerTeam ( p ) and getTeamName ( getPlayerTeam ( p ) ) == "Police" ) then outputChatBox ( "Access Granted.", p, 124, 252, 0, false ) else cancelEvent ( ) outputChatBox ( "You must be part of the Police team to get access to this vehicle.", p, 255, 0, 0, false ) end end end ) Change 'minDistance' to whatever you want.
-
That's the problem, you are using 'hitElement', but your argument name is 'hitPlayer'.
-
I really doubt someone will use his time to teach you just because you don't want to read the lua manuals.
-
You won't find a specific example for this, you have to learn about Lua.
-
if ( getElementData ( hitElement, "gang" ) == "Elite" ) then
-
Tema movido a "Scripting". @Julian: Postea el meta.xml.