Jump to content

Mr.Loki

Members
  • Posts

    667
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Mr.Loki

  1. You can block the player from entering the vehicle by canceling the onVehicleStartEnter the example on that page is just what you are looking for with just a few tweaks
  2. Put the script server side in the meta and remove fileDelete function and first 3 lines
  3. To replace the sound fully you would need to disable each weapon's default sound with setWorldSoundEnabled to figure out which group and index you need to disable for the weapon sounds you can do the following: start runcode /crun setDevelopmentMode(true) /debugscript 3 /showsound shoot your weapon and it will pop up in the debug window
  4. Probably an error in the txd file or the txd image size is not correct.
  5. Mr.Loki

    Jail System

    Source isn't defined in your function use a loop to get each player in the server with getElementsByType
  6. function spawnpanel() local acc = getPlayerAccount(source) if getAccountData(acc, "FirstLoginKek") == false then --wrong syntax triggerClientEvent(acc, "spawnpanel") setAccountData(acc, "FirstLoginKek", true) outputChatBox("works", acc, 255, 0, 0) end end addEventHandler("onPlayerLogin", getRootElement(), spawnpanel) You can use either: If getAccountData(account,"key") == false then Or If not getAccountData (account,"key") then
  7. I don't see anything being indexed or any var called elementData at line 979 or anywhere in the code are you sure this is the right script?
  8. How are you saving the player's hunger
  9. local modifier = 1 local day = getRealTime().weekday if day == 0 or day == 6 then -- 0 = sun 6 = sat modifier = 2 end local experiences = math.random(200,300)*modifier setElementData(killer,"experience",getElementData(killer,"experience") + experiences)
  10. Latency is the biggest problem for hitmarkers in mta lol onClientPlayerDamage trigger an event towards the attacker to show the hitmarker
  11. Try this: getAttachedElements setBlipColor
  12. @MIKI785 Yeah I know. I'm not saying that he actually did it but just as a tip. For instance where you have those function with multiple events attached to it.
  13. @Function you can't destroy an element which does not exist. Maybe read the whole topic next time because Fist explains why.
  14. You do not need the position. Read the wiki page about the function and know what the arguments are. Also a pro tip: It's a bad idea to name your functions the same name as MTA's functions because you will create an infinite loop where the function calls itself. Use a bit of diversity(but not too much) when creating the names.
  15. That was 1 of the problems I came across when I made my youtube script. The problem is youtube's site, not the script because if you try it with this forums it will work perfectly. Maybe you can check either of my youtube scripts and probably find the solutions and get some tips.
  16. Use getRealTime().timestamp this will return the current date of the client/server depending on which u run this function on as a UNIX timestamp. Google UNIX Timestamp converter to have a better understanding of what it is. Since we don't want players to adjust their time on their PC so they have infinite VIP we will make this function server sided. addEvent("addVIP",true) addEventHandler("addVIP",getRootElement(),function(source) local account = getPlayerAccount(source) local accName = getAccountName(account) aclGroupAddObject(aclGetGroup("VIP"),"user."..accName) -- This returns a table of the time including hour, minutes, seconds etc... -- we just need the timestamp in the table so we use ".timestamp" which is the current date in seconds (UNIX timestamp). local currentDate = getRealTime().timestamp -- now we must store that data (currentDate) into the player's account on a key called "VIPPurchaseDate". setAccountData("VIPPurchaseDate", currentDate) end) function checkPlayersVIP( ) -- Now we make a loop through all the players in the server. local plrs = getElementsByType'player' for i=1,#plrs do -- We get the player's account and their VIP purchase date. local account = getPlayerAccount( plrs[i] ) local purchaseDate = getAccountData( account, "VIPPurchaseDate" ) -- We now check if they have purchased vip on the account. if purchaseDate then -- We get the current time of the server, local currentDate = getRealTime().timestamp -- and minus the player's purchased date from it. 3600 seconds = 1 hour so we just multiply it by 24 to get a day. if currentDate - purchaseDate >= 3600*24 then -- If it is greater than or equals to 24 hours we remove the vip from the player's account. aclGroupRemoveObject( aclgaclGetGroup("VIP"), "user."..getAccountName(account) ) outputChatBox( "the message you may want to tell the player that his VIP has finished", plrs[i], 255, 100, 100 ) setAccountData("VIPPurchaseDate", false) end end end end -- we add a timer to check the players every minute of their VIP status setTimer( checkPlayersVIP, 60000, 0 ) P.S: Please use the code <> button when posting code. It just makes things much easier to read and identify.
  17. onClientGUIDoubleClick for GUI elements. onClientDoubleClick for dx
  18. Mr.Loki

    help

    Show us the server side code that you have.
  19. it's an event you attach it to your browser element like how you attached the onClientClick event to the cinema button. function geturl() guiSetText(addressBar,getBrowserURL(source)) end addEventHandler("OnClientBrowserNavigate",theBrowser, geturl) This event will be called every time the browser navigates to a different page.
  20. https://wiki.multitheftauto.com/wiki/OnClientBrowserNavigate
  21. https://wiki.multitheftauto.com/wiki/Shader_examples Scroll down to ped morph.
  22. Mr.Loki

    Fps drops !

    Note: To prevent memory leaks, ensure each call to xmlLoadFile has a matching call to xmlUnloadFile Don't forget to unload your XML files after loading them. Also, I don't think you should be rendering XML function... bad performance. Store the data from the XML in a table or var and render that
×
×
  • Create New...