Jump to content

novo

Members
  • Posts

    325
  • Joined

  • Last visited

Everything posted by novo

  1. I don't wanna do that, I've made another function called chatMSG, that's why there's addCommandHandler(lang, chatMSG)
  2. function joinLang(thePlayer,commandName,lang) local languageNames = {} for i = 1, #languageNames do if ( lang == languageNames[ i ] ) then bindKey ( thePlayer, "l", "up", "chatbox "..lang ) addCommandHandler(lang, chatMSG) setElementData(thePlayer, "lang", lang) end end end addCommandHandler("join", joinLang)
  3. bindKey(thePlayer, "l", "both", chatbox Ad) Error - chatbox Ad
  4. Hello. I'm trying to unbind the key "L" but it doesn't seem to work. I'm using server-sided script I'm using the following code; (Not working) unbindKey(thePlayer, "l") bindKey(thePlayer, "l", "both", "chatbox Ad") I've tried also with using: if(executeCommandHandler ( "unbind", thePlayer, "l" )) then else outputDebugString("COULDN'T unBIND") end if(executeCommandHandler ( "bind", thePlayer, "l chatbox Ad" )) then else outputDebugString("COULDN'T BIND") end But it's outputing COULDN'T messages.
  5. novo

    How to.. ?

    Hello. I'm having troubles with doing the following; I make a list of values: local values = {"one", "two", "three"} And I wanna make an if statement that checks if a value is having one of the values setted before, something like this: if(value == values) then outputChatBox("Found matching") end
  6. It's returning 0, working and not working.
  7. BASS ERROR 0 in PlayStream b3D = false path = music.mp3
  8. Hi all. I'm having troubles with doing a check to know if playSound() worked or didn't. Here you have a wrong example of what I want to do: (When I use the following example, it's always showing me "It works fine", doesn't matter if the 1st playSound worked or not) local mapMusic = playSound("music1.mp3") if not (mapMusic) then local radioMusic = playSound("music2.mp3") else outputChatBox ( "It works fine") end
  9. Hello all. I wanna know if it's possible to get current playSound() working by another script. Something like the following; playSound("music.mp3") playSound("https://mtasa.com/"..getCurrentPlaySound()) Bye.
  10. Hi all. Today i'll learn you how to create a marker for random vehicles. This idea is taken from a Mr. Green's map. Let's begin... 1. You must get all IDs that you want to use. You can see all vehicles ID's here: https://wiki.multitheftauto.com/wiki/Vehicle_IDs#2-Door_and_Compact_cars 2. I'll use all vehicles in mta. 3. Now, let's create the marker: marker = createMarker(1314,-1575,12,"corona",2,0,255,0) You must change "1314,-1575,12" for the x,y,z of where you want to locate the marker. 4. Now, we add a handled function that will happen when player (source) hits the marker: addEventHandler("onClientMarkerHit",marker, function() local vh = getPedOccupiedVehicle ( source ) vehicles = { --[[YOUR ID'S HERE, SEPARATED BY A COMA (Ex: 1, 2, 3)]] } nm = tonumber ( math.random( #vehicles ) ) setElementModel ( vh, nm ) end) 5. Finally, we gotta put together these two codes, like this: marker = createMarker(x, y, z,"corona",2,0,255,0) addEventHandler("onClientMarkerHit",marker, function() local vh = getPedOccupiedVehicle ( source ) vehicles = { --[[YOUR ID'S HERE, SEPARATED BY A COMA (Ex: 1, 2, 3)]] } nm = tonumber ( math.random( #vehicles ) ) setElementModel ( vh, nm ) end) 6. Save that code as "client.lua" into the map folder. 7. Open the file meta.xml located inside the map folder. 8. Add at the beginning below this code: <script src="client.lua" type="client" /> 9. Save the meta.xml 10. We finished. NOTE: THIS CODE WASN'T TESTED YET, IF YOU HAVE PROBLEMS WITH IT TELL IT TO ME WITH A REPLY. I hope you like it! Bye
  11. Just know to say that? Stop spamming or i'll really report you. And Scripting hasn't got any relation with Hosting.
  12. Hi all. © RvS Inc. is a company of hosting and web services. I'm it's founder. If you were searching for a cheap hosting.. You found it. Today we're finishing the core files and everything to start up the "main server" where we'll save information.. This week we'll start to sell the first MTA Servers. We'll start to host VPS soon for who wants to make his own clan. Our website is: http://rvsinc.es INFO: If you don't use Spanish language in your browser, it should redirect you to the English version. If it doesn't, you can enter the English version here; http://habbrek.com/rvsinc/en Some Details: - Panel & Website 100% handmade by David Martinez(n30x) - Panel is currently a BETA version. That's all for now. Bye.
  13. Hi all. I wanna know how to keep the MTA Server Running when i close ssh connection (putty). I have abug that When module loads i get this error at console: Unable to connect to mysql: (2002) Can't connect to local MySQL Server trought socket '/var/lib/mysql/mysql.sock' (2) I'm using the lastest version of Debian 32 bits. I saw that mysql server, when you start it, it otputs 2 files at '/var/run/mysqld/' that are mysql.pid and mysqld.sock So, maybe it's module bug ? Can someone help me, please ? Thanks.
  14. Hi all. I need help with the script hunter toptimes. I want to add a text which says: [HUNTER] n30x - Position: 1 - Time: 0:0:0 ! Can somebody help me ?
  15. novo

    What's wrong ?

    I use this script with my panel wich uses getCashPlayer and those others to get stats info. I'll try to do the event thing. Thanks. I'll edit this with new code if not working.
  16. novo

    What's wrong ?

    Hi all. I need help with some scripts, lets start... -------------------------------------------------------- I wanted to make a text where you can see your currently cash and it gets updated. Like if you get some cash you see that text updated + your new cash. Here's my code: addEventHandler('onClientResourceStart', g_ResRoot, function() g_Players = getElementsByType('player') fadeCamera(false,0.0) -- create GUI local screenWidth, screenHeight = guiGetScreenSize() local scale = relativeScale(screenHeight) g_dxGUI = { ranknum = dxText:create('0', screenWidth - 160, 155, false, 'bankgothic'), ranksuffix = dxText:create('$', screenWidth - 90, 155, false, 'bankgothic', 1), } g_dxGUI.ranknum:color(255,255,255) g_dxGUI.ranksuffix:color(0,132,255) g_dxGUI.ranknum:type('stroke', 2, 0, 0, 0, 255) g_dxGUI.ranksuffix:type('stroke', 2, 0, 0, 0, 255) end ) function relativeScale(int) return (int*0.66)/1080 end function setCashDisplay( player, cash ) local if not tonumber(cash) then g_dxGUI.cashnum:text('') g_dxGUI.cashsuffix:text('') return end g_dxGUI.cashnum:text(tonumber(getCashPlayer = getAccountData(getAcc, "Cash"))) g_dxGUI.cashsuffix:text('$' ) end But it's not showing. Thanks. --------------------------------------------- I wanted to add a tab in scoreboard for show currently cash but cash isn't showing. Here's my code: -- CASH TAB addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() exports.scoreboard:addScoreboardColumn("Cash", getRootElement(), 1, 0.08) end) addEventHandler("onPlayerLogin", getRootElement(), setTheCash) function setTheCash(source) local cash = getStats(source, "cash") if (cash == "unknow")then setElementData(source, "cash", 0) else setElementData(source, "cash", cash) end end addEventHandler("onPlayerLogin", getRootElement(), function() setTimer(setTheCash, 5000, 0, source) end) addEventHandler("onPlayerChat", getRootElement(), function() setTimer(setTheCash, 5000, 0, source) end) function getPlayerCash(player) if player then local account = getPlayerAccount(player) if not (isGuestAccount(account)) then local cash = getStats(source, "cash") if cash then return cash else return 0 end else return false end else return false end end --[[ function setPlayerCash(player, avatar) if player then local account = getPlayerAccount(player) if not (isGuestAccount(account)) then setAccountData(account, "profile-avatar", avatar) local cash = getStats(source, "cash") return true else return false end else return false end end ]]-- addEvent("setAccountCash", true) addEventHandler("setAccountCash", getRootElement(), function(player, cash) if cash then setPlayerCash(player, cash) -- outputChatBox("#007FFF[Account]#FFFFFF Avatar succesfully loaded !", getRootElement(), 255, 255, 255, true) chatBox("Cash succefully loaded !", player) end end) -- END CASH TAB Help me. Thanks. ------------------------------------- So those are my scripts wich i need help to fix them. Thanks (:
  17. Since, i'll use BinSlayer1 code. Anyways, Thank you all !! <3
  18. Heh, why the Fuck are you talking badly ? If you can't talk better, don't try to help... I came here to got help, no to get answers where people talks to me badly. @-SOAD-: I want know wich is the syntax to do something on checkpoint 1,2,3... I mean, a checkpoint number, a function on each checkpoint. This is the function wich i use: addEventHandler("onPlayerReachCheckpoint", function checkpoint1 () local randomboats = math.random(454, 472) -- Random Boats if ( isPedInVehicle ( source ) ) then checkpoint 1 setElementModel ( getPedOccupiedVehicle (source), randomboats ) end end ) checkpoint 1, i mean that, to do the function when player reachs the checkpoint nº1. Bye.
  19. Hi all. I have a dude with handler onPlayerReachCheckpoint. I made a function for random cars on each checkpoint. I saw on wiki, that to do something on some checkpoint the syntax is: int checkpoint And i want know how it should be, i use this one: checkpoint 1 Can somebody correct my dudes, please ? Bye.
  20. novo

    Crazy problem.

    I think, don't get this because i'm not sure, that you can't execute a command handler from server on client. Here you have a code for client-side: function doPlayerCommand( player ) triggerServerEvent("onExecuteCommand", player ) end And a code for server-side: addCommandHandler("dance", function() --[[ Here you must add the full commandHandler function. ]]-- end ) addEvent("onExecuteCommand") addEventHandler("onExecuteCommand", function(player) executeCommandHandler( "dance", player ) end ) Try it and tell me what happens.
  21. novo

    Help and thx

    Maybe, re-installing MTA 1.2. Or, downgrade to MTA 1.1.1.
  22. Thanks Solidsnake14. Thanks Aibo. Thanks TAPL for correct my dudes of this. @Aibo: I'll use Solidsnake14 code, because it's easyer to understand for me. Anyways, thank you for give me another method to script it. Bye. EDIT: @Solidsnake14: It's not working EDIT: local hiding = true addEventHandler("onClientResourceStart", resourceRoot, function() bindKey('F1', 'both', hideVehicles) end ) function hideVehicles(key, state) if (hiding and state == 'down') or (not hiding and state == 'up') then return false end hiding = not hiding for _, player in ipairs(getElementsByType('player')) do if player ~= localPlayer then setElementDimension(getPedOccupiedVehicle(player), hiding and 1 or not hiding and 0) setElementDimension(player, hiding and 1 or not hiding and 0) end end outputChatBox(hiding and "[iNFO]: Currently Hiding Vehicles." or "[iNFO]: Currently Showing Vehicles.") end It has a bug, when i press F1 it's not showing, but i need to keep it "pushed". If i stop "push" to key, the cars already are showing. Plz help.
  23. Well, yes. I was using a screen of 2560 x 1600 resolution. Thanks :3
  24. I made this: addEventHandler("onPlayerJoin", bindKey('F1', 'down', function() for _, player in ipairs(getElementsByType('player')) do if player ~= localPlayer then setElementDimension(getPedOccupiedVehicle(player), 1) setElementDimension(player, 1) outputChatBox("[iNFO]: Currently Hidding Vehicles.", player ) end end end )) bindKey('F1', 'up', function() for _, player in ipairs(getElementsByType('player')) do if ( getElementDimension ( source ) == 1 and seat == 0 ) then setElementDimension(getPedOccupiedVehicle(player), 0) setElementDimension(player, 0) outputChatBox("[iNFO]: Currently Showing Vehicles.", player ) end end end ) --[[ addEventHandler("onPlayerSpawn", function( thePlayer, key ) if ( getElementDimension ( source ) == 1 and seat == 0 ) then setElementDimension(getPedOccupiedVehicle(player), 1) setElementDimension(player, 1) end end ) ]]-- But when i press F1, it hide cars and show 4 texts. ON - OFF then again. Plz help <3 PD: Sorry 4 double post.
  25. Thank you BinSlayer1. :]
×
×
  • Create New...