Jump to content

Drakath

Members
  • Posts

    768
  • Joined

  • Last visited

Everything posted by Drakath

  1. if you are willing to pay i recommend you to use VPS Cloud Alright, I'm just concerned because it has 2 GB less RAM.
  2. Cloud costs only a few euros more. I don't mind that if it's better.
  3. Which OVH VPS is better? Cloud VPS with 2 GB RAM and 2 vCores CPU or regular VPS with 4 GB RAM and 3 vCores CPU ?
  4. What's better for hosting a mtasa-server, Debian or Ubuntu?
  5. OVH servers are known to get DDOS'ed quite often. You might wanna try another hosting.
  6. No, here is explanation... You should call functions in same file like function(arg) while you have a choice triggerEvent, say you made your own event like "onClientDepositMoney" but this event will not be triggered unless you make it happen manually, in this case, you'll use 'triggerEVent' within SAME file, now when you add "onClientDepositMoney" EXTERNALLY in some other script, the event will be triggered on original script and will call the function from OTHER script too, here is example: -- atms_c.lua function confirmDeposit(acc, money) -- Acc is account of player, got from serverside ofcourse while money is numeric value. if (not money) or (not acc) then return end local prev = getAccountData(acc, "atms.money") or 0 setAccountData(acc, "atms.money", tonumber(prev) + money) triggerEvent("onDepositMoney", root, getAccountName(acc), money) end addEventHandler("onClientGUIClick", deposit_btn, confirmDeposit, false) addEvent("onDepositMoney", true) -- Make event trigger-able externally... Now some other resource, some other file: -- logs_c.lua function writeLog(acc, money) if (not acc) or (not money) then return end writeLog(acc, "Player has deposited $"..money.."in his bank.") end addEventHandler("onDepositMoney", root, writeLog) Wow, that's a really nice feature. Thank you for a nice explanation
  7. You mean you can do stuff like this? triggerEvent("onPlayerJoin", root, arg)
  8. And those custom events call a function. It's basically the same thing.
  9. So why triggerEvent is even in MTA?
  10. I have a server function that is used by both server and client. When I want to call it via same server script, is it more efficient to simply: myFunction(arg) or triggerEvent("myEventName", resourceRoot, arg) ?
  11. Drakath

    ACL problem

    Thanks, it is working now.
  12. Drakath

    ACL problem

    Maybe it can only remove it from the ACL group? Stuff like user.lalala and I want to remove an actual right which is in ACL that just belongs to this group, however that does not explain why it gives me an error that it expected ACL in the first argument.
  13. Drakath

    ACL problem

    If group is both for false and nil. The fact is that the right was not removed. This group does have command.kick Besides, aclGetGroup does return me the ACL group since it does output "got".
  14. Drakath

    ACL problem

    I did add the resource to Admin group. If it wouldn't have that right it would output Access denied error right?
  15. Drakath

    ACL problem

    It says that it expected ACL at argument 1. It outputs "got" and "NOT". What's the problem? I used an example from wiki but it doesn't work. function func(thePlayer) local group = aclGetGroup("CustromACL") if group then outputChatBox("got", thePlayer) end local bool = aclRemoveRight(group,"command.kick") aclReload() if bool then outputChatBox("removed", thePlayer) else outputChatBox("NOT", thePlayer) end end addCommandHandler("remv", func)
  16. The error is because when you do this: not tonumber(rz), you are converting it to a boolean. You need to use parentheses, like this: if not ( tonumber ( rz ) > tonumber ( formula ) ) then Thanks
  17. It outputs "numbernumber"
  18. Can someone tell me why do I get this error: ERROR: rotation_check\server.lua:6: attempt to compare number with boolean local x, y, z = getElementPosition(thePlayer) local px, py, pz = getElementPosition(ped) local rx,ry,rz = getElementRotation( ped ) local formula = tonumber((360 - math.deg(math.atan2((x - px), (y - py)))) % 360)+1 if rz and formula then if not tonumber(rz) > tonumber(formula) then outputChatBox("Looking", root) else outputChatBox("Not looking", root) end end thePlayer and ped do exist.
  19. Actually I already did find an answer. I just had to add my server to access hosts.
  20. Does MTA compiler remove all the comments from the script, when it gets compiled?
  21. I am trying to connect to a mySQL database using mysql_connect but I get this error: ERROR: Unable to connect to mysql: (1045) Access denied for user 'Drakath'@'ip-77-221-80-117.zard.lt' (using password: YES) Why does it output my IP? I am sure I wrote the right hostname and port because I retrieved them using SHOW VARIABLES query. I used the username and password I specified when creating my database. What's the problem here?
  22. I am currently using a default SQLite internal.db but I need to do some stuff with PHP so I will have to setup a MySQL. Is it okay to run both MySQL for a few things and SQLite for general account data or should I move everything to MySQL?
  23. Thank you, I did notice it somehow
  24. I think you misunderstood me, I don't care about doSomething(), I just put it as an example. You can call it whatever you want, the problem is that bindKey did not pass source: function myFunction(marker) outputChatBox(marker) --This outputs "h" if isElement(marker) then --It doesn't pass this condition outputChatBox("it worked") end end
  25. I need to do this with bindKey.
×
×
  • Create New...