TheMonsthers

Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About TheMonsthers

  • Rank
    Vic

Details

  • Gang
    SAVG:RPG

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hola a todos, tengo un problema estoy montando un server, y he estado trabajando en una ventana de spawn, donde te puedes dar diferente desove de clases, policias,criminales,civiles cosas asi! La cosa es que ya tengo todo listo, e incluso compre el host ayer y lo subi todo, pero en medio de una prueba de un "Joinquit" que estaba montando al server al encender el joinquit, Reconecte para probar el joinquit y cuando reconecto me doy cuenta de que el login funciona pero la ventana de spawn no! Osea la ventana de spawn dejo de funcionar en cuestiones de minutos! Y lo que me sale es que un trigered no esta añadido a serverside, No entiendo esto de trigered si anteriormente estaba funcionando? Lo se tambien esto pensando como se daño .-. [11:25:21] ERROR: Client (Monsthers) triggered serverside event onFloodGui, but event is not added to serverside Client local cameraCoordinates = { ["Default"] = {x=2000, y=-2750, z=40, lx=0, ly=0, lz=0}, ["Los Santos"] = {x=1835.3901, y=-1318.0278, z=131.7343, lx=2009.8775, ly=-1477.9719, lz=74.9148}, ["Las Venturas"] = {x=1961.0225, y=1660.1909, z=75.7187, lx=2179.0568, ly=1286.1652, lz=42.4128}, ["San Fierro"] = {x=-1144.2871, y=855.0206, z=83.7325, lx=-1681.5821, ly=844.1858, lz=83.7325}, ["Red County"] = {x=888.6721, y=-583.6306, z=107.1850, lx=705.0307, ly=-517.7252, lz=19.8362}, ["Flint County"] = {x=-79.4184, y=-1604.8905, z=120.0000, lx=-445.6240, ly=-1191.9333, lz=56.4452}, ["Whetstone"] = {x=-2210.5170, y=-2217.7009, z=110.9331, lx=-2144.3203, ly=-2420.6093, lz=35.0390}, ["Tierra Robada"] = {x=-2653.6917, y=2207.8122, z=54.4159, lx=-2489.8464, ly=2343.4096, lz=14.1182}, ["Bone County"] = {x=-309.0679, y=1296.1102, z=58.1121, lx=-79.6051, ly=1077.9040, lz=35.9026}, ["Dimension de Diversion"] = {x=1165.5051269531, y=1735.1585693359,z=41.704200744629,lx=1165.0025634766,ly=1733.5,lz=41.707504272461} } function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix (element) local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z end local localPlayer = getLocalPlayer() local rectangleX, rectangleY = guiGetScreenSize() local spawnPending = false function initializeEverything(resourceStarted) if getResourceName(resourceStarted) == "SAVGlogin" or getResourceName(resourceStarted) == "SAVGspawn" then local xml = xmlLoadFile(":SAVGspawn/spawns.xml") if xml then local cityNodes = xmlNodeGetChildren(xml) cities = {} for i,node in ipairs(cityNodes) do cityname = xmlNodeGetAttribute(node, "name") local classnodes = xmlNodeGetChildren(node) cities[cityname] = {} for i2,node2 in ipairs(classnodes) do classname = xmlNodeGetAttribute(node2, "name") local spawnnodes = xmlNodeGetChildren(node2) cities[cityname][classname] = {} for i3, node3 in ipairs(spawnnodes) do skinName = xmlNodeGetAttribute(node3, "name") cities[cityname][classname][skinName] = {} cities[cityname][classname][skinName]["spawnX"] = xmlNodeGetAttribute(node3, "spawnX") cities[cityname][classname][skinName]["spawnY"] = xmlNodeGetAttribute(node3, "spawnY") cities[cityname][classname][skinName]["spawnZ"] = xmlNodeGetAttribute(node3, "spawnZ") cities[cityname][classname][skinName]["rot"] = xmlNodeGetAttribute(node3, "rot") cities[cityname][classname][skinName]["r"] = xmlNodeGetAttribute(node3, "r") cities[cityname][classname][skinName]["g"] = xmlNodeGetAttribute(node3, "g") cities[cityname][classname][skinName]["b"] = xmlNodeGetAttribute(node3, "b") local skinNode = xmlNodeGetAttribute(node3, "skins") cities[cityname][classname][skinName]["skins"] = split(skinNode, ",") cities[cityname][classname][skinName]["dimension"] = xmlNodeGetAttribute(node3, "dimension") cities[cityname][classname][skinName]["interior"] = xmlNodeGetAttribute(node3, "interior") cities[cityname][classname][skinName]["permission"] = xmlNodeGetAttribute(node3, "lock") cities[cityname][classname][skinName]["information"] = xmlNodeGetAttribute(node3, "information") cities[cityname][classname][skinName]["weapons"] = xmlNodeGetAttribute(node3, "weapons") cities[cityname][classname][skinName]["ganglevel"] = xmlNodeGetAttribute(node3, "ganglevel") end end end xmlUnloadFile(xml) if spawnPending then spawnPending = false drawSpawnScreen(spawnPending) end else outputDebugString("SPAWNMAP: A error has occured.") end end end addEventHandler("onClientResourceStart", root, initializeEverything) function drawSpawnScreen(houses) if cities then labels = {} spawnWindow = guiCreateWindow(0.00, 0.00, 0.27, 1.00, "SAVG:RPG Seleccion de Spawn", true) guiWindowSetMovable(spawnWindow, false) guiWindowSetSizable(spawnWindow, false) spawnLabel = guiCreateLabel(0.03, 0.04, 0.95, 0.08, "Bienvenido a SAVG:RPG. Esta es su selección desove, donde se selecciona su profesión y lo que se desea trabajar como. Para empezar. comenzar haciendo clic en la ciudad, la clase y profesión para desovar.", true, spawnWindow) guiLabelSetColor(spawnLabel, 239, 141, 15) guiLabelSetHorizontalAlign(spawnLabel, "center", true) guiLabelSetVerticalAlign(spawnLabel, "center") spawnDetailedLabel = guiCreateLabel(0.03, 0.14, 0.95, 0.03, "Por favor seleccione la ciudad para continuar.", true, spawnWindow) guiLabelSetColor(spawnDetailedLabel, 0, 255, 0) guiLabelSetHorizontalAlign(spawnDetailedLabel, "center", true) guiLabelSetVerticalAlign(spawnDetailedLabel, "center") guiSetFont(spawnDetailedLabel, "default-bold") ciudadEdit = guiCreateEdit(0.03, 0.18, 0.64, 0.02, "", true, spawnWindow) guiEditSetReadOnly(ciudadEdit, true) ciudadSearch = guiCreateButton(0.66, 0.18, 0.31, 0.02, "Buscar Ciudad", true, spawnWindow) cityGridList = guiCreateGridList(0.03, 0.22, 0.95, 0.17, true, spawnWindow) guiGridListSetSelectionMode(cityGridList, 2) guiGridListAddColumn(cityGridList, "Ciudad", 0.9) equipoEdit = guiCreateEdit(0.03, 0.41, 0.64, 0.02, "", true, spawnWindow) guiEditSetReadOnly(equipoEdit, true) equipoSearch = guiCreateButton(0.66, 0.41, 0.31, 0.02, "Buscar Equipo", true, spawnWindow) equipoGridlist = guiCreateGridList(0.03, 0.44, 0.95, 0.17, true, spawnWindow) guiGridListSetSelectionMode(equipoGridlist, 2) guiGridListAddColumn(equipoGridlist, "Equipo", 0.9) professionEdit = guiCreateEdit(0.03, 0.63, 0.64, 0.02, "", true, spawnWindow) guiEditSetReadOnly(professionEdit, true) professionSearch = guiCreateButton(0.66, 0.63, 0.31, 0.02, "Buscar Profession", true, spawnWindow) professionGridlist = guiCreateGridList(0.03, 0.66, 0.95, 0.17, true, spawnWindow) guiGridListSetSelectionMode(professionGridlist, 2) guiGridListAddColumn(professionGridlist, "Profession", 0.9) skinNumberLabel = guiCreateLabel(0.45, 0.85, 0.10, 0.02, "N/A", true, spawnWindow) guiLabelSetHorizontalAlign(skinNumberLabel, "center", false) guiLabelSetVerticalAlign(skinNumberLabel, "center") skinPrevButton = guiCreateButton(0.03, 0.85, 0.39, 0.02, "<", true, spawnWindow) guiSetProperty(skinPrevButton, "Disabled", "True") guiSetEnabled(skinPrevButton, false) skinNextButton = guiCreateButton(0.58, 0.85, 0.39, 0.02, ">", true, spawnWindow) guiSetProperty(skinNextButton, "Disabled", "True") guiSetEnabled(skinNextButton, false) spawnScreenOKButton = guiCreateButton(0.03, 0.96, 0.39, 0.02, "Spawn", true, spawnWindow) guiSetProperty(spawnScreenOKButton, "Disabled", "True") guiSetEnabled(spawnScreenOKButton, false) spawnInformationWindow = guiCreateWindow(0.76, 0.00, 0.24, 0.22, "SAVG:RPG Informacion del Spawn", true) guiWindowSetMovable(spawnInformationWindow, false) guiWindowSetSizable(spawnInformationWindow, false) spawnInformation = guiCreateMemo(0.03, 0.17, 0.94, 0.77, "", true, spawnInformationWindow) spawnPropediadWindow = guiCreateWindow(0.76, 0.23, 0.24, 0.22, "SAVG:RPG Propediades", true) guiWindowSetSizable(spawnPropediadWindow, false) locationGridList = guiCreateGridList(0.03, 0.31, 0.94, 0.63, true, spawnPropediadWindow) guiGridListSetSelectionMode(locationGridList, 2) guiGridListAddColumn(locationGridList, "Propiedades", 0.9) propediadEdit = guiCreateEdit(0.03, 0.14, 0.56, 0.11, "", true, spawnPropediadWindow) propediadSearch = guiCreateButton(0.59, 0.14, 0.38, 0.11, "Buscar Propediad", true, spawnPropediadWindow) local noneRow = guiGridListAddRow(locationGridList) guiGridListSetItemText(locationGridList, noneRow, 1, "Default Spawn", false, false) guiGridListSetItemData(locationGridList, noneRow, 1, false) guiGridListSetSelectedItem(locationGridList, noneRow, 1) for n, v in pairs(cities) do local row = guiGridListAddRow(cityGridList) guiGridListSetItemText(cityGridList, row, 1, n, false, false) end if houses then for n, v in ipairs(houses) do local row = guiGridListAddRow(locationGridList) guiGridListSetItemText(locationGridList, row, 1, v[1], false, false) guiGridListSetItemData(locationGridList, row, 1, {v[2], v[3], v[4]}) end end addEventHandler("onClientGUIClick", cityGridList, onCityClick) --|| onCityClick Function ||-- addEventHandler("onClientGUIClick", equipoGridlist, onClassClick) --|| onClassClick Function ||-- addEventHandler("onClientGUIClick", professionGridlist, onSkinClick) --|| onSkinClick Function ||-- addEventHandler("onClientGUIClick", spawnScreenOKButton, onSpawnButtonClick) --|| onSpawnButtonClick Function ||-- addEventHandler("onClientGUIClick", skinPrevButton, onPrevSkin) --|| onPrevSkin Function ||-- addEventHandler("onClientGUIClick", skinNextButton, onNextSkin) --|| onNextskin Function ||-- addEventHandler("onClientGUIChanged", ciudadEdit, searchCiudad) --addEventHandler("onClientGUIChanged", equipoEdit, searchEquipo) addEventHandler("onClientGUIClick", ciudadSearch, function() if source == ciudadSearch then guiEditSetReadOnly(ciudadEdit, false) end end) --addEventHandler("onClientGUIClick", equipoSearch, function() --if source == equipoSearch then --guiEditSetReadOnly(equipoEdit, false) --end --end) --addEventHandler("onClientGUIClick", professionSearch, function() --if source == professionSearch then --guiEditSetReadOnly(professionEdit, false) --end --end) setPlayerHudComponentVisible("all", false) showChat(false) guiGridListSetSelectedItem(professionGridlist, -1, 0) showCursor(true) else spawnPending = houses end end function searchCiudad() guiGridListClear(cityGridList) local searching = guiGetText(ciudadEdit) for x, y in pairs(cities) do if string.find(x, searching) then local row = guiGridListAddRow(cityGridList) guiGridListSetItemText(cityGridList, row, 1, x, false, false) end end end function searchEquipo() guiGridListClear(equipoGridlist) local searching = guiGetText(equipoEdit) for x, y in pairs(cities[testCity]) do if string.find(x, searching) then local row = guiGridListAddRow(equipoGridlist) guiGridListSetItemText(equipoGridlist, row, 1, x, false, false) end end end function onCityClick(button) --|| onCityClick Function ||-- if source == cityGridList and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 then local x,y,z,lx,ly,lz guiGridListClear(equipoGridlist) local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ) local cityName = guiGridListGetItemText(cityGridList, selectedRow, selectedCol) local cityClasses = cities[cityName] for x, y in pairs(cityClasses) do local row = guiGridListAddRow(equipoGridlist) guiGridListSetItemText(equipoGridlist, row, 1, x, false, false) end guiSetProperty(spawnScreenOKButton, "Disabled", "True") guiSetProperty(skinPrevButton, "Disabled", "True") guiSetProperty(skinNextButton, "Disabled", "True") guiSetText(skinNumberLabel, "N/A") guiSetText(spawnDetailedLabel, "Por favor seleccione el equipo para continuar.") local key = "Default" if cityName then key = cityName end x,y,z,lx,ly,lz = cameraCoordinates[key].x,cameraCoordinates[key].y,cameraCoordinates[key].z,cameraCoordinates[key].lx,cameraCoordinates[key].ly,cameraCoordinates[key].lz setCameraMatrix(x,y,z,lx,ly,lz) end end end function onClassClick(button) --|| onClassClick Function ||-- if source == equipoGridlist and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(equipoGridlist) > 0 then guiGridListClear(professionGridlist) local selectedRow, selectedCol = guiGridListGetSelectedItem(cityGridList) local cityName = guiGridListGetItemText(cityGridList, selectedRow, selectedCol) local selectedRow, selectedCol = guiGridListGetSelectedItem(equipoGridlist) local className = guiGridListGetItemText(equipoGridlist, selectedRow, selectedCol) local classSkins = cities[cityName][className] for x, y in pairs(classSkins) do local row = guiGridListAddRow(professionGridlist) guiGridListSetItemText(professionGridlist, row, 1, x, false, false) end guiSetProperty(spawnScreenOKButton, "Disabled", "True") guiSetProperty(skinPrevButton, "Disabled", "True") guiSetProperty(skinNextButton, "Disabled", "True") guiSetText(skinNumberLabel, "N/A") guiSetEnabled(skinPrevButton, false) guiSetEnabled(skinNextButton, false) guiSetEnabled(spawnScreenOKButton, false) guiSetText(spawnDetailedLabel, "Por favor seleccione la profession para continuar.") end end end function onSkinClick(button) --|| onSkinClick Function ||-- if source == professionGridlist and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(equipoGridlist) > 0 and guiGridListGetSelectedCount(professionGridlist) > 0 then local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ) local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol ) local selectedRow, selectedCol = guiGridListGetSelectedItem( equipoGridlist ) local className = guiGridListGetItemText( equipoGridlist, selectedRow, selectedCol ) local selectedRow, selectedCol = guiGridListGetSelectedItem( professionGridlist ) local skinName = guiGridListGetItemText( professionGridlist, selectedRow, selectedCol ) local spawninfo = cities[cityName][className][skinName]["information"] guiSetProperty(spawnScreenOKButton, "Disabled", "False") guiSetProperty(skinPrevButton, "Disabled", "False") guiSetProperty(skinNextButton, "Disabled", "False") guiSetText(skinNumberLabel, 1) guiSetText(spawnInformation, spawninfo) renderSkin() guiSetText(spawnDetailedLabel, "¿Seguro que deseas esta profesión?") end end end function onSpawnButtonClick(button) --|| onSpawnButtonClick Function ||-- if source == spawnScreenOKButton and button == "left" then if guiGridListGetSelectedCount( cityGridList ) > 0 and guiGridListGetSelectedCount( equipoGridlist ) > 0 and guiGridListGetSelectedCount( professionGridlist ) > 0 then local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ) local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol ) local selectedRow, selectedCol = guiGridListGetSelectedItem( equipoGridlist ) local className = guiGridListGetItemText( equipoGridlist, selectedRow, selectedCol ) local selectedRow, selectedCol = guiGridListGetSelectedItem( professionGridlist ) local skinName = guiGridListGetItemText( professionGridlist, selectedRow, selectedCol ) local spawninfo = cities[cityName][className][skinName] local skinID = spawninfo['skins'][tonumber(guiGetText(skinNumberLabel))] local selectedRow, selectedCol = guiGridListGetSelectedItem( locationGridList ) local selectLocation = guiGridListGetItemData(locationGridList, selectedRow, selectedCol) local spawnX, spawnY, spawnZ = spawninfo['spawnX'], spawninfo['spawnY'], spawninfo['spawnZ'] local dim, int = spawninfo['dimension'], spawninfo['interior'] if selectLocation and #selectLocation == 3 then spawnX, spawnY, spawnZ = unpack(selectLocation) dim, int = 0, 0 end triggerServerEvent("onPlayerSpawnButton", getLocalPlayer(), spawnX, spawnY, spawnZ, className, spawninfo['permission'], skinID, spawninfo['weapons'], getLocalPlayer(), skinName, spawninfo['r'] or nil, spawninfo['g'] or nil, spawninfo['b'] or nil, spawninfo['rot'], dim, int, spawninfo['ganglevel'] or 0) else exports.SAVGcommands:sendClientMessage("*SPAWN SYSTEM* Please make a selection to continue.", 0, 255, 0) end end end function onPrevSkin(button) --|| onPrevSkin Function ||-- if source == skinPrevButton and button == "left" then if tonumber(guiGetText(skinNumberLabel)) > 1 then if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(equipoGridlist) > 0 and guiGridListGetSelectedCount( professionGridlist ) > 0 then local currentNumber = tonumber(guiGetText(skinNumberLabel)) local newNumber = currentNumber - 1 guiSetText(skinNumberLabel, newNumber) renderSkin() end end end end function onNextSkin(button) --|| onNextSkin Function ||-- if source == skinNextButton and button == "left" then if guiGridListGetSelectedCount(cityGridList) > 0 and guiGridListGetSelectedCount(equipoGridlist) > 0 and guiGridListGetSelectedCount( professionGridlist ) > 0 then local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ) local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol ) local selectedRow, selectedCol = guiGridListGetSelectedItem( equipoGridlist ) local className = guiGridListGetItemText( equipoGridlist, selectedRow, selectedCol ) local selectedRow, selectedCol = guiGridListGetSelectedItem( professionGridlist ) local skinName = guiGridListGetItemText( professionGridlist, selectedRow, selectedCol ) local currentNumber = tonumber(guiGetText(skinNumberLabel)) local skins = cities[cityName][className][skinName]['skins'] local skinsN = table.getn(skins) if currentNumber < skinsN then local newNumber = currentNumber + 1 guiSetText(skinNumberLabel, newNumber) renderSkin() end end end end function renderSkin() --|| renderSkin Function ||-- if renderedPed then destroyElement(renderedPed) renderedPed = nil end local selectedRow, selectedCol = guiGridListGetSelectedItem( cityGridList ) local cityName = guiGridListGetItemText( cityGridList, selectedRow, selectedCol ) local selectedRow, selectedCol = guiGridListGetSelectedItem( equipoGridlist ) local className = guiGridListGetItemText( equipoGridlist, selectedRow, selectedCol ) local selectedRow, selectedCol = guiGridListGetSelectedItem( professionGridlist ) local skinName = guiGridListGetItemText( professionGridlist, selectedRow, selectedCol ) local currentNumber = tonumber(guiGetText(skinNumberLabel)) local skinID = cities[cityName][className][skinName]['skins'][tonumber(guiGetText(skinNumberLabel))] local posX = cities[cityName][className][skinName]['spawnX'] local posY = cities[cityName][className][skinName]['spawnY'] local posZ = cities[cityName][className][skinName]['spawnZ'] local rot = cities[cityName][className][skinName]['rot'] local dimension = cities[cityName][className][skinName]['dimension'] or 0 local interior = cities[cityName][className][skinName]['interior'] or 0 renderedPed = createPed(skinID, posX, posY, posZ, rot) setElementFrozen(renderedPed, true) setPedAnimation(renderedPed, "SMOKING", "M_smk_drag",-1,true,false,false) local camX, camY, camZ = getPositionFromElementOffset(renderedPed, 0, 5, 1) setElementInterior(renderedPed, interior) setElementDimension(renderedPed, dimension) setElementDimension(localPlayer, dimension) setCameraInterior(interior) setCameraMatrix(camX, camY, camZ, posX, posY, posZ, 0, 70) end function unrenderSkin() if renderedPed then destroyElement(renderedPed) renderedPed = nil end end function hideSpawnScreen() if isElement(spawnWindow) then destroyElement(spawnWindow) destroyElement(spawnInformationWindow) destroyElement(spawnPropediadWindow) if hataEkrani then guiSetVisible(hataEkrani, false) end end unrenderSkin() setPlayerHudComponentVisible("all", true) showChat(true) showCursor(false) end addEvent("onSpawnSuccessful", true) addEventHandler("onSpawnSuccessful", getRootElement(), hideSpawnScreen) function createMessageBox() hataEkrani = guiCreateWindow(150, 100, 300, 200, "SAVG:RPG Spawn Error Message", false) hataUyari = guiCreateMemo(5, 25, 295, 125, "", false, hataEkrani) guiMemoSetReadOnly(hataUyari, true) hataEkraniButton = guiCreateButton(110, 160, 80, 25, "OK", false, hataEkrani) guiWindowSetMovable(hataEkrani, false) guiWindowSetSizable(hataEkrani, false) guiSetVisible(hataEkrani, false) addEventHandler("onClientGUIClick", hataEkraniButton, function() guiSetVisible(hataEkrani, false) guiSetProperty(hataEkrani, "AlwaysOnTop", "False") end, false) end function displayError(error) if not hataEkrani then createMessageBox() end guiSetText(hataUyari, error) guiSetProperty(hataEkrani, "AlwaysOnTop", "True") guiSetVisible(hataEkrani, true) if not spawnWindow then drawSpawnScreen() elseif not guiGetVisible(spawnWindow) then drawSpawnScreen() end end addEvent("onSpawnError", true) addEventHandler("onSpawnError", getRootElement(), displayError) function checkPlayerAlive() triggerServerEvent("wasPlayerAliveEvent", getLocalPlayer()) end addEvent("showSpawn", true) addEventHandler("showSpawn", getRootElement(), drawSpawnScreen) addEvent("onPlayerLoginSuccess", true) addEventHandler("onPlayerLoginSuccess", getRootElement(), checkPlayerAlive) function deathMode() if not isElement(deathscreen) then deathscreen = guiCreateWindow(0.28, 0.78, 0.48, 0.21, "SAVG:RPG Hospital Respawn", true) guiWindowSetSizable(deathscreen, false) guiWindowSetMovable(deathscreen, false) deathscreenlabel = guiCreateLabel(0.02, 0.17, 0.97, 0.23, "Bienvenido al Hospital Respawn de SAVG:RPG. Aquí es donde usted tiene las opciones para reaparecer en el hospital más cercano o elegir una nueva profesión. Se le cobrará por la reaparición del hospital. ", true, deathscreen) guiLabelSetColor(deathscreenlabel, 239, 141, 15) guiLabelSetHorizontalAlign(deathscreenlabel, "center", true) guiLabelSetVerticalAlign(deathscreenlabel, "center") deathscreenprogress = guiCreateProgressBar(0.03, 0.47, 0.94, 0.14, true, deathscreen) death_spawn = guiCreateButton(0.18, 0.72, 0.27, 0.17, "Spawn Menu", true, deathscreen) guiSetFont(death_spawn, "default-bold-small") death_hospital = guiCreateButton(0.56, 0.72, 0.27, 0.17, "Hospital Respawn (1,000$)", true, deathscreen) guiSetFont(death_hospital, "default-bold-small") addEventHandler("onClientGUIClick",death_hospital,spawnAtHospital) addEventHandler("onClientGUIClick",death_spawn,normalSpawnWindow) end guiProgressBarSetProgress(deathscreenprogress, 100) guiSetVisible(deathscreen, true) showCursor(true) deathTimer = setTimer(countUntilDeath, 1000, 1, 50) end addEvent("SAVG.showDeathScreen",true) addEventHandler("SAVG.showDeathScreen",localPlayer,deathMode) function countUntilDeath(time) if getElementData(getLocalPlayer(),"reanimation") then reanimatePlayer() setElementData(getLocalPlayer(),"reanimationtime",false) deathTimer = nil else if time > 0 then time = time -1 guiProgressBarSetProgress(deathscreenprogress,time * 2) deathTimer = setTimer(countUntilDeath, 1000, 1, time) else setElementData(getLocalPlayer(),"reanimationtime",false) deathTimer = nil normalSpawnWindow() end end end function normalSpawnWindow() if deathTimer then killTimer(deathTimer) deathTimer = nil end triggerServerEvent("eli", root, localPlayer) destroyElement(deathscreen) showChat(true) setPlayerHudComponentVisible ("all",true) setElementData(getLocalPlayer(), "class", "N/A") end function spawnAtHospital() if source == death_hospital then if getPlayerMoney(getLocalPlayer()) >= 1000 then guiSetVisible(deathscreen, false) showCursor(false) setPlayerHudComponentVisible ("all",true) showChat(true) if deathTimer then killTimer(deathTimer) deathTimer = nil end triggerServerEvent("SPAWNATHOSIPTAL", getLocalPlayer(), tempweapons) tempweapons = {} exports.SAVGcommands:takeMoney(getLocalPlayer(), 1000) else exports.SAVGcommands:sendClientMessage("*INFO* Tu necesitas 1000$ para hacer respawn en el Hospital.", 255, 0, 0) end end end function reanimatePlayer() local Dim = getElementDimension(getLocalPlayer()) local Int = getElementInterior(getLocalPlayer()) if deathTimer then killTimer(deathTimer) deathTimer = nil end guiSetVisible(deathscreen, false) showCursor(false) triggerServerEvent("REANIMATEPLAYER", getLocalPlayer(), tempweapons, Dim, Int) tempweapons = {} end function weaponsAfterDeath() if source == getLocalPlayer() then tempweapons = {} local weaponSlots = {0,1,2,3,4,5,6,7,8,9,10,11,12} for i, slot in ipairs(weaponSlots) do local ammo = getPedTotalAmmo ( getLocalPlayer(), slot ) if ( getPedWeapon ( getLocalPlayer(), slot ) ~= 0 ) then local weapon = getPedWeapon ( getLocalPlayer(), slot ) local ammo = getPedTotalAmmo ( getLocalPlayer(), slot ) table.insert(tempweapons, {weapon, ammo}) end end end end addEventHandler("onClientPlayerWasted", getRootElement(), weaponsAfterDeath) Server local immunityToStars = { ["Administradores"] = true, ["San Andreas Eventos"] = true, ["Policias"] = true, ["Academia Policial"] = true, ["Squads Oficiales"] = true, ["Gobierno de San Andreas"] = true, ["Fuerzas Armadas"] = true, ["San Andreas Construccion"] = true, } local immunityToFriendlyFire = { ["Administradores"] = true, ["Gobierno de San Andreas"] = true, ["San Andreas Eventos"] = true, ["San Andreas Construccion"] = true, } local immunityToBlip = { ["Administradores"] = true, ["Gobierno de San Andreas"] = true, ["Fuerzas Armadas"] = true, ["Movimiento Revolucionario"] = true, ["San Andreas Eventos"] = true, ["San Andreas Construccion"] = true, } setGameType("SAVG:RPG") setMapName("San Andreas") setFPSLimit(60) setWaveHeight(0) setGlitchEnabled("quickreload", false) setGlitchEnabled("fastfire", true) for k, v in ipairs(getElementsByType("player")) do setPlayerBlurLevel(v, 0) end function changeBlurLevel() setPlayerBlurLevel(source, 0) end addEventHandler("onPlayerJoin", getRootElement(), changeBlurLevel) for i=0, 49 do setGarageOpen(i, true) end disableCommands = { ["register"] = true, ["login"] = true } function disableCommandsFunction(cmdName) if disableCommands[cmdName] then cancelEvent() end end addEventHandler("onPlayerCommand", root, disableCommandsFunction) function createTeamsOnStart() createTeam("Administradores", 255, 128, 0) createTeam("Gobierno de San Andreas", 102, 205, 170) --createTeam("Fuerzas Armadas", 36, 149, 36) --createTeam("Movimiento Revolucionario", 60, 36, 27) createTeam("San Andreas Eventos", 141, 182, 0) createTeam("Emergencias", 100, 255, 100) createTeam("Compañias", 188, 193, 0) createTeam("Civiles", 255, 255, 0) createTeam("Squads Oficiales", 2, 94, 193) createTeam("Policias", 100, 100, 255) createTeam("Gangs Oficiales", 113, 0, 0) createTeam("Criminales", 150, 0, 0) createTeam("San Andreas Construccion", 219, 154, 1) --createTeam("El Triunfo", 105, 226, 141) --createTeam("Academia Policial", 44, 155, 255) end addEventHandler("onResourceStart", getRootElement(), createTeamsOnStart) function playerSpawn(spawnX, spawnY, spawnZ, teamName, permission, skin, weapons, player, class, r, g, b, rotation, dimension, interior, level) local account = getPlayerAccount(player) if requestPermissionSuccess(player, permission, level) then local team = getTeamFromName(teamName) if (not team) then team = createTeam(team, r, g, b) end spawnPlayer(player, spawnX, spawnY, spawnZ, rotation, skin, interior or 0, dimension or 0, team) triggerClientEvent(player, "onSpawnSuccessful", getRootElement()) if immunityToFriendlyFire[teamName] then setTeamFriendlyFire(team, false) end if immunityToStars[teamName] then exports.SAVGpolice:setWantedLevel(player, 0) end if immunityToBlip[teamName] then createBlipAttachedTo(player, 0, 0.5, r, g, b, 100, 0, 200) else createBlipAttachedTo(player, 0, 2, r, g, b, 255, 0, 500) end setAccountData(account, "lastSpawnPerm", permission) setElementData(player, "class", class) setElementData(player, "team", teamName) fadeCamera(player, true) setCameraTarget(player, player) outputChatBox("* Usted ha generado con éxito como: ".. class ..".", player, 200, 200, 200, false) local blip = createBlipAttachedTo(player, 0, 2, r, g, b, 255, 0, 300, getRootElement()) setElementVisibleTo(blip, player, false) setPlayerNametagColor(player, r, g, b) if (weapons) then local gun = split(weapons, ",") for i, node in ipairs(gun) do local weapon = split(node, ".") local id = weapon[1] local ammo = weapon[2] giveWeapon(player, id, ammo) end end end end --end addEvent("onPlayerSpawnButton", true) addEventHandler("onPlayerSpawnButton", getRootElement(), playerSpawn) function requestPermissionSuccess(player, restriction, level) local crewLevel = (tonumber(getElementData(player, "crewlevel")) or 0) if not level then level = 0 end if player then if restriction then if (getElementType(player) == "player") then local getRestriction = split(restriction, string.byte(",")) if getRestriction[1] == "none" or getRestriction[1] == "everyone" then for _, v in ipairs(getRestriction) do return true end elseif getRestriction[1] == "gang" or getRestriction[1] == "squad" or getRestriction[1] == "company" or getRestriction[1] == "crew" then if crewLevel >= tonumber(level) then for _, v in ipairs(getRestriction) do local check = tostring(getElementData(player, "crew")) if check == v then return true else triggerClientEvent(player, "onSpawnError", getRootElement(), "Tienes que ser parte de ".. v .." con el fin de acceder a este engendro.") end end end elseif getRestriction[1] == "group" then for _, group in ipairs(getRestriction) do if exports.SAVGacl:isPlayerInGroup(player, group) then return true else triggerClientEvent(player, "onSpawnError", getRootElement(), "Usted no tiene acceso a este engendro porque usted no es parte de este grupo.") end end elseif getRestriction[1] == "acl" then for _, acl in ipairs(getRestriction) do local account = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user."..account, aclGetGroup(getRestriction[2])) then return true else triggerClientEvent(player, "onSpawnError", getRootElement(), "Usted no tiene acceso a este engendro porque usted no es parte de este grupo.") end end elseif getRestriction[1] == "account" then for _, v in ipairs(getRestriction) do local account = getElementData(player, "username") if account == v then return true else triggerClientEvent(player, "onSpawnError", getRootElement(), "Usted no tiene acceso a este engendro porque usted no es parte de este grupo.") end end elseif getRestriction[1] == "wanted" then for _, wanted in ipairs(getRestriction) do local wanted = getElementData(player, "wanted") if getRestriction[2] == "false" and tonumber(wanted) == 0 then return true else triggerClientEvent(player, "onSpawnError", getRootElement(), "Usted necesita perder sus estrellas de búsqueda a fin de desovar a esta clase.") end end end end end end end function initializeSpawns (resourceStarted) if getResourceName(resourceStarted) == "SAVGlogin" or getResourceName(resourceStarted) == "SAVGspawn" then startResource(getResourceFromName("SAVGspawn")) local xml = xmlLoadFile(":SAVGspawn/spawns.xml") local cityNodes = xmlNodeGetChildren(xml) local cities = {} for i,node in ipairs(cityNodes) do local classnodes = xmlNodeGetChildren(node) for i2,node2 in ipairs(classnodes) do local name = xmlNodeGetAttribute(node2, "name") local r = xmlNodeGetAttribute(node2, "r") local g = xmlNodeGetAttribute(node2, "g") local b = xmlNodeGetAttribute(node2, "b") if not getTeamFromName(name) then createTeam( name , r , g , b) end end end xmlUnloadFile(xml) end end addEventHandler("onResourceStart", root, initializeSpawns) function logAllOut() local players = getElementsByType ( "player" ) for k, player in ipairs(players) do account = getPlayerAccount(player) if not isGuestAccount(account) then logOut(player) end end addEventHandler("onPlayerLogout",getRootElement(),loggedOut) end addEventHandler("onResourceStart", resourceRoot, logAllOut) function playerDespawn() local player = source for i,v in ipairs(getAttachedElements(player)) do if getElementType(v) == "blip" and getElementParent(getElementParent(v)) == resourceRoot then destroyElement(v) end end end addEventHandler("onPlayerWasted", getRootElement(), playerDespawn) addEventHandler("onPlayerQuit", getRootElement(), playerDespawn) function saveProperty(a, b, c, playah) local player = playah or source local playeraccount = getPlayerAccount(player) if not isPedDead(player) then local x, y, z = getElementPosition(player) local rot = getPedRotation(player) setAccountData(playeraccount, "x", x) setAccountData(playeraccount, "y", y) setAccountData(playeraccount, "z", z) setAccountData(playeraccount, "rot", rot) local skin = getElementModel(player) setAccountData(playeraccount, "skin", skin) local team = getTeamName(getPlayerTeam(player)) setAccountData(playeraccount, "team", team) local weaponsarray = {} for i=1, 12 do if(getPedWeapon(player, i) ~= 0 and getPedTotalAmmo(player, i) > 0) then table.insert(weaponsarray, getPedWeapon(player, i) .. "." .. getPedTotalAmmo(player, i)) end end local weaponstring = table.concat(weaponsarray,",") setAccountData(playeraccount, "weapons", weaponstring) setAccountData(playeraccount, "aliveonquit", true) setAccountData(playeraccount, "class", getElementData(player, "class")) local r,g,b = getPlayerNametagColor(player) setAccountData(playeraccount, "r", r) setAccountData(playeraccount, "g", g) setAccountData(playeraccount, "b", b) local dimension = getElementDimension(player) local interior = getElementInterior(player) setAccountData(playeraccount, "interior", interior) setAccountData(playeraccount, "dimension", dimension) local health = getElementHealth(player) setAccountData(playeraccount, "health", health) else setAccountData(playeraccount, "aliveonquit", false) setAccountData(playeraccount, "x", nil) setAccountData(playeraccount, "y", nil) setAccountData(playeraccount, "z", nil) setAccountData(playeraccount, "permission", nil) setAccountData(playeraccount, "team", nil) setAccountData(playeraccount, "skin", nil) setAccountData(playeraccount, "weapons", nil) setAccountData(playeraccount, "class", nil) setAccountData(playeraccount, "r", nil) setAccountData(playeraccount, "g", nil) setAccountData(playeraccount, "b", nil) setAccountData(playeraccount, "rot", nil) setAccountData(playeraccount, "dimension", nil) setAccountData(playeraccount, "interior", nil) setAccountData(playeraccount, "health", nil) end end addEventHandler("onPlayerQuit", getRootElement(), saveProperty) function wasPlayerAlive() if getAccountData(getPlayerAccount(source), "aliveonquit") then local playerAccount = getPlayerAccount(source) local x = getAccountData(playerAccount, "x") local y = getAccountData(playerAccount, "y") local z = getAccountData(playerAccount, "z") local rot = getAccountData(playerAccount, "rot") local team = getAccountData(playerAccount, "team") local permission = getAccountData(playerAccount, "lastSpawnPerm") local skin = getAccountData(playerAccount, "skin") local weps = getAccountData(playerAccount, "weapons") local skinName = getAccountData(playerAccount, "class") local r = getAccountData(playerAccount, "r") local g = getAccountData(playerAccount, "g") local b = getAccountData(playerAccount, "b") local dim = getAccountData(playerAccount, "dimension") local int = getAccountData(playerAccount, "interior") local health = getAccountData(playerAccount, "health") local level = getElementData(source, "crewlevel") playerSpawn(x , y , z, team, permission, skin, weps, source, skinName, r, g, b, rot, dim, int, level) setElementHealth(source, health) else showSpawnScreen(source) end end addEvent("wasPlayerAliveEvent", true) addEventHandler("wasPlayerAliveEvent", getRootElement(), wasPlayerAlive) function loggedOut() cancelEvent() end function stopdown() local players = getElementsByType("player") for i, player in ipairs(players) do saveProperty(nil, nil, nil, player) killPed(player) logOut(player) end end addEventHandler("onResourceStop", resourceRoot, stopdown) function showSpawnScreen(player) local account = getPlayerAccount(player) local houses = exports.SAVGhousing:getAccountHouses(account) triggerClientEvent(player, "SAVG.showDeathScreen", player, houses) setElementData(player,"reanimation",false) setElementData(player,"reanimationtime",true) end addEventHandler("onPlayerWasted", root, function() showSpawnScreen(source) end) function vista(player) local account = getPlayerAccount(player) local houses = exports.SAVGhousing:getAccountHouses(account) triggerClientEvent(player, "showSpawn", player, houses) end addEvent("eli",true) addEventHandler("eli",root,vista) Hospital = { -- {x,y,z,rot} {2033,-1404,17.3,180}, {1173,-1323.6,15.4,270}, {-2656,636,14.5,180}, {-1514.6,2521.8,55.9,0}, {-320,1055,19.8,0}, {1607.4,1817.4,10.9,0}, {-2200.7,-2312.4,30.7,0} } function findNearestHospital(player) distanceToHospital = 9999999999 local wastedX, wastedY, wastedZ = getElementPosition(player) for k, v in ipairs(Hospital) do local loopX,loopY,loopZ,loopRot = v[1],v[2],v[3],v[4] newDistance = getDistanceBetweenPoints3D(wastedX,wastedY,wastedZ,loopX,loopY,loopZ) if newDistance < distanceToHospital then distanceToHospital = newDistance hospitalX = loopX hospitalY = loopY hospitalZ = loopZ hospitalRot = loopRot end end return hospitalX, hospitalY, hospitalZ, hospitalRot end function ok(savedWeapons) local skin = getPedSkin(source) local team = getPlayerTeam(source) local r, g, b = getPlayerNametagColor(source) local spawnX,spawnY,spawnZ,posRot = findNearestHospital(source) createBlipAttachedTo(source, 0, 2, r, g, b, 255, 0, 400) setPlayerNametagColor(source, r, g, b) spawnPlayer (source, spawnX, spawnY, spawnZ + 1, posRot, skin, 0, 0, team) for i, t in ipairs(savedWeapons) do giveWeapon(source, t[1], t[2]) end setCameraTarget(source,source) end addEvent("SPAWNATHOSIPTAL",true) addEventHandler("SPAWNATHOSIPTAL",root,ok) function reanimatePlayer(savedWeapons, dimP, intP) setElementData(source, "reanimation", false) setElementData(source, "time", false) local skin = getPedSkin(source) local team = getPlayerTeam(source) local r, g, b = getPlayerNametagColor(source) local posX, posY, posZ = getElementPosition(source) createBlipAttachedTo(source, 0, 2, r, g, b, 255, 0, 400) setPlayerNametagColor(source, r, g, b) spawnPlayer (source, posX, posY, posZ + 1, 0, skin, 0, 0, team) setElementInterior(source, intP) setElementDimension(source, dimP) setElementHealth(source, 30) for i, t in ipairs(savedWeapons) do giveWeapon(source, t[1], t[2]) end fadeCamera(source, true) setCameraTarget(source, source) end addEvent("REANIMATEPLAYER",true) addEventHandler("REANIMATEPLAYER",root,reanimatePlayer) function hola() showCursor ( source, false ) end addEventHandler("onPlayerLogin", root,hola)
  2. Hago los dos paso que me acabas de decir, y aun no se soluciona! Eso lo lei en https://wiki.multitheftauto.com/wiki/Authorized_Serial_Account_Protection y hice todo y aun no me da los permisos de admin
  3. Sin ofender pero eso fue una respuesta tonta, ya que uno se da el admin antes de abrir el server, y pues eso me sale en la consola justo cuando el servidor se termina de iniciar, mientras carga no da errores pero al terminar de cargar los scripts me sale ese mensaje y me bloquea el admin ami ._.
  4. Hola a todos, como elimino este bloqueo? o como autorizo? Me registro al acl y no me da admin en el server, Intente cambiar en mtaserver que en vez de authserial a "admin" lo coloque como "moderador" y aun asi no me da admin, Como si mi pc estuviera negada! Y lo curioso es que hace 5 horas si iba, desinstale mta porque se me dañaron algunos archivos y no hice copia de seguridad y los necesitaba otra vez, pero ya despues de anda mas! y ya lo he instalado 2 veces mas y nada Error https://imgur.com/aKQlK4A.png Gracias Antemano!
  5. Hola comprare un host para mi server, y veo que en tapleto host hay un plan de 50 players por 1,95$ quisiera saber si es verdad o es scam? No quiero perder lo poquito que tengo para mi server :c Gracias
  6. Se que no es el tema ni categoria, pero pienso estudiar Informatica para dedicarme ala Programacion de Videojuegos, Muchos me dicen que aprenda desde ya a manejar algo almenos lo basico el lenguaje C# y C++ Pero no tengo idea de donde empezar! No se si ver tutoriales de como programar Juegos en c++ o leer pero no se si la informacion que lea sea correcta! Si alguien estudio o sabe programar en ese lenguaje por favor ayudenme y aclarenme por donde podria empezar :c Gracias