Carlossg
Members-
Posts
162 -
Joined
-
Last visited
Everything posted by Carlossg
-
Por favor, me podrías decir enque está mal mi script,te lo agradecería. Por si sirve yo pensé que quería que le pusiera a el mismo player(osea el que juega) si está muteado.
-
¿A quién se supone que esta el isPlayerMuted? El argumento no está definido(eso creo),puede ser que me equivoque EDITO: Toma, creo que este codigo está bien, sólo creo porque soy novato: Client function showing( ) local px, py, pz, tx, ty, tz, dist px, py, pz = getCameraMatrix( ) for _, v in ipairs( getElementsByType 'player' ) do tx, ty, tz = getElementPosition( v ) dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) if dist < 30.0 then if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then local sx, sy, sz = getPedBonePosition( v, 1 ) local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 ) if x and triggerServerEvent ("checker", v) == true then dxDrawText( "Muted ", x, y, x, y, tocolor(150, 0, 0), 0.85 + ( 15 - dist ) * 0.02, "pricedown", "center" ) end end end end end addEventHandler( "onClientRender",root,showing) setTimer (showing, 5000,1) function name() --Añadida funcion para obtener el nombre del jugador name = getPlayerName(getLocalPlayer()) end addEvent("Nombre",true) --Añadida posibilidad para triggearlo desde el server addEventHandler("Nombre",getRootElement(),name) Server function mutecheck ()--Aqui si no funciona prueba a poner entre parentesis Obtener, no lo he puesto porque no estoy seguro Obtener = triggerClientEvent("Nombre",getRootElement())--triggeando al cliente, para saber el nombre. if isPlayerMuted ( Obtener ) then return true else return false end setTimer(mutecheck, 5000,1) addEvent ("checker", true)--Considero que como lo tenías antes está mal, ya que en la wiki sólo tiene 2 argumentos. addEventHandler("checker",getRootElement(), mutecheck) Puede ser que esté mal, soy un desastre , pero intento ayudar.
-
Ahora tengo un problema que es que, cuando pincho en la gui para cargarla, se pone como que se deselecciona y al moverla se quedan los elemntos detrás, como sino estuvieran pegados a la gui, y ya no la puedo tocar, eso me pasa incluso sin el guieditor.
-
Its a marker, called corona, you can create it in map editor .
-
Buenas, hoy me puse a acabar la disposición de la gui que tengo hecha(pero desordenada) con el guieditor, bien abro mi gui, empiezo el recurso guieditor, edito al gusto, pongo /guioutput o el comando, y me genera el archivo de texto pero vacío, sin código, simplemente la fecha y hora que se crearon y unos cuadraditos, ¿Estoy haciendo algo mal? ¿Tiene que ver que los archivos del cliente esten hosteados en una pagina web?
-
I think it's good, but v13 is better and more hard .
-
Bien, tengo un error con el siguiente script: function creatingTables() exports.scoreboard:addScoreboardColumn("Cash") executeSQLCreateTable("playerData", "account STRING, Cash INT, DMAttempts INT, DDAttempts INT") outputChatBox("Cash System by KHD started.") for index, player in ipairs(getElementsByType("player")) do addAccountIfNotExists(player) end end addEventHandler("onResourceStart", resourceRoot, creatingTables) function addAccountIfNotExists(player) local account = getPlayerAccount(player) local CheckPlayer = executeSQLSelect ( "playerData", "*", "account = '" .. account .. "'" ) if ( type( CheckPlayer ) == "table" and #CheckPlayer == 0 ) or not CheckPlayer then executeSQLInsert ( "playerData", "'"..account.."','0','0','0'" ) else local Cash = tonumber(CheckPlayer [1]["Cash"]) setElementData(source,"Cash", Cash) setElementData(source,"data.money",Cash,true) end end addEventHandler("onPlayerJoin",root,function () addAccountIfNotExists(source) end) function DestructionMoney(mapInfo,mapOptions,gameOptions) info = mapInfo.modename if mapInfo.modename == "Destruction derby" then for k,v in ipairs(getElementsByType("player")) do local account = getPlayerAccount(v) local DDAttempts = executeSQLSelect ( "playerData", "DDAttempts","account = '" .. account .. "'") local DDAttempts = tonumber(DDAttempts[1]["DDAttempts"]) + 1 executeSQLUpdate ( "playerData", "DDAttempts = '"..DDAttempts.."'","account = '" .. account .. "'") setElementData(v,"data.DDAttempts",DDAttempts,true) end end end addEvent("onMapStarting") addEventHandler("onMapStarting", getRootElement(), DestructionMoney) function DestructionMoney2(thePlayer) local playername = getPlayerName(thePlayer) local account = getPlayerAccount(thePlayer) local Cash = executeSQLSelect ( "playerData", "Cash","account = '" .. account .. "'") outputChatBox("*Wins: "..playername.." took $"..get('MoneyForDD').." for winning the map!",getRootElement(),255,255,0) local Cash = tonumber(Cash[1]["Cash"]) + get('MoneyForDD') setElementData(thePlayer ,"Cash", Cash) setElementData(thePlayer ,"data.money",Cash,true) setElementData(thePlayer ,"data.playername",playername,true) executeSQLUpdate ( "playerData", "Cash = '"..Cash.."'","account = '" .. account .. "'") end function hunterBonus(pickupID, pickupType, vehicleModel) if (info == "Destruction derby" and pickupType == "vehiclechange" and vehicleModel == 425) then local account = getPlayerAccount(source) local Cash = executeSQLSelect ( "playerData", "Cash","account = '" .. account .. "'") local Cash = tonumber(Cash[1]["Cash"]) + 1000 outputChatBox("*Hunter: "..getPlayerName(source).." gets a $1000 hunter bonus!",source,25,125,225,true ) setElementData(source ,"Cash", Cash) setElementData(source ,"data.money",Cash,true) executeSQLUpdate ( "playerData", "Cash = '"..Cash.."'","serial = '" .. serial .. "'") end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),hunterBonus) addCommandHandler("cash", function (thePlayer) local money = tonumber(getElementData(thePlayer,"data.money")) if (money) then outputChatBox("Your money is $".. tostring(money) .."!",thePlayer,0,255,0) end end) ERROR: [gameplay]\cash-KHD\cash.lua:31: attempt to concatenate local 'account' (a userdata value) El caso esque antes funcionaba bien, usaba serial envez de cuentas, pero ahora para hacer el server mas profesional, con su login y todo, lo he tenido que cabiar y no va...
-
I'm now trying this: addEventHandler ( "onPlayerJoin", root, function ( ) local randomPlayer = getRandomPlayer ( ) if randomPlayer == source then outputChatBox ( "Sorry", source) else outputChatBox ( "Good job") end setCameraTarget( source,randomPlayer) end ) But it isn't working.
-
mtasa://188.77.34.142:22003 Por si alguien quiere probarlo.
-
addEventHandler ( "onPlayerJoin", root, function ( ) local randomPlayer = getRandomPlayer ( ) local x, y, z = getElementPosition( randomPlayer ) if randomPlayer == source then outputChatBox ( "Sorry", source) else outputChatBox ( "Good job") end setCameraMatrix ( source, x, y, z) end ) He visto que con el GetCameraMatrix, no funciona sin haberlo puesto antes y he usado getElemenPosition, pero no funciona.
-
addEventHandler ( "onPlayerJoin", root, function ( ) local randomPlayer = getRandomPlayer ( ) local x, y, z, lx, ly, lz, wex, wey = getCameraMatrix( randomPlayer ) setCameraMatrix ( source, x, y, z, lx, ly, lz, wex, wey ) end ) WARNING: [gameplay]\Camera\camera.lua:5: Bad argument @ 'setCameraMatrix'
-
Server-side: function spawnmcc () local grupomcc = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..grupomcc, aclGetGroup ( "MCC" ) ) then spawnPlayer (thePlayer, 0, 0, 5, 0, 204, 0, 0, MCC) end addEvent( "callingSpawn", true ) addEventHandler( "callingSpawn", getRootElement(), spawnmcc ) Client-side: function callingSpawnmcc () triggerServerEvent ( "callingSpawn", getLocalPlayer()) end addEventHandler ( "onClientGUIClick", button1, callingSpawnmcc, true )
-
Sí, anoser que haya tan mala suerte que haya cogido al que ha entrado...
-
addEventHandler ( "onPlayerJoin", root, function ( ) local randomPlayer = getRandomPlayer ( ) local x, y, z, lx, ly, lz, wex, wey = getCameraMatrix( randomPlayer ) setCameraMatrix ( source, x, y, z, lx, ly, lz, wex, wey ) end ) WARNING: [gameplay]\Camera\camera.lua:5: Bad argument @ 'setCameraMatrix'
-
¿Alguien esta aburrido y quiere probarlo? mtasa://188.77.34.142:22003
-
Te pongo un ejemplo, un server llamado SAUR mientras se te descargan unos archivos ves una vista de pájaro de la ciudad
-
Y como se pondría en otro, con que argumento. Alexs: Esta server-side, deberría de funcionar.
-
addEventHandler ( "onPlayerJoin", root, function ( ) local x, y, z, lx, ly, lz, wex, wey = getCameraMatrix( source) setCameraMatrix ( source, x, y, z, lx, ly, lz, wex, wey ) end ) No funciona, cuando un jugador entra, mientras se descargan unos archivos no puede verme
-
addEventHandler ( "onPlayerJoin", root, function ( ) local x, y, z, lx, ly, lz = getCameraMatrix( player ) setCameraMatrix ( player, x, y, z, lx, ly, lz ) end ) WARNING: [gameplay]\Camera\camera.lua:3: Bad argument @ 'getCameraMatrix' WARNING: [gameplay]\Camera\camera.lua:4: Bad argument @ 'setCameraMatrix' Cuando se une un jugador tira esos errores.
-
local x, y, z, lx, ly, lz = getCameraMatrix( source ) addEventHandler ( "onPlayerJoin", root, function ( ) setCameraMatrix ( player, x, y, z, lx, ly, lz ) end ) WARNING: [gameplay]\Camera\camera.lua:1: Bad argument @ 'getCameraMatrix'
