Jump to content

Bonus

Members
  • Posts

    297
  • Joined

  • Last visited

Everything posted by Bonus

  1. KariiiM, your code will draw something like 199999, always That is a way: local starttime = 0 local screenX,screenY = guiGetScreenSize() local function startTheClock ( ) if getTickCount()-starttime >= 2 * 60 * 1000 then -- if 2 min past -- whatever you want to do else -- whatever you want to do end end addCommandHandler ( "starttheclock", function ( ) starttime = getTickCount() addEventHandler ( "onClientRender", root, startTheClock ) end )
  2. And which vehicle is that? How can you get that vehicle? Is it saved somewhere?
  3. Me: Do you want to get the zone of the vehicle you are sitting in? You: Yes, exactly. When you are sitting in the vehicle, you are at the same place. Which vehicle do you want to get now?
  4. Where do you use that? Because source is the root element here, not the player.
  5. There is no onPickupLeave. trigger the pickup too and create an addEventHandler with onClientEvent. There you can ask if the player is near the pickup (getElementDistanceBetweenPoints3D <= 3 should do it). If not, remove the eventhandler and destroy gui.
  6. Use onClientKey to write into dxDrawText.
  7. What I don't understand: You want to get the zonename of the vehicle you are sitting in ... why?! The zonename will be the same as the zonename of the localPlayer. Still don't understand what you are even trying.
  8. Then tell us why they didnt work. The codes are going to the right way, what is wrong?
  9. Its pretty easy. You want to use dxDrawText? Or is outputChatBox enough? Just use whatever you want in the first clientsided file in meta.xml. Like that: outputChatBox ( "welcome to whatever, you are downloading whatever" ) Just put the line in, no need for function. Use your code in the first file in meta (clientsided), the first one getting downloaded.
  10. What did you mean with "Didn't work, thanks for your hard work guys." The code should have worked then.
  11. Oh, you don't talk about fadeCamera, you talk about the sound getting lower until its stopped. You can do it that way: local sound = nil local startvolume = 0 local actualvolume = 0 local steptostop = 0 local function fadeTheSoundAway ( ) actualvolume = actualvolume - startvolume/steptostop if actualvolume == 0 then stopSound ( sound ) else setSoundVolume ( sound , actualvolume ) end end function stopSoundWithFade ( sound, step ) if isElement ( sound ) and getElementType ( sound ) == "sound" and tonumber ( step ) then startvolume = getSoundVolume ( sound ) actualvolume = startvolume steptostop = tonumber ( step ) addEventHandler ( "onClientRender", root, fadeTheSoundAway ) return true end return false end ) With this code you should be able to use the function: stopSoundWithFade ( thesound, step ) thesound := sound element, which you want to stop step := float, sets the speed how fast the sound will stop For step you should use a higher number like 180. Then the sound will be stopped after 180 Frames (in 3 seconds with 60 FPS).
  12. You asked: How to make sound to stop by fade effect? Now you want a sound fade? Sry, but I don't really understand what exactly you want. Explain it a bit more pls.
  13. Then you have to get the vehicle from somewhere. Do you want to get the zone of the vehicle you are sitting in?
  14. On every fade effect? Then you can modify fadeCamera, else just use triggerClientEvent after using fadeCamera.
  15. Element data is a bit useless here, if you want to save the players, just use a table. Also your code is a bit .. well ... wrong What are you even trying to do there? Just loop all players and ask if its the one player ... Like tosfera wrote: addCommandHandler ( "playsound", function ( player, cmd, nottarget ) if nottarget and nottarget ~= "" then local nottargetpl = getPlayerFromName ( nottarget ) if notttargetpl then local players = getElementsByType ( "player" ) for i=1, #players do if players[i] ~= nottargetpl then triggerClientEvent ( players[i], "playthesound", player ) end end else outputChatBox ( "The player does't exist!", player, 155 ) end else triggerClientEvent ( "playthesound", player ) end end ) Edit: Oh, you already did it
  16. Clientsided you are the only one who can see the rainbow colors.
  17. "Show us full code" We don't even know what you want to do. Which vehicle? Which GUI? Show the full code or give more informations!
  18. I think that's called Label. You can edit it with onClientKey.
  19. It's like you go to the bathroom and expect a apple in your hand. If you want that apple, you have to get it from the store or from the kitchen if you already bought it. How do you expect to get vehicle by clicking on a GUI?
  20. You didn't understand me. Let me show you again: A player can switch between interiors. But there are only 2 ways a player can switch the interior: 1. setElementInterior 2. spawnPlayer But spawnPlayer would (as I know) remove your weapons etc. So if someone switches interiors, there is nearly always a setElementInterior. Thats why my first plan was to change setElementInterior. You should never use setElementInterior by yourself, I only changed it so you know when exactly someone changes the interior. There you could use something like function setElementInterior ... triggerEvent ( "onPlayerChangeInterior", player, getPlayerInterior ( player ), newinterior ) end addEvent ( "onPlayerChangeInterior", true ) addEventHandler ( "onPlayerChangeInterior", root, function ( oldint, newint ) outputChatBox ( getPlayerName ( source ) .. " left interior "..oldint.." and is now in "..newint ) end ) And then you could have used onPlayerChangeInterior for that type of problems.
  21. Try this: local chatison = false addEventHandler ( "onClientKey", root, function ( ) local chatboxactive = isChatBoxInputActive() if not chatison and chatboxactive then chatison = true setElementData ( localPlayer, "chatIsOn", true ) elseif chatison and not chatboxactive then chatison = false setElementData ( localPlayer, "chatIsOn", false ) end end )
  22. That is a bit complicated if you want to see if someone writes without need to check. You have to use bindKey "t" to know when someone is writing. Then use isChatBoxInputActive to set him element data if hr is writing or not. You can use this elementdata to show you if someone is writing. Same with F8. Please just dont do it with a timer.
  23. Chill your massive manboobs, jesus.. no need to go all badguy on him. If you can't handle people who don't understand a lot of LUA or if you lose your temper so freakin' fast, don't help them. There are others out there which can and will help them.. @OP; I've replied to your other topic, that should work. Read the whole page. If someone wants help and doesn't know how to do something, he should listen to others. I wrote the same thing over and over, but he always didnt listen and said it would be wrong. Do we have to get 1000+ posts to help people?! I already wrote so many things and really waited for his responses, a "then don't help" is to late, I already wasted my time and he still thought he knows it better, didnt want to listen to me. Oh and you didnt really help someone by sending a code. He doesnt seem to understand everything, I tried to teach him what interior is. The same questions will continue if no he never learns about how to switch interiors.
  24. Bonus

    Solved

    Seems like login is case sensitive, addAccount not. Thats good, I don't want accounts Bonus, bonus, bonuS etc.
×
×
  • Create New...