Jump to content

ds1-e

Scripting Moderators
  • Posts

    636
  • Joined

  • Days Won

    8

Everything posted by ds1-e

  1. What's the point for that? If cache="false" does same?
  2. Like before, but will be better if you will rewrite them once again, and not copy, because of invisible special character, probably.
  3. Add to meta. <min_mta_version client="1.5.6" server="1.5.6"/>
  4. The problem was in outputChatBox, so add them again, i also find out other problem, check again. function upLevel() local players = getElementsByType("player") local get_players = {} for i = 1, #players do local player = players[i] local player_acc = getPlayerAccount(player) if player and player_acc and not isGuestAccount(player_acc) then local minutes = getElementData(player, "minutes") if not minutes then setElementData(player, "minutes", 1) else setElementData(player, "minutes", minutes + 1) end if getElementData(player, "minutes") > 1 then local level = getElementData(player, "Level") or 0 local bonus = math.random(25, 950) local interest = math.random(25, 150) local value = bonus - interest setElementData(player, "minutes", 0) setElementData(player, "Level", level + 1) givePlayerMoney(player, value) table.insert(get_players, player) end end end triggerClientEvent(get_players, "blipuplevel", resourceRoot) end setTimer(upLevel, 60000, 0)
  5. If you want, you can try my version, which also i optimized a bit. -- Server-side function upLevel() local players = getElementsByType("player") local get_players = {} for i = 1, #players do local player = players[i] local player_acc = getPlayerAccount(player) if player and player_acc and not isGuestAccount(player_acc) then local minutes = getElementData(player, "minutes") setElementData(player, minutes, minutes or 0 + 1) if minutes and minutes > 1 then local level = getElementData(player, "Level") local bonus = math.random(25, 950) local interest = math.random(25, 150) local value = bonus - interest setElementData(player, "Level", level or 0 + 1) givePlayerMoney(player, value) outputChatBox("#FFFFFF[ #FAAC58FW-LEVEL #FFFFFF]", player, 255, 255, 255, true) outputChatBox("#FAAC58**#FFFFFFVocê ganhou mais um #FAAC58level", player, 255, 255, 255, true) outputChatBox("#FAAC58**#FFFFFFPagamento : R$ #00FF00"..value, player, 255, 255, 255, true) table.insert(get_players, player) end end end triggerClientEvent(get_players, "blipuplevel", resourceRoot) end setTimer(upLevel, 60000, 0) -- Client-side function blipuplevel() local sound = playSound("som/blip.mp3") setSoundVolume(sound, 0.5) end addEvent("blipuplevel", true) addEventHandler("blipuplevel", resourceRoot, blipuplevel)
  6. @giovanymito besides, imho it's not good way to send multiple triggers within loop instead of one.
  7. triggerClientEvent(thePlayer, "blipuplevel", thePlayer) thePlayer - where is defined? This player doesn't exist.
  8. I'm not expert at this, but yes, compiling with highest level of obfuscation. Since i don't get answer yet for my topic, one more possible way is sending client scripts with loadstring and triggerClientEvent, i've saw it somewhere, but i don't know if at the moment is worth to add this kind of protection, or if it's working at all.
  9. I guess, it's a massive system plus it also uses database. Code can be badly optimized. But most likely it performs a lot of things at once. If i would be on your place, i would delay executing certain functions within timers.
  10. Try like that: function addRadio() outputChatBox("WOOOORKS") outputChatBox("You're currently listening to "..getRadioChannelName(getRadioChannel()).."!") end addCommandHandler("MyRadio", addRadio, false, false) And if this wouldn't work, be sure that code is in client-side, also check debugscript 3 for errors/warnings.
  11. ds1-e

    Securing scripts

    I know about that, but still i'd like to add more 'security layers'. What's possible on server-side, it's already there.
  12. Hey. Is there any good way to secure scripts more? Excluding compiling with highest level of obfuscation, and cache="false" for client (which i am already using). I've saw that is possibility to send client scripts from server, with loadstring. It's is really worth to add this kind of 'security layer'? And if yes, then how it should exactly looks. Besides, i know, that even after all, it's still possible to steal my resources.
  13. Solved. https://wiki.multitheftauto.com/wiki/SetVehicleDamageProof
  14. Sorry, but i don't have idea, how it could be done.
  15. Hi. I need a way to disable that if vehicle is flipped, it gets on fire. Any ideas?
  16. ds1-e

    KickPlayer

    Hmm, maybe timer, which will use trigger(Latent)ClientEvent + this function. It will check if player is downloading resources. https://wiki.multitheftauto.com/wiki/IsTransferBoxActive If it returns true, then send back trigger back to server, reset timer, and check again after x minutes, otherwise send back to server, kill timer and kick player?
  17. ds1-e

    KickPlayer

    Are you sure that is good idea? What if he will be downloading resources more than 5 minutes? Besides few advices. Player in event is defined as: source From wiki: You don't need to "create" function within timer, for me it's simpler to use following syntax. Also, time interval is 5000 ms, 5 minutes = 300 000 ms. Take a look at `times to execute`, it's unlimited, most likely it will throw out errors, because defined player doesn't exist, if he will quit. -- From wiki setTimer ( function theFunction, int timeInterval, int timesToExecute [, var arguments... ] ) -- -- Function, interval, times to execute, argument1, argument2 setTimer(kickPlayer, 300000, 1, source, "Reason")
  18. Check that - https://wiki.multitheftauto.com/wiki/GuiGridListSetSelectionMode and if this wouldn't work, i think you can simply unselect each other, when clicking on gridlist, with using - https://wiki.multitheftauto.com/wiki/OnClientGUIClick and https://wiki.multitheftauto.com/wiki/GuiGridListSetSelectedItem
  19. If you want execute other function at client-side, just use timer. I wouldn't use multiple triggers at once, to not harm server, but still it depends, what you're trying to do. https://wiki.multitheftauto.com/wiki/SetTimer Also, you might read this topic, and exactly IIYAMA posts, which explain a bit about triggers.
  20. You can use: triggerClientEvent, which will execute your client-side function, for certain player. https://wiki.multitheftauto.com/wiki/TriggerClientEvent
  21. Hey. Is there any way to get string with spaces from arguments in command? For example i want to get complete string when using command: /getstring String with spaces So it doesn't count as other arguments, and it should return one complete string.
  22. Why do you create other topic with it? I've answered you there.
  23. What you try to achieve, trigger event? I don't think that this is possible to do, that you can start resource for certain player.
×
×
  • Create New...