Search the Community
Showing results for tags 'spawn'.
-
Eu estava tentando colocar esse spawn de vehiculo por acl, mas não estou conseguindo. Alguém consegue me ajudar? veh = {} addEventHandler("onResourceStart", resourceRoot, function() for i, v in ipairs(spawn) do local veh = createVehicle(v[1], v[2], v[3], v[4], v[5], v[6], v[7]) setElementCollisionsEnabled(veh, false) setElementData(veh, "vehSpawn", true) setElementFrozen(veh, true) setVehicleDamageProof(veh, true) end end) addEventHandler("onVehicleEnter", getRootElement(), function(player) if source and getElementType(source) == "vehicle" then local model = getElementModel(source) local x, y, z = getElementPosition(source) if getElementData(source, "vehSpawn") then if veh[player] and isElement(veh[player]) then destroyElement(veh[player]) end veh[player] = createVehicle(model, x+3, y, z) warpPedIntoVehicle(player, veh[player]) end end end) addEventHandler("onPlayerWasted", root, function() if veh[source] and isElement(veh[source]) then destroyElement(veh[source]) end end) addEventHandler("onPlayerLogout", root, function() if veh[source] and isElement(veh[source]) then destroyElement(veh[source]) end end) addEventHandler("onPlayerQuit", root, function() if veh[source] and isElement(veh[source]) then destroyElement(veh[source]) end end)
-
porque meu codigo não esta destruindo o veiculo quando o player que spawnou sai dele? veiculo = {} function spawnVeh(source) if getPedOccupiedVehicle(source) == false then if getElementData(source, "Eletricista") == true then if getElementModel(source) == 11 then veiculo[source] = createVehicle(config.veh, 2458.3537597656,-2078.1528320312,13.546875) warpPedIntoVehicle(source, veiculo[source]) setElementRotation(veiculo[source], 0,0,180) setVehicleLocked(veiculo[source],true) setVehicleDamageProof(veiculo[source], true) end end else outputChatBox("você já esta em um veiculo") end end addEvent("spawnCar", true) addEventHandler("spawnCar", root, spawnVeh) function onSair(source) if getPedOccupiedVehicle(source) == false then destroyElement ( veiculo[source] ) veiculo[source] = nil end end addEventHandler("onPedVehicleExit", getRootElement(), onSair)
-
Eu tenho um script que spawna Skin por comando, basicamente quem estiver na acl e executar um comando ele recebe uma skin. Eu Queria Mudar, em vez de spawnar uma skin spawnar um carro quem poder me ajudar '-' function Gang1 ( player ) local accName = getAccountName ( getPlayerAccount (player) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "amora" ) ) then setElementModel(player, 56) setElementData(player, "56",56) outputChatBox("Você usou a skin da gangue Exemplo ", player, 0, 25, 0, false) end end addCommandHandler("skin",Gang1)
- 2 replies
-
- 1
-
- programação em lua
- script
-
(and 1 more)
Tagged with:
-
Eai galera, de boa? preciso de uma ajuda de alguém que saiba como resolver, toda vez que dou spawn em algum veículo de duas rodas (moto e bicicleta) do meu server no mta eles ficam girando e alguns bugs de sombra ocorrem, só param alguns segundos depois, o mesmo ocorre na concessionaria quando clica para vizualizar a moto...gira em todos os ângulos por alguns segundos, ou então após sair de algum interior (agência, cnh...) também gira. Se alguém souber como resolver fico muito grato. Segue anexo uma imagem para exemplificar. https://ibb.co/BN9jrN4
-
Como faço, para quando o player logar novamente no server, ele spawnar no ultimo lugar onde esteve antes de sair.
-
Boa noite, É possivel adicionar um spawn de armas/skin dentro de algum interior? Lembrando: O interior está liberado devido um certo mod. Aguardo.
-
Hello, everybody! I'm following this tutorial to make a GUI with a car spawning function. Copy/pasting everything works up until the gridlist. The click doesn't. Could there be a mistake? I recreated the script on my own following step by step: - Client-side - And here is the problematic part: The GUI elements are the same. The only thing that changes are the names. Naturally, it should work by simply replacing the names. However, I believe there might be a mistake on the original script. With everything as it is, I can show and hide the GUI, and click on any vehicle. If I purposely trigger an output, nothing happens. So, waddaya think?
-
I have this: -- 2 points on each city. local spawnCoords = { {1125, -2036, 69.89, -90}, {2504, -1686, 13.55, 45}, {-1972, 643, 46.57, -45}, {-2720, -317, 7.85, 45}, {2023, 1008, 10.83, -90}, {1298, 2084, 12.83, -90}, } -- all skins. local validSkins = {0, 1, 2, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312} function spawnPoints (player) local x,y,z,r = unpack(spawnCoords[math.random(1,#spawnCoords)]) spawnPlayer(source, x, y, z, r, validSkins[math.random(1,#validSkins)]) fadeCamera(source, true) setCameraTarget(source, source) end addEventHandler("onPlayerJoin", getRootElement(), spawnPoints) Althought it works, after giving it several tests, I realized the spawn locations where always in the same order, as well as the skins. Coincidentally, I've reached the tables subject in the MTA's tutorial, and I learned about <for key, value in pairs(table) do>. Contrary to "ipairs", "pairs" is supposed to give you a random reading throughout the table everytime the script is ran. I used 'broph.Lua' as a way to understand the process, and to make sure that if I do the same, it'll work. My small knowledge told me that, by adding <for key, value in pairs(spawnCoords) do> right after the beginning of the function, I would get the random effect of the table reading. However, the result is far from what I expected: it destroys the function, and the player doesn't spawn at all (black screen). I'm continuing the tutorial, but 'in pairs' is the last thing NanoBob mentions about the tables. This time, I'd like a bit of a challenge, so if you could give me the hints and point me in the right direction, I would appreciate that.
-
I'm daring myself to add more little things to the tutorials shown here. It's of great pleasure to announce that the following code works. I know it is not much, but it's one more step closer to my dream server. So, function joinHandler() spawnPlayer(source, 2023, 1008, 10.83, -90, math.random (1,288)) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("¡Bienvenido!", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) You can skip the spanish words. The result is as expected: when the player joins, the chatbox shows the text, the player is looking at the east, and the skin is randomized between 1 and 288. However, the camera is aiming at its default value: 0. The result has a rather inconvenient detail: the camera is looking at the right side of the character's body. UPDATE: I added setPedCameraRotation. There are no errors being detected, but the camera is not changing at all. function joinHandler() spawnPlayer(source, 2023, 1008, 10.83, -90, math.random (1,288)) fadeCamera(source, true) setCameraTarget(source, source) setPedCameraRotation(source, 90) outputChatBox("¡Bienvenido!", source) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) How can I modify where the camera is looking at when a player joins, so that way it looks at the same place the character is looking?
-
Boa noite a todos, eu sou bem leigo em Lua, e toda vez que venho aqui fico feliz com a maneira que vocês fazem a gente entender pelo menos o minimo dos scripts que estamos tentando alterar, isso é sensacional. enfim. Hoje eu to com um problema em um sistema de spawn de vtr por acl. Queria que se possível me ajudassem a alterar o que quero nele. Spawn1 = createMarker(-65.258903503418, -343.11831665039, 5.4296875 -1,"cylinder", 1.9, 0, 0, 200, 40) Destroy = createMarker(-65.258903503418, -371.39807128906, 5.4296875 -2,"cylinder", 5.0, 128, 0, 0, 99) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end veh = {} function spawnvtr ( thePlayer, comando, nick ) setElementHealth (veh, 200000) if veh[thePlayer] and isElement( veh[thePlayer] ) then destroyElement ( veh[thePlayer] ) veh[thePlayer] = nil end local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "BOMBEIROS") ) then veh[thePlayer] = createVehicle(529, -61.04016494751, -303.79797363281, 5.3578243255615, 0, 0, 270 ) warpPedIntoVehicle ( thePlayer, veh[thePlayer] ) --exports._infobox:addNotification(thePlayer, "", "success") else outputChatBox("#FFFFFF| #E10000BOMBEIROS #FFFFFF| Somente #E10000BOMBEIROS #FFFFFFPodem Pegar Este Veiculo.",thePlayer,255,255,255, true) end end addEventHandler("onMarkerHit", Spawn1, spawnvtr) function destroyvtr ( thePlayer ) if veh[thePlayer] and isElement(veh[thePlayer]) then destroyElement (veh[thePlayer]) --exports._infobox:addNotification(thePlayer, "", "success") else end end addEventHandler("onMarkerHit", Destroy, destroyvtr) Ele é bem simples, você passa em cima de um marker ele cria um determinado veiculo, e em cima de outro marker e ele destrói. Mas tem 2 poréns eu queria que um único player conseguisse spawnar quantos veículos ele quisesse, e quando ele spawna outro veículo, o anterior some. E o outro problema é que quando o player spawna o veículo e sai do server, ele não consegue mais desespawnar. Alguém pode me ajudar a resolver? Grato a Atenção
-
Quero por outro marcador e outro spawn de carro, pra ficar 2 spawns, mais sempre buga e fica somente 1 ou buga e fica 2 marcadores e 1 veiculo, aqui esta o script com 1 spawn de carro, eu quero colocar outro spawn iniMarker = createMarker( 163.7912902832, 1808.8654785156, 16.640625, "cylinder", 3.5, 200,225,1,50) destroyM = createMarker( 127.0807723999, 1809.0919189453, 16.640625, "cylinder", 3.9, 255,255,255,100) function msg(player) outputChatBox("#FFD700»Você Pegou Um Carro Do #00FF00Exécito Brasileiro«", player, 255,255,255,true) end addEventHandler("onMarkerHit", iniMarker, msg) veh = {} function spawnVehicle(player) if isElementWithinMarker(player, iniMarker) then if veh[player] and isElement( veh[player] ) then destroyElement(veh[player]) veh[player] = nil end veh[player] = createVehicle(490, 157.12101745605, 1822.6125488281, 17.640625) warpPedIntoVehicle(player, veh[player]) end end addEventHandler("onMarkerHit", iniMarker, spawnVehicle) function msgDestroy(player) outputChatBox("Voce Destroiu o Carro Do #00FF00Exécito Brasileiro", player, 255,255,255,true) end addEventHandler("onMarkerHit", destroyM, msgDestroy) function destroy(player) if isElementWithinMarker(player, destroyM) then if isPedInVehicle(player) == true then destroyElement(veh[player]) outputChatBox("", player, 255,255,255,true) else outputChatBox("", player, 255,255,255,true) end end end addEventHandler("onMarkerHit", destroyM, destroy)
-
I'm trying to spawn in every hospital in GTA S.A, I want the player to be born in the nearest hospital. What band could I add in my script to work this function? I'm sorry for my english xD
-
Quisiera como pudiera hacer que mi panel cuando muera alguien se abra automaticamente ya que solo abre cuando entras al sv x,y = guiGetScreenSize() JobsWin = guiCreateWindow(x/3 - 170,y/3 - 20,200,320,"Selecciona Tu Equipo",false) teamsList = guiCreateGridList(0,22,186,255,false,JobsWin) column = guiGridListAddColumn( teamsList, "Teams", 0.85 ) for id, team in ipairs(getElementsByType("team")) do local row = guiGridListAddRow ( teamsList ) guiGridListSetItemText ( teamsList, row, 1, getTeamName ( team ), false, false ) guiGridListSetItemColor ( teamsList, row, 1, getTeamColor ( team ) ) end guiWindowSetMovable ( teamsList, false ) guiWindowSetMovable ( JobsWin, false ) guiWindowSetSizable ( teamsList, false ) guiWindowSetSizable ( JobsWin, false ) send = guiCreateButton(0,285,90,25,"Seleccionar",false,JobsWin) CloseButton = guiCreateButton(105,285,90,25,"Cerrar",false,JobsWin) guiSetVisible(JobsWin, true) showCursor(true) setTimer ( showingTeams, 1000, 1) function close() if source == CloseButton then guiSetVisible(JobsWin, false) showCursor(false) end end addEventHandler ( "onClientGUIClick", root, function ( button ) if button == "left" then if source == send then local row, col = guiGridListGetSelectedItem ( teamsList ) local teamName = guiGridListGetItemText ( teamsList, row, col ) triggerServerEvent ( "onPlayerChooseTeam", getLocalPlayer(), teamName ) end end end) addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), close)
-
Hello, I have a server and I would like to use a spawn by Groups I want the clan members to be able to activate and deactivate this spawn with a command. If you can help me, I thank you --------------------------------------------------------------------------------------------------------------------------- local GroupName = 'KILLERS' function onWasted () if getElementData(source,'Group') == 'KILLERS' then setTimer( function (source) setElementDimension( source, 0 ) setElementPosition( source, 2478.705078125+math.random(1,1), -1685.421875+math.random(1,1), 13.5078125 ) setElementInterior( source, 0 ) setPedArmor ( source, 100) setPedFightingStyle ( source, 5) end, 1000, 1, source) end end addEventHandler ( "onPlayerSpawn", getRootElement(), onWasted )
-
Hello guys .So my problem is that i can't spawn added vehicle to the DayZ v0.9.9.5a . It can't spawn itself but spawned from admin panel show how much part's it need etc . But it must spawn itself .And how do i change cars names ? I know u guys can help me so let's do it . PS Sorry for bad english
-
local Veiculos = {494} -- IDs dos Veículos. Tulio = {} function CreateVehicle (source) if getElementData (source, "Pegou", true) then outputChatBox ('#c1c1c1Aguarde #ffffff20 #ffffffsegundos para pegar novamente.',source,255,255,255,true) return end if isElement(Tulio[source]) then destroyElement (Tulio[source]) Tulio[source] = nil end local x,y,z = getElementPosition (source) local Cars = Veiculos[math.random(#Veiculos)] Tulio[source] = createVehicle (Cars,x,y,z) setElementData (source, "Pegou",true) setTimer (setElementData, 20000, 1, source, "Pegou", false) end addCommandHandler ("494", CreateVehicle) function DestroyVeiculo () destroyElement (Tulio[source]) end addEventHandler ("onPlayerLogout", root, DestroyVeiculo) addEventHandler ("onPlayerQuit", root, DestroyVeiculo) addEventHandler ("onPlayerWasted", root, DestroyVeiculo) Como eu faço com que esse script faça o veiculo do player sair do lado e não encima dele?
-
Saludos a todos. Hace dos días que tengo el mismo problema y no puedo solucionarlo.. Resulta que tengo dos ordenadores, uno lo utilizo para mis creaciones y testear el servidor (PC sobremesa) Y el otro lo utilizo unicamente como host para el servidor. Dentro del ordenador de testeo todo funciona bien y sin errores. Pero al momento de transladar el servidor al ordenador que utilizo como host, aparece el siguiente error: ERROR: DayZ\Vehicle_spawns.lua:1805: attemp to call global 'getvehicleMaxFuel' <a nil value> Sé que es un error conocido por muchos, se forma cuando intentas spawnear un vehiculo desde el panel de admin (P) Esto genera que se malogre la base de datos del servidor (Internal.db) El problema es que como dije antes, en el servidor de testeo todo funciona perfectamente. Entonces, ¿Porque me aparece este error solo en el ordenador que utilizo como Host? He intentado con Eliminar, reemplazar y hasta reparar el Internal.db, pero hasta ahora nada ha funcionado, el error sigue apareciendo .. ¿Alguna idea?
-
Hello guys, I would like to know if anyone could help me with the spawn and respawn system on my roleplay mta server? *When I enter the server for the first time, I'm going to the city hall next to the police station in LS. *the problem comes up when I die and instead of going to a hospital, I go to the city hall in the standard spawn. * I die in any city, I return to the LS hospital and after 1 second I go back to the normal spawn in city hall. * Another problem is that I can not remove the car spawn on the map that comes standard with mta. (On spawn locations) *** I'm using GM Play What I wanted for the server is: - Remove Spawn Cars - When I entered the server, the player went to the city hall (next to the police station) in LS. - The player will be moved to the hospital in the city from which he died. (Example): I die in the city of LV, and I go to the hospital of LV Someone to help? I'm using gm play. I'm Very beginner in script Thanks!
-
hello community members i created a team panel with moving camera function the moving camera and panel works fine and get team player to scoreboard also working only the player spawn not working , but when it comes to select (choose)team it must spawn me at the positions , but its not working the screen go black and i stuck in the black screen below r some pics see it , Team panel pic : https://imgur.com/nTKFprq https://imgur.com/a/NG5mp Black screen when i click on select team : https://imgur.com/a/PS5pm https://imgur.com/LzoQWhN Scoreboard works fine shows team+player : https://imgur.com/A07HHQp https://imgur.com/a/3fmPl client code : --[[------------------------------------------------- Notes: > This code is using a relative image filepath. This will only work as long as the location it is from always exists, and the resource it is part of is running. To ensure it does not break, it is highly encouraged to move images into your local resource and reference them there. --]]------------------------------------------------- GUIEditor = { staticimage = {}, label = {}, button = {}, window = {}, gridlist = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() setTimer(function() startCamera() end, 2000, 1) GUIEditor.window[2] = guiCreateWindow(-3, 315, 1156, 423, "Team spawn panel", false) guiWindowSetSizable(GUIEditor.window[2], false) guiSetAlpha(GUIEditor.window[2], 1.00) guiSetProperty(GUIEditor.window[2], "CaptionColour", "FF45EE1E") GUIEditor.memo[4] = guiCreateMemo(14, 268, 223, 145, "Ballas r pro In gangs theey can take\ndown any gangs ,police or any teamsmebers the main goal of ballas is to take down groove street memebrs and there belonging\n**take down Groove and bikers*", false, GUIEditor.window[2]) GUIEditor.memo[5] = guiCreateMemo(260, 273, 245, 130, "Groove memebrs are decent and very powerfull with awsome guns skills they \ndo attack with combine members all the work is to take down mother :Oers\nBallas and bikers noobs!!\n\n**Take down Ballas and Bikers******", false, GUIEditor.window[2]) GUIEditor.memo[6] = guiCreateMemo(549, 279, 232, 128, "Bikers are newbies they dont know much about killing ,teaming so if are pro think to take down all groove and ballas then claim down your memebrs and take down kids around your hood!\n**Take down noobs around hood**", false, GUIEditor.window[2]) GUIEditor.staticimage[4] = guiCreateStaticImage(14, 28, 218, 188, ":newteampanel/img/Ballas.png", false, GUIEditor.window[2]) GUIEditor.staticimage[5] = guiCreateStaticImage(259, 34, 240, 172, ":newteampanel/img/groove.png", false, GUIEditor.window[2]) GUIEditor.staticimage[6] = guiCreateStaticImage(565, 54, 200, 152, ":newteampanel/img/bikers.png", false, GUIEditor.window[2]) GUIEditor.button[4] = guiCreateButton(838, 340, 129, 41, "Select", false, GUIEditor.window[2]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FF787B84") GUIEditor.memo[7] = guiCreateMemo(1340, 284, 0, 20, "", false, GUIEditor.window[2]) GUIEditor.button[5] = guiCreateButton(981, 338, 126, 43, "Close", false, GUIEditor.window[2]) teamsList = guiCreateGridList(825, 51, 282, 277, false, GUIEditor.window[2]) column = guiGridListAddColumn(teamsList, "Teams", 0.9) for id, team in ipairs(getElementsByType("team")) do local row = guiGridListAddRow ( teamsList ) guiGridListSetItemText ( teamsList, row, 1, getTeamName ( team ), false, false ) guiGridListSetItemColor ( teamsList, row, 1, getTeamColor ( team ) ) end for i = 1, 3 do guiGridListAddRow(teamsList) end guiGridListSetItemText(teamsList, 0, 1, "Ballas", false, false) guiGridListSetItemColor(teamsList, 0, 1, 249, 31, 2, 255) guiGridListSetItemText(teamsList, 1, 1, "Groovestreet", false, false) guiGridListSetItemColor(teamsList, 1, 1, 6, 244, 40, 255) guiGridListSetItemText(teamsList, 2, 1, "Bikers", false, false) guiGridListSetItemColor(teamsList, 2, 1, 224, 17, 232, 255) GUIEditor.label[1] = guiCreateLabel(830, 30, 277, 24, "Team selection panel", false, GUIEditor.window[2]) guiLabelSetColor(GUIEditor.label[1], 249, 31, 2) end ) addEventHandler( 'onClientGUIClick', root, function() if source == GUIEditor.button[5] then guiSetVisible(GUIEditor.window[2], false) showCursor(false) end end ) addEventHandler( 'onClientGUIClick', root, function ( button ) if source == GUIEditor.button[4] then if button == "left" then local row, col = guiGridListGetSelectedItem ( teamsList ) local teamName = guiGridListGetItemText ( teamsList, row, col ) triggerServerEvent ( "onPlayerChooseTeam", getLocalPlayer(), teamName ) removeEventHandler("onClientPreRender", root, moveItNow) if isElement(dumpy) then destroyElement(dumpy) end destroyElement(GUIEditor.window[2]) guiSetInputEnabled(false) fadeCamera(false, 1.0, 0, 0, 0) end end end) ---MOVING CAMERA cams = { --X, Y, Z, X2, Y2, TX, TY, TZ [1]={1859, -1516, 48, 1952, -1513, 1919, -1423, 22}, --LS Skatepark [2]={2077, -1245, 46, 2077, -1148, 1987, -1200, 24}, --Glen Park [3]={1526, -1004, 63, 1484, -950, 1478, -989, 61}, --Burger King AD LS [4]={1471, -1606, 44, 1470, -1697, 1552, -1675, 21} --LSPD } pos = nil function startCamera() pos = math.random(1, #cams) local x, y, z = cams[pos][1], cams[pos][2], cams[pos][3] local tx, ty = cams[pos][4], cams[pos][5] local cx, cy, cz = cams[pos][6], cams[pos][7], cams[pos][8] setCameraMatrix(x, y, z, cx, cy, cz, 1, 90) startCamAction(x, y, z, tx, ty, 12) end function startCamAction(x, y, z, tx, ty, time) fadeCamera(true, 1.0, 0, 0, 0) dumpy = createObject(1337, x, y, z) setElementAlpha(dumpy, 0) setElementCollisionsEnabled(dumpy, false) moveObject(dumpy, time*1000, tx, ty, z) end function moveItNow() if not isElement(dumpy) then return end local x, y, z = getElementPosition(dumpy) setCameraMatrix(x, y, z, cams[pos][6], cams[pos][7], cams[pos][8], 1, 90) if (getDistanceBetweenPoints3D(x, y, z, cams[pos][4], cams[pos][5], z) <= 1) then if isElement(dumpy) then destroyElement(dumpy) end fadeCamera(false, 1.0, 0, 0, 0) setTimer(function() startCamera() end, 1200, 1) end end addEventHandler("onClientPreRender", root, moveItNow)
-
Buenas, recién estoy aprendiendo a scriptear y hay cosas que no entiendo (aparte de tener un inglés muy malo) y quisiera saber si me pueden ayudar a hacer que al spawnear o entrar al server el jugador adquiera un estilo de pelea y forma de caminar en específico. Esto lo he sacado de la wiki pero no le he entendido nada y he intentado con los addEventHandler pero no sé como poner un estilo en específico. style = {STYLE_KUNG_FU, 6} function joinFight ( thePlayer ) if thePlayer and style then -- If player and ID are specified setPedFightingStyle ( thePlayer, style ) -- set the fighting style end end addEventHandler ('onPlayerSpawn', joinFight) -------------------------------------------------------------------------------------------------------------------------------------------------- walkStyles = { {"Old Fat Man", 123 }, } function onClientResourceStart(localPlayer) setPedWalkingStyle(localPlayer, 0) end addEventHandler("onPlayerSpawn",resourceRoot, onClientResourceStart)
- 3 replies
-
- spawn
- walkingstyle
-
(and 1 more)
Tagged with:
-
The resource starts, but the bot does not spawn. function bot () team = createTeam ("AngryBots", 255,255,255) exports [ "slothBot" ]:spawnBot ( 2002.5241699219,1546.9384765625,13.5859375, 90, 124, 0, 0, 29, "waiting", true ) end addCommandHandler("bots",bot) <meta> <info author="Falke" version="2.0.0" type="misc" name="angrybots" description="This script will add Silent Hill to San Andreas" /> <script src="server.lua" type="server" /> <include resource="slothbot" /> </meta> Why does not the bot spawn?? Please, help me! Neither the "nemesi1" script is working now (it worked when i played MTA years ago...). I don't know what is happening ;-; *nemesi1: https://community.multitheftauto.com/index.php?p=resources&s=details&id=5722
-
Bonjour je suis en train de crée un serveur mta dayz mais j'ai un soucis les voitures spawn l'une sur l'autre que faire http://hpics.li/dcb49fd
-
Hello as set in this script https://community.multitheftauto.com/index.php?p=resources&s=details&id=347 to zombie spawn only at the military base?