-
Posts
611 -
Joined
-
Last visited
Everything posted by AlvareZ_
-
Creo que seria una buena forma de crearlo. Gracias por responder, Cualquier cosa posteare aqui!
-
Buenas, Mi pregunta es la siguiente, Como podría crear un inventario Lo creare en GUI, Lo que quiero lograr es que dentro del mismo te salgan todas tus armas y aparte recipientes de aguas y comida, para esto se creara una barra indicadora que mide el nivel de agua al igual que el de comida esta ira disminuyendo con el tiempo y el agua y la comida se encontrara mediante un paquete. Se que es complicado pero estoy dispuesto a crearlo.
-
Debiste cambiar false por true. function onFire() setPedControlState(localPlayer, "fire", true) end addEventHandler("onResourceStart", getRootElement(), onFire) así funcionaria, no?
-
Recién me di cuenta que era client, me siento algo idiota. Gracias A tu orden!
-
Primero debes crear un ColShape, luego verificar si el jugador esta dentro de la zone para poder crearle el evento del comando CreateColRectangle addCommandHandler
-
function onFire() setPedControlState(localPlayer, "fire", false) end addEventHandler("onResourceStart", getRootElement(), onFire)
-
puedes usar el level_system de castillo: https://community.multitheftauto.com/index.php?p=resources&s=details&id=1253 Y para conocer como usarlo: https://wiki.multitheftauto.com/wiki/Resource:Exp_system
-
Exacto, de esta forma: spawnPlayer ( thePlayer, X, Y, Z, 0, 254) De hay lo puedes completar, La idea es aprender.
-
Usa esto: if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then
-
onPlayerJoin spawnPlayer
-
Pero podrias usar ese script para guiarte y crearlos por todas las ciudad
-
Ese script viene por defecto en tu servidor de MTA:SA con el nombre de traffic
-
Creo que se te sera difícil encontrar un scripter de buena calidad sin ninguna recompensa de dinero o algo, Pero buena suerte.
-
Los shaders simplemente son sombreadores, Se utilizan para realizar efectos especiales.
-
Como dijo Tomas, Si quieres usar el mismo interior simplemente cambia la dimensión del jugador y listo!
-
Tienes que ubicar cada una de las ventanas y ubicarlas en la dimensión 1, Si no me equivoco
-
Podrías obtener si el jugador ya se ha registrado antes y devolverle su skin o si no darle uno nuevo con esta función: getAccountData
-
Hi guys, I have this Script, But when i press "Jugar", Dont Spawn, please help me! Client: local x, y = guiGetScreenSize() SkinAnims = {"Invite_Yes","prtial_gngtllkG","Invite_No"} NewSkin = false StartSkin = 254 function SelectSkin () setCameraMatrix( -1278.16663, 46.63542, 32.40625, -1278.73425, 44.20432, 32.40625) skin = createPed ( StartSkin, -1278.73425, 44.20432, 32.40625,-10 ) setElementInterior ( getLocalPlayer(), 0) setPedFrozen(skin, true) stopSound(Music) setPedAnimation( skin, "GANGS", SkinAnims[math.random(1,3)]) fadeCamera( true, 10) setTime(0,0) removeEventHandler("onClientPreRender", root, interpolateCam1) removeEventHandler("onClientPreRender", root, interpolateCam) SkinSelectMusic = playSound("main2.mp3") showCursor(true) showChat(false) guiSetVisible(lnextskin, true) guiSetVisible(rnextskin, true) guiSetVisible(spawnskin, true) showPlayerHudComponent ( "radar", false ) end addEvent("allLogear", true) addEventHandler("allLogear", getLocalPlayer(), SelectSkin) function onClickSkin() if (source == rnextskin) then if getElementModel(skin) == 254 and (source == rnextskin) then setElementModel(skin, 287) elseif getElementModel(skin) == 287 and (source == rnextskin) then setElementModel(skin, 247) elseif getElementModel(skin) == 247 and (source == rnextskin) then setElementModel(skin, 248) elseif getElementModel(skin) == 248 and (source == rnextskin) then setElementModel(skin, 262) elseif getElementModel(skin) == 262 and (source == rnextskin) then setElementModel(skin, 253) elseif getElementModel(skin) == 253 and (source == rnextskin) then setElementModel(skin, 260) elseif getElementModel(skin) == 260 and (source == rnextskin) then setElementModel(skin, 249) elseif getElementModel(skin) == 249 and (source == rnextskin) then setElementModel(skin, 277) elseif getElementModel(skin) == 277 and (source == rnextskin) then setElementModel(skin, 274) elseif getElementModel(skin) == 274 and (source == rnextskin) then setElementModel(skin, 288) elseif getElementModel(skin) == 288 and (source == rnextskin) then setElementModel(skin, 259) elseif getElementModel(skin) == 259 and (source == rnextskin) then setElementModel(skin, 283) elseif getElementModel(skin) == 283 and (source == rnextskin) then setElementModel(skin, 254) end end end addEventHandler("onClientGUIClick", root, onClickSkin) function onClickSkin2() if (source == lnextskin) then if getElementModel(skin) == 283 then setElementModel(skin, 259) elseif getElementModel(skin) == 259 and (source == lnextskin) then setElementModel(skin, 288) elseif getElementModel(skin) == 288 and (source == lnextskin) then setElementModel(skin, 2274) elseif getElementModel(skin) == 274 and (source == lnextskin) then setElementModel(skin, 277) elseif getElementModel(skin) == 277 and (source == lnextskin) then setElementModel(skin, 249) elseif getElementModel(skin) == 249 and (source == lnextskin) then setElementModel(skin, 260) elseif getElementModel(skin) == 260 and (source == lnextskin) then setElementModel(skin, 253) elseif getElementModel(skin) == 253 and (source == lnextskin) then setElementModel(skin, 262) elseif getElementModel(skin) == 262 and (source == lnextskin) then setElementModel(skin, 248) elseif getElementModel(skin) == 248 and (source == lnextskin) then setElementModel(skin, 247) elseif getElementModel(skin) == 247 and (source == lnextskin) then setElementModel(skin, 287) elseif getElementModel(skin) == 287 and (source == lnextskin) then setElementModel(skin, 254) elseif getElementModel(skin) == 254 and (source == lnextskin) then setElementModel(skin, 283) end end end addEventHandler("onClientGUIClick", root, onClickSkin2) function SpawnPlayer() if (source == spawnskin) then local r,g,b = math.random(0,255),math.random(0,255),math.random(0,255) triggerServerEvent ( "onClientWantsToSpawn", getLocalPlayer(), getLocalPlayer(),StartSkin,r,g,b ) unbindKey("arrow_r","down",NextSkin) unbindKey("arrow_l","down",LastSkin) unbindKey("lshift","down",SpawnPlayer) setTime(12,0) stopSound(SkinSelectMusic) removeEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) showCursor(false) showChat(true) showPlayerHudComponent ( "radar", true ) guiSetVisible(lnextskin,false) guiSetVisible(rnextskin,false) guiSetVisible(spawnskin,false) setElementData(getLocalPlayer(),"red",r) setElementData(getLocalPlayer(),"green",g) setElementData(getLocalPlayer(),"blue",b) end end lnextskin = guiCreateButton(0.30, 0.46, 0.09, 0.10, "<<",true) guiSetProperty(lnextskin,"PushedTextColour","FFFFFF00") guiSetFont(lnextskin,"sa-header") guiSetVisible(lnextskin, false) rnextskin = guiCreateButton(0.62, 0.46, 0.09, 0.10, ">>",true) guiSetProperty(rnextskin,"PushedTextColour","FFFFFF00") guiSetFont(rnextskin,"sa-header") guiSetVisible(rnextskin, false) spawnskin = guiCreateButton(0.42, 0.88, 0.16, 0.09, "Jugar",true) guiSetProperty(spawnskin,"PushedTextColour","FFFFFF00") guiSetFont(spawnskin,"sa-header") guiSetVisible(spawnskin, false) Server: addEventHandler("onPlayerLogin", root, function() triggerClientEvent("allLogear", source) end) function SpawnPlayer(thePlayer,skin,r,g,b) spawnPlayer ( thePlayer, 1539.7673339844,-1352.8256835938,329.46545410156, 90.0, skin ) setCameraTarget (source, source) createBlipAttachedTo(source,0,2,r,g,b) setPlayerMoney(thePlayer,StartMoney) playerSkin[thePlayer] = {skin,r,g,b} setElementData(thePlayer,"Score",0) setPlayerNametagShowing ( thePlayer, false) end addEvent( "onClientWantsToSpawn", true ) addEventHandler( "onClientWantsToSpawn", getRootElement(), SpawnPlayer ) addEventHandler ( "onPlayerQuit", getRootElement(), function() local attachedElements = getAttachedElements ( source ) if ( attachedElements ) then for k,v in ipairs ( attachedElements ) do if ( getElementType ( v ) == "blip" ) then destroyElement(v) else end end end end) function PlayerDied(ammo,killer) if killer and getElementType ( killer ) == "player" then setPlayerMoney(killer,getPlayerMoney(killer)+CashForKill) local Score = getElementData(killer,"Score") setElementData(killer,"Score",Score+1) end setTimer(PlayerRespawn,1000,1,source) end addEventHandler("onPlayerWasted",getRootElement(),PlayerDied) function FixPlayerVehicle(hitElement,number) local money = getPlayerMoney(hitElement) if money < PayNSprayCost then outputChatBox("*PM: You don't have enought cash.",hitElement,170,0,0,true) else if getPedOccupiedVehicle(hitElement) then local vehicle = getPedOccupiedVehicle(hitElement) fixVehicle(vehicle) playSoundFrontEnd(hitElement,16) toggleAllControls(hitElement,false) setPlayerMoney(hitElement,money-PayNSprayCost) local vehicle = getPedOccupiedVehicle(hitElement) setElementFrozen(vehicle,true) setTimer(function() toggleAllControls(hitElement,true) setCameraTarget (hitElement, hitElement) setElementFrozen(vehicle,false) end,2500,1) if number == 1 then setCameraMatrix(hitElement,1032.7685546875,-1039.337890625,45.220012664795,1030.095703125,-1027.6357421875,40.220008850098) elseif number == 2 then setCameraMatrix(hitElement,489.150390625,-1728.8310546875,31.169326782227,488.6884765625,-1734.04296875,21.179261207581) elseif number == 3 then setCameraMatrix(hitElement,2076.5859375,-1831.4208984375,18.546875,2072.626953125,-1831.361328125,18.546875) else end end end end addEvent( "onBoughtWeapon", true ) addEventHandler( "onBoughtWeapon", getRootElement(), function(thePlayer,id,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) if id == 500 then setPedArmor ( thePlayer, 100 ) else giveWeapon ( thePlayer, id, 120 ) end end) addEvent( "onBoughtBurger", true ) addEventHandler( "onBoughtBurger", getRootElement(), function(thePlayer,cash) setPlayerMoney(thePlayer,getPlayerMoney(thePlayer)-cash) setElementHealth(thePlayer,getElementHealth(thePlayer)+cash) if getElementHealth > 100 then setElementHealth(thePlayer,100) end end)
-
Now i cant select any row in the 2 gridlist, Thanks for answer guy.
-
Like this? row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) if ( row and col and row ~= 1 and col ~= -1 ) then grid = guiGridListGetItemText (GUIEditor.gridlist[1], row, 1 )
-
Hi Guys, i got this, But when i prees the button Spawn, Have a bug, ( Bad Argument @ 'guiGirdListGetSelectedItem' [Expected gui-grodlist at argument 1 got gui-button], I want to know how i can get gridlist selected and then press the botton and then spawn a player, Help me Please, Thanks Guys. Client: function monstarCamaras() row1, col1 = guiGridListGetSelectedItem ( GUIEditor.gridlist[2] ) skinName = guiGridListGetItemText ( GUIEditor.gridlist[2], row1, col1 ) triggerServerEvent ( "onPlayerChooseSkin", getLocalPlayer(), skinName ) row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= 1 and col ~= -1 ) then grid = guiGridListGetItemText ( source, row, 1 ) if ( grid == "Los Santos" ) then guiGridListClear ( GUIEditor.gridlist[2] ) rowGrupoPolice = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice, grupos, "Los Santos Down Town", false, false ) rowGrupoPolice1 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice1, grupos, "Los Santos Aiport", false, false ) elseif ( grid == "San Fierro" ) then guiGridListClear ( GUIEditor.gridlist[2] ) rowGrupoPolice2 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice2, grupos, "San Fierro Down Town", false, false ) rowGrupoPolice12 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice12, grupos, "San Fierro Aiport", false, false ) elseif ( grid == "Las Venturas" ) then guiGridListClear ( GUIEditor.gridlist[2] ) rowGrupoPolice21 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice21, grupos, "Las Venturas Down Town", false, false ) rowGrupoPolice121 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice121, grupos, "Las Venturas Aiport", false, false ) elseif ( grid == "Other's Spawn" ) then guiGridListClear ( GUIEditor.gridlist[2] ) rowGrupoPolice223 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice223, grupos, "Mount Chilliad", false, false ) end end end addEventHandler( "onClientGUIClick", resourceRoot, monstarCamaras) GUIEditor = { gridlist = {}, window = {}, boton = {}, button = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(0.77, 0.00, 0.23, 1.00, "Selecciona donde quieres Aparecer", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(0.02, 0.03, 0.48, 0.06, "Ciudad:", true, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "sa-header") GUIEditor.gridlist[1] = guiCreateGridList(0.03, 0.09, 0.94, 0.28, true, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Ciudad:", 0.9) for i = 1, 4 do guiGridListAddRow(GUIEditor.gridlist[1]) end guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "Los Santos", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "Las Venturas", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "San Fierro", false, false) guiGridListSetItemText(GUIEditor.gridlist[1], 3, 1, "Other's Spawn", false, false) GUIEditor.label[2] = guiCreateLabel(0.03, 0.39, 0.48, 0.06, "Lugar:", true, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "sa-header") GUIEditor.gridlist[2] = guiCreateGridList(0.03, 0.46, 0.94, 0.29, true, GUIEditor.window[1]) grupos = guiGridListAddColumn(GUIEditor.gridlist[2], "Lugar:", 0.9) boton = guiCreateButton(0.12, 0.79, 0.77, 0.11, "Spawn", true, GUIEditor.window[1]) guiSetFont(boton, "sa-header") GUIEditor.label[3] = guiCreateLabel(0.33, 0.91, 0.89, 0.07, "iSG//", true, GUIEditor.window[1]) guiSetFont(GUIEditor.label[3], "sa-header") Server: function Spawn(skinName) if skinName == "Los Santos Down Town" then setCameraMatrix(source, 1483.1064453125, -1760.2861328125, 25.795755386353, 1481.1064453125, -1769.2861328125, 18.795755386353) elseif skinName == "Los Santos Aiport" then setCameraMatrix(source, 2075.6181640625, -2565.09765625, 20.546875, 2080.6181640625, -2570.09765625, 13.546875) elseif skinName == "San Fierro Down Town" then setCameraMatrix(source, -1818.595703125, 540.4033203125, 40.1640625, -1821.595703125, 554.4033203125, 35.1640625) elseif skinName == "San Fierro Aiport" then setCameraMatrix(source, -1260.654296875, -280.7490234375, 10.1484375, -1271.654296875, -291.7490234375, 14.1484375) elseif skinName == "Las Venturas Down Town" then setCameraMatrix(source, 2075.6181640625, 1940.806640625, 1330.91015625, 20.374607086182, 1953.806640625, 1342.91015625, 15.374607086182) elseif skinName == "Las Venturas Aiport" then setCameraMatrix(source, 1310.646484375, 1240.892578125, 18.8203125, 1319.646484375, 1251.892578125, 10.8203125) elseif skinName == "Mount Chilliad" then setCameraMatrix(source, -2360.1025390625, -1620.6142578125, 500.63662719727, -2349.1025390625, -1613.6142578125, 483.63662719727) end end addEvent("onPlayerChooseSkin", true) addEventHandler("onPlayerChooseSkin", root, Spawn)
-
boton = guiCreateButton(0.12, 0.79, 0.77, 0.11, "Spawn", true, GUIEditor.window[1])
-
Hola, Como estan?, Estube un tiempo alejado de los scripts y de el Foro, Peor me he decidido volver a esto de el script, estuve creando un spawn pero se me presento un problema, Yo tengo 2 gridlist creadas 1 con las ciudades y otra para los lugares entonces al darle a la ciudad en la segunda gridlist me cree los lugares pero el problema es que al darle a el boton de spawn me da y no sucede nada Gracias de ante mano function monstarCamaras() row1, col1 = guiGridListGetSelectedItem ( GUIEditor.gridlist[2] ) skinName = guiGridListGetItemText ( GUIEditor.gridlist[2], row1, col1 ) triggerServerEvent ( "onPlayerChooseSkin", getLocalPlayer(), skinName ) row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then grid = guiGridListGetItemText ( GUIEditor.gridlist[1], row, 1 ) if ( grid == "Los Santos" ) then guiGridListClear ( GUIEditor.gridlist[2] ) rowGrupoPolice = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice, grupos, "Los Santos Down Town", false, false ) rowGrupoPolice1 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice1, grupos, "Los Santos Aiport", false, false ) elseif ( grid == "San Fierro" ) then guiGridListClear ( GUIEditor.gridlist[2] ) rowGrupoPolice2 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice2, grupos, "San Fierro Down Town", false, false ) rowGrupoPolice12 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice12, grupos, "San Fierro Aiport", false, false ) elseif ( grid == "Las Venturas" ) then guiGridListClear ( GUIEditor.gridlist[2] ) rowGrupoPolice21 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice21, grupos, "Las Venturas Down Town", false, false ) rowGrupoPolice121 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice121, grupos, "Las Venturas Aiport", false, false ) elseif ( grid == "Other's Spawn" ) then guiGridListClear ( GUIEditor.gridlist[2] ) rowGrupoPolice223 = guiGridListAddRow ( GUIEditor.gridlist[2] ) guiGridListSetItemText ( GUIEditor.gridlist[2], rowGrupoPolice223, grupos, "Mount Chilliad", false, false ) end end end addEventHandler( "onClientGUIClick", resourceRoot, monstarCamaras) function hola() if ( skinName == "Los Santos Down Town" ) then triggerServerEvent("spawnLSdt", localPlayer) end end addEventHandler( "onClientGUIClick", boton, hola, false)
