-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You must use the function: https://wiki.multitheftauto.com/wiki/RedirectPlayer So example: local serverIP = "127.0.0.1" local serverPort = "22003" addEventHandler("onPlayerJoin",root, function () redirectPlayer (source, serverIP, tonumber(serverPort)) end) That's a server-side script.
-
createTeam ("LS airport",0, 0,255) createTeam ("SF airport",0, 128,255) createTeam ("LV airport",0, 255,255) createTeam ("Chile Airport",255,0,0) addEvent("lslv",true) addEventHandler("lslv",root, function () outputChatBox("**#C2C2C2Enviando informacion a la torre de control de LS...", source, 255, 255, 255, true) for index, player in ipairs(getPlayersInTeam(getTeamFromName("LS airport"))) do outputChatBox("Hola.",player) end end)
-
Decis que al crear el team envie un mensaje a los que esten en el mismo? pero el team estara vacio cuando, porque lo acaban de crear.
-
setTimer(function () marker1 = createMarker() end, 500, 1) Deberia funcionar.
-
rutals = createMarker(1937.688, -2382.673, 13.54, 'cylinder', 5, 255, 0, 0, 150) function rutalss() if isElementWithinMarker(localPlayer, rutals) then outputChatBox("#FF0000Prueba", 255, 255, 255, true) -- Pusiste "oututChatBox", es "outputChatBox". else outputChatBox("No estas en el lugar apropiado para este comando.!", 255, 0, 0) end end addCommandHandler("rutals", rutalss)
-
You can't replace just one vehicle texture, it'll replace every vehicle of the same model.
-
rutals = createMarker ( 1944.3000488281, -2385.6000976563, 12.60000038147, "cylinder", 10, 255, 0, 0, 100) -- Te olvidaste de las comillas en "cylinder". -------------------Panel LS-------------------------------- function rutaguils(thePlayer, matchingDimension, player) if isElementWithinMarker(thePlayer, rutals) then ventanals = guiCreateWindow(956,168,372,569,"Panel de rutas de LS",false) imagenls = guiCreateStaticImage(14,31,346,163,"images/mtalogo.png",false,GUIEditor_Window[1]) boton1ls = guiCreateButton(38,214,309,64,"LS - LV",false,GUIEditor_Window[1]) boton2ls = guiCreateButton(39,295,310,65,"LS - SF",false,GUIEditor_Window[1]) boton3ls = guiCreateButton(40,375,312,75,"LS - Aereo Abandonado",false,GUIEditor_Window[1]) boton4ls = guiCreateButton(330,519,32,39,"X",false,GUIEditor_Window[1]) label1ls = guiCreateLabel(82,459,238,34,"Tu avion:",false,GUIEditor_Window[1]) label2ls = guiCreateLabel(84,495,237,32,"Tu Posicion:",false,GUIEditor_Window[1]) label3ls = guiCreateLabel(50,533,94,16,"BKT - RolPlay",false,GUIEditor_Window[1]) else outputChatBox("No estas en un lugar para usar este comando.!", thePlayer, 255, 0, 0) end end addCommandHandler("rutals", rutaguils) ----Funciones------ local despegels = createMarker (2043.0999755859, -2593.1000976563,13.5, "corona", 10,255,0,0,100) -- Aca lo mismo con "corona". addEventHandler("onClientGUIClick",root, function (thePlayer) if (source == GUIEditor_Button[1]) then outputChatBox ( "#C2C2C2 Enviando informacion a la torre de control de LS",255, 255,255, true) setTimer (outputChatBox, 4000, 1,"#00FF00 Torrede control: #C2C2C2Informacion recivida, en unos momentos le daremos el pase de despege", 255, 255, 255, true) setTimer (desjegels, 4000, 1) end end) ------------------- -----------------------------------------------------------
-
@Kenix: Actually my script was designed to save it on player account data, if you didn't know, you can't save a Lua-table in account data, but yes a JSON string. P.S: Isn't my script easier to understand than yours?
-
Copy it again, I forgot to remove the "local" in front of "playerList".
-
There's a gate maker resource in the MTA community: https://community.multitheftauto.com/index.php?p= ... ils&id=614 Also a object movement generator: https://community.multitheftauto.com/index.php?p= ... ls&id=1224 Good luck.
-
function createPlayerList (player) --Create the grid list element playerList = guiCreateGridList ( 0.60, 0.10, 0.15, 0.60, true ) button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Do", true ) addEventHandler("onClientGUIClick",button,onButtonClick,false) --Create a players column in the list local column = guiGridListAddColumn( playerList, "Player", 0.85 ) if ( column ) then --If the column has been created, fill it with players for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( player ), false, false ) end end end addCommandHandler("show",createPlayerList) function onButtonClick() local row,col = guiGridListGetSelectedItem(playerList) if (row and col and row ~= -1 and col ~= -1) then local playerName = guiGridListGetItemText(playerList, row, 1) outputChatBox("Hi ") end end
-
Vehicle mods: https://community.multitheftauto.com/index.php?p= ... ls&id=3642 https://community.multitheftauto.com/index.php?p= ... ls&id=3644
-
addEventHandler("onPlayerWasted", root, function() local weapons = convertWeaponsToJSON(source) setElementData(source,"tempWeapons",weapons) end ) addEventHandler("onPlayerSpawn", root, function () local weapons = getElementData(source,"tempWeapons") if (weapons) then giveWeaponsFromJSON(source, weapons) end end ) function convertWeaponsToJSON(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end
-
- Nunca te acuerdes de diegofkda.
-
You're welcome .
-
Yes, stop the server then replace it.
-
Did you try replacing "registry.db" (where top times are saved) with a older copy?
-
Si, el resto esta bien.
-
You're using two different systems. addEventHandler("onPlayerWasted", root, function() local weapons = convertWeaponsToJSON(source) setElementData(source,"tempWeapons",weapons) end ) addEventHandler("onPlayerSpawn", root, function () local weapons = getElementData(source,"tempWeapons") if (weapons) then giveWeaponsFromJSON(source, weapons) end end ) function convertWeaponsToJSON(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon( source, slot ) local ammo = getPedTotalAmmo( source, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end
-
local x,y,z = getElementPosition ( localPlayer ) local posicion = getZoneName ( x,y,z) guiSetText(GUIEditor_Label[1], "Tu posicion: ".. posicion ..".") No se para que pusiste "if (player) then".
-
No, it won't, but you can copy the weapon saving part, is not that hard.
-
getElementPosition + getZoneName
-
That script is the "play" game mode but edited.
