Jump to content

BieHDC

Members
  • Posts

    296
  • Joined

  • Last visited

Everything posted by BieHDC

  1. btw: use root instead of getRootElement() which is much less to write and faster
  2. this means the "Playtime" isnt given you need a script which count players play time edit it like you need --serverside exports.scoreboard:addScoreboardColumn('PlayTime') local t = { } function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) setElementData( v, "PlayTime", tostring( hour )..':'..tostring( min )..':'..tostring( sec ) ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'PlayTime' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "PlayTime-hour", tostring(hour) ) setAccountData ( playeraccount, "PlayTime-min", tostring(min) ) setAccountData ( playeraccount, "PlayTime-sec", tostring(sec) ) setAccountData ( playeraccount, "PlayTime", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "PlayTime" ) local hou = getAccountData ( playeraccount, "PlayTime-hour") local min = getAccountData ( playeraccount, "PlayTime-min") local sec = getAccountData ( playeraccount, "PlayTime-sec") if ( time ) then setElementData ( source, "PlayTime", time ) t[ source ]["hour"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "PlayTime",0 ) setAccountData ( playeraccount, "PlayTime",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin )
  3. https://wiki.multitheftauto.com/wiki/Resource:Race scroll down to "onRaceStateChanging" "Running" is setted after Countdown
  4. have a look on this: https://community.multitheftauto.com/in ... ls&id=8019 simple, uncomplimed and basic you can have a look on it and see how it works
  5. tonumber wasnt needed this care because its done automatic (i think ;D ) can i pm you on xml based questions? because lua i can do most things and currently i wanna learn xml for a clan panel
  6. hell yea thanks dude btw. are you xml pro?
  7. ok readout is done, but i have a problem with a thing: Velocity="0,0,1" > returns as string but i need it in 3 values like vx,vy,vz = 0,0,1 what function i have to use for this?
  8. Thank you Tete, this is the first helpful post. (this is not sarcasm)
  9. ok 1st thing BUT how to find TeleportIN and then how to read out the argumeants (posX...)
  10. Can somebody explain me how to read this in a script? Because on some servers Action Script buggs around so i recreate the script, but i dont have the experience in xml If somebody can make a an example, this would be great > Visiblemarker="false" TeleportID="10" trigger="marker" AS-ID="1" ConditionalNOTHIT="" ConditionalHIT="" Markersize="5" Removeafteruse="false" posX="3584.3999023438" Markercolor="255,255,255,255" posZ="7.6999998092651" Delay="0" posY="-2349.6999511719">> Visiblemarker="false" TeleportID="10" trigger="marker" AS-ID="1" ConditionalNOTHIT="" ConditionalHIT="" Markersize="5" Removeafteruse="false" posX="3454.8999023438" Markercolor="255,255,255,255" posZ="22.10000038147" Delay="0" posY="-2225.3000488281">> Visiblemarker="false" trigger="marker" AS-ID="1" Velocity="0,0,1" ConditionalNOTHIT="" ConditionalHIT="" Markersize="2" Removeafteruse="false" posX="1098" Markercolor="255,255,255,255" posZ="12.5" Delay="0" posY="1447.8000488281">> Visiblemarker="false" trigger="world" AS-ID="1" Message="Text" ConditionalNOTHIT="" ConditionalHIT="" Markersize="5" Removeafteruse="false" posX="0" Markercolor="8,0,183,255" posZ="0" Delay="0" posY="0">>>
  11. I have had the same problem But i can say you that you trigger a Server event when the client joins and the server sends a table back to client and save it. and you have to recreate the table serverside or the client cant read
  12. btw: if you dont use the web interface then turn it off
  13. runcode is scripting ingame as i would say if your admin have accsess, they can start it and start scripting like give all players money or set for all vehicles velocity or whatever But your server should be secure now(hopefully) if not then write again in this theard Why i know so much about server security? Because i completed some security courses and thats why i know how to handle this
  14. Is the resource "runcode" running? and i still think he owned any admin account and then created his "Console" account and i hope you choosen a very long password (min 32 chars i would say) but the best would be cleaning user db and resetup the acl If you have saved everything in the db then you cant so this, but would be most secure
  15. I was looking through your log and this Guy logged in as "Console." and not "Console" look in your acl if there is such an 2nd account and maybe could be this guy be an ex admin or hacked another admin? OR a stupid guy has given the Console a password with setAccountPassword ?
  16. btw: do money sets ONLY SERVERSIDE or it wont be triggert
  17. Hello, yesterday i started a 2nd Server instance on my local Server I have the problem that my 1st Server wont show up in Browser(22003,22005,22126) BUT the 2nd Server (22004,22006,22127) shows up! Both Servers are join and playable, only the 1st isnt showing up all ports are open 1st Server ASE puts out 0 2nd Server ASE puts out 146 therewhile Can somebody tell me why the one works and the other not?
  18. How is the password for Console created? Its a Account, so it has a password and i think this guy knows how to get the password!
  19. hmm you tried to connect from outside?
  20. is the ip right? and maybe try to restart your router(helped me)
  21. I have it running on my old PC without laggs Intel Pentium 4 2*3,2 ghz 2 gb RAM Ubuntu Server with net-install cd 64-Bit (why neinstall? > updates done and no unused things)
  22. I think he means the built in events i give you an example addEventHandler("onPlayerConnect",root,function() createExplosion (0, 0,4 ,10) end ) now the source isnt used, i just create an explosion when a player connects its maybe not the best example, but is this something you meant?
  23. dont use source simple ignore it
  24. With this example above it will play for ALL players on Server if you wanna it only for the Player who joined then change this line triggerClientEvent('startSound', getRootElement(), 'login') to triggerClientEvent('startSound', source, 'login')
  25. BieHDC

    Lua "teachers"

    but maybe i can help you, if the things dont get too complex
×
×
  • Create New...