-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
I used "getTeamName" and there was about 18 pages.
-
Para eso podes usar las funciones de DX drawing o las funciones de GUI. https://wiki.multitheftauto.com/wiki/Cli ... _functions https://wiki.multitheftauto.com/wiki/Cli ... _functions
-
You should have used the 'search' feature, there was a lot of topics related to this. Example: viewtopic.php?f=91&t=37436&p=385716&
-
No se puedo cambiar de tamaño de los mensajes del chat. Pero podes usar las funciones de texto server side: https://wiki.multitheftauto.com/wiki/Ser ... _functions
-
La verdad es que no, porque spawnPlayer es solo server side.
-
El no pregunto por como ponerlo en el client side... local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10 function joinHandler() spawnPlayer(source, spawnX, spawnY, spawnZ) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Bienvenido al servidor", source, 0, 255, 0) -- R = 0, G = 255, B = 0. end addEventHandler("onPlayerJoin", getRootElement(), joinHandler)
-
function Peds () mafia = createPed (111, 0, 0, 0, 0) -- Last '0' is the rotation. setElementInterior (mafia, 10, 1994.0821533203, 1017.4099121094, 994.890625 ) setPedVoice (mafia, "PED_TYPE_DISABLED") setElementFrozen (mafia, true) setElementDimension (mafia, 0) end addEventHandler("onClientResourceStart", resourceRoot, Peds) The ped spawns with no problems here.
-
You could search on https://community.multitheftauto.com/ for resources. Example: Here's a job resources made by JR10: https://community.multitheftauto.com/index.php?p= ... ls&id=2484
-
local alreadyWon = false local wordsTable = { 'SoldSnake14' 'Evil-Cod3r' } local word = "" function setRandomWord() word = wordsTable[math.random(#wordsTable)] outputChatBox("Write: ".. word .." to get some money!",root,255,255,0) alreadyWon = false setTimer(setRandomWord,60000,1) end setTimer(setRandomWord,60000,1) addEventHandler('onPlayerChat',root, function(message, messageType) if (messageType == 0 and message == word) then if ( not alreadyWon ) then local win = math.random (1, 100) alreadyWon = true word = "" givePlayerMoney(source, win) outputChatBox(getPlayerName(source) .." was The First Player and got $".. win.. "!",root,255,255,0,false) else outputChatBox("Next Time Try To Be More Faster !",source,255,0,255,false) end end end ) Every 60 seconds a random word will be set.
-
You can make a table with letters and numbers and then randomize it with math.random, there's another way if I'm right, but this should be easier for you. And no, it'll only give to the player who won.
-
Replace racevoting_server.lua with this one: http://pastebin.com/UBYXHh8K
-
local alreadyWon = false local msg = "money" addEventHandler('onPlayerChat',root, function(message, messageType) if (messageType == 0 and message == msg) then if ( not alreadyWon ) then local win = math.random (1, 100) alreadyWon = true givePlayerMoney(source, win) outputChatBox(getPlayerName(source) .." was The First Player and got $".. win.. "!",root,255,255,0,false) else outputChatBox("Next Time Try To Be More Faster !",source,255,0,255,false) end end end )
-
I guess it's some kind of bug with your game mode (vG).
-
It works perfectly fine here, are you sure you set client as client side and server as server side, right?
-
Primero: Deja de hacer mas de un post seguido. Segundo: Te olvidaste de las comillas en "startMySound3". Tercero: function startMySound() sound = playSound( "http://escapadehigh.com/Stuff/Pump.mp3", true ) end function stopMySound() if isElement(sound) then destroyElement(sound) end addCommandHandler ( "pararbyp", stopMySound ) addCommandHandler ( "escucharbyp", startMySound ) ---------------------------------------------------------------------------------------------------------------------------------- function startMySound2() sound = playSound( "http://tubefot.com/discografias/farruko/Fuego%20Ft.%20Farruko%20-%20Una%20Vaina%20Loca%20(Official%20Remix)%20%20([url=http://WWW.ELGENERO.COM]http://WWW.ELGENERO.COM[/url]).mp3", true ) end function stopMySound2() if isElement(sound) then destroyElement(sound) end addCommandHandler ( "pararfr", stopMySound2 ) addCommandHandler ( "escucharfr", startMySound2 ) -------------------------------------------------------------------------------------------------------------------------------- function startMySound3() sound = playSound( "http://spm77.free.fr/Music/David%20Guetta%20-%20One%20More%20Love%20(2010)%20-%20Dance/103-david_guetta_feat_akon-sexy_bitch.mp3", true ) end function stopMySound3() if isElement(sound) then destroyElement(sound) end addCommandHandler ( "parardg", stopMySound3 ) addCommandHandler ( "escuchardg", startMySound3 )
-
Just use the 'gang' element data or use the exported function: getAccountGang( accountName ).
-
What exactly doesn't work? P.S: Copy server side, I changed applyAnimation ( to reset ) to: removeAnimation.
-
As far as I know, Benxamix didn't said that. About your question: I didn't want to add anything ACL related to avoid people from saying it can be abused to gain admin rights on their servers or something similar. Also, using the ACL wouldn't be that efficient I think.
-
Try removing 'source' from the function.
-
Well, the onPlayerChat is triggered when someone says something on chat, but not when you just press 'enter' without saying anything, so you need to use this: -- client side: addEventHandler("onClientKey",root, function (key, state) if (key == "t" and state) then triggerServerEvent("setAnimation",localPlayer,true) elseif (key == "enter" and state) then triggerServerEvent("setAnimation",localPlayer,false) end end ) -- server side: addEvent("setAnimation",true) addEventHandler("setAnimation",root, function (state) if (state) then exports.global:applyAnimation( source, "SWIM", "Swim_Glide", 2000, false, false, false) else exports.global:removeAnimation( source ) end end ) I tested it with setPedAnimation function, I hope applyAnimation works the same way.
-
What game mode are you using? race?
-
@Yakuza: Deberias leer lo que dice sobre el evento onClientPlayerJoin. addEventHandler("onClientResourceStart", resourceRoot, function () playSound("tumusica.mp3", true) -- el true define si quieres que se repita, si no quieres que se repita pones false end ) Necesitas usar onClientResourceStart, asi cuando el recurso se inicia el sonido empieza.
-
It's ok, better two options, if one fails, you try the second option .
-
@Dev27: My script does the same but different way.
-
Multiplier = 1.3 marker1 = createMarker(-6558.2998046875, 2801.099609375, 706.09997558594 , "cylinder" , 29, 0, 0, 204, 0) marker2 = createMarker(-6177.599609375, 2761.2998046875, 691.09997558594 , "cylinder" , 1, 255, 0, 0, 255) marker3 = createMarker(-6176.8994140625, 2735.7998046875, 655.40002441406 , "corona" , 1, 0, 255, 0, 255) function MarkerHit (player) if (source == marker1) then if (player ~= localPlayer) then return end outputChatBox("It Was corona!") local car = getPedOccupiedVehicle(player) speedx, speedy, speedz = getElementVelocity ( car ) speedcnx = (speedx*Multiplier) speedcny = (speedy*Multiplier) speedcnz = (speedz*Multiplier) setElementVelocity ( car, speedcnx, speedcny,speedcnz ) fixVehicle(car) addVehicleUpgrade(car, 1010) playSoundFrontEnd(46) elseif (source == marker2) then if (player ~= localPlayer) then return end outputChatBox("It Was corona!") speedx, speedy, speedz = getElementVelocity ( car ) speedcnx = (speedx*Multiplier) speedcny = (speedy*Multiplier) speedcnz = (speedz*Multiplier) setElementVelocity ( car, speedcnx, speedcny,speedcnz ) fixVehicle(car) addVehicleUpgrade(car, 1010) playSoundFrontEnd(46) elseif (source == marker3) then if (player ~= localPlayer) then return end outputChatBox("It was cylinder!") local car = getPedOccupiedVehicle(player) local x, y, z = getElementRotation( car ) local newz = z + 360 setElementRotation( car, x, y, newz ) end end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) No, is not that, is that you don't specify the player argument as you should.
