Jump to content

Sil3nT

Members
  • Posts

    50
  • Joined

  • Last visited

Everything posted by Sil3nT

  1. Sil3nT

    Hide Hud

    Tnx i will try it
  2. Sil3nT

    Hide Hud

    And yeah, btw. I test that custom HUD on my private server and its replacing the orginal one, but on my hosted Server it isnt. Why that? Ands host server is same as Private server!
  3. Sil3nT

    Hide Hud

    so like this in client side? function hudChanger () showPlayerHudComponent( "all", false ) end addEventHandler ( "onPlayerJoin", getRootElement(), hudChanger )
  4. Sil3nT

    Hide Hud

    Nope! Doesnt hide
  5. Sil3nT

    Hide Hud

    Okay tnx i will try it
  6. Sil3nT

    Hide Hud

    And its on client side and looks like this? function show () showPlayerHudComponent(all,false) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource)),(show)
  7. Sil3nT

    Hide Hud

    Hello everyone! I realy want to hide orginal GTA HUD and add custome one. Cuz when i add custome HUD the orginal wont disapear And this doesnt help. Or i just can make it correct https://wiki.multitheftauto.com/wiki/Sh ... dComponent
  8. Sil3nT

    MySql problem

    its shows this now
  9. Sil3nT

    MySql problem

    so i need to change localhost to servers ip adress?
  10. Sil3nT

    MySql problem

    Then , is there nsome normal mysql hosting program or company?
  11. Sil3nT

    MySql problem

    Hello. I have script where i need mysql and database. Thas okay. But when i start script then in console outputs this ERROR: mgm\server.lua:9 dbConnect failed; Can't connect to MySql server on 'localhost' (10061) This is that lua file server = {} server.__index = server server.connection = dbConnect( "mysql", "dbname=elitedeh_my;host=localhost", "root", "" ) if ( server.connection ) then outputDebugString("Connection to database successful") else outputDebugString("Connection to database failed") end And yeah i tried 000webhost mysql and again that problem. I just think i have writed wrong lua
  12. Sil3nT

    Save Playtime

    Yeah but not seconds! I set that seconds always will be :00
  13. How can i add seconds? I try everything that i can but i fuc*ed up everthing. This is that script! exports [ "scoreboard" ]:addScoreboardColumn ( "Online", 3 ) addEventHandler ( "onResourceStart" , resourceRoot , function ( ) for index , player in ipairs ( getElementsByType ( "player" ) ) do local pAccount = getPlayerAccount ( player ) if not isGuestAccount ( pAccount ) then local minutes = getAccountData ( pAccount , "Online.minutes" ) if minutes then local hours = getAccountData ( pAccount , "Online.hours" ) if # tostring ( minutes ) == 1 then minutes = "0" .. minutes end if # tostring ( hours ) == 1 then hours = "0" .. hours end setElementData ( player , "Online" , hours .. ":" .. minutes .. ":00" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , player ) setElementData ( player , "Online.timer" , timer ) else setAccountData ( pAccount , "Online.minutes" , 0 ) setAccountData ( pAccount , "Online.hours" , 0 ) setElementData ( player , "Online" , "00:00:00" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , player ) setElementData ( player , "Online.timer" , timer ) end else setElementData ( player , "Online" , "N/A" ) end end end ) addEventHandler ( "onResourceStop" , resourceRoot , function ( ) for index , player in ipairs ( getElementsByType ( "player" ) ) do local pAccount = getPlayerAccount ( player ) if not isGuestAccount ( pAccount ) then local timer = getElementData ( player , "Online.timer" ) if isTimer ( timer ) then killTimer ( timer ) end end end end ) addEventHandler ( "onPlayerLogin" , root , function ( _ , pAccount ) local minutes = getAccountData ( pAccount , "Online.minutes" ) if minutes then local hours = getAccountData ( pAccount , "Online.hours" ) if # tostring ( minutes ) == 1 then minutes = "0" .. minutes end if # tostring ( hours ) == 1 then hours = "0" .. hours end setElementData ( source , "Online" , hours .. ":" .. minutes .. ":00" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , source ) setElementData ( source , "Online.timer" , timer ) else setAccountData ( pAccount , "Online.minutes" , 0 ) setAccountData ( pAccount , "Online.hours" , 0 ) setElementData ( source , "Online" , "00:00:00" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , source ) setElementData ( source , "Online.timer" , timer ) end end ) addEventHandler ( "onPlayerLogout" , root , function ( pAccount ) local timer = getElementData ( source , "Online.timer" ) if isTimer ( timer ) then killTimer ( timer ) end end ) addEventHandler ( "onPlayerJoin" , root , function ( ) setElementData ( source , "Online" , "N/A" ) end ) addEventHandler ( "onPlayerQuit" , root , function ( ) local pAccount = getPlayerAccount ( source ) if not isGuestAccount ( pAccount ) then local timer = getElementData ( source , "Online.timer" ) if isTimer ( timer ) then killTimer ( timer ) end end end ) function updatePlayerOnline ( player ) local pAccount = getPlayerAccount ( player ) local minutes = getAccountData ( pAccount , "Online.minutes" ) local hours = getAccountData ( pAccount , "Online.hours" ) minutes = tostring ( tonumber ( minutes ) + 1 ) if minutes == "60" then hours = tostring ( tonumber ( hours ) + 1 ) minutes = "00" end setAccountData ( pAccount , "Online.minutes" , tonumber ( minutes ) ) setAccountData ( pAccount , "Online.hours" , tonumber ( hours ) ) if # tostring ( minutes ) == 1 then minutes = "0" .. minutes end if # tostring ( hours ) == 1 then hours = "0" .. hours end setElementData ( player , "Online" , hours .. ":" .. minutes .. ":00" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , player ) setElementData ( player , "Online.timer" , timer ) end
  14. Sil3nT

    Save Playtime

    Just use this! Its work for me and saves everything, but this script dont have seconds! exports [ "scoreboard" ]:addScoreboardColumn ( "Online", 3 ) addEventHandler ( "onResourceStart" , resourceRoot , function ( ) for index , player in ipairs ( getElementsByType ( "player" ) ) do local pAccount = getPlayerAccount ( player ) if not isGuestAccount ( pAccount ) then local minutes = getAccountData ( pAccount , "Online.minutes" ) if minutes then local hours = getAccountData ( pAccount , "Online.hours" ) if # tostring ( minutes ) == 1 then minutes = "0" .. minutes end if # tostring ( hours ) == 1 then hours = "0" .. hours end setElementData ( player , "Online" , hours .. ":" .. minutes .. ":00" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , player ) setElementData ( player , "Online.timer" , timer ) else setAccountData ( pAccount , "Online.minutes" , 0 ) setAccountData ( pAccount , "Online.hours" , 0 ) setElementData ( player , "Online" , "00:00:00" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , player ) setElementData ( player , "Online.timer" , timer ) end else setElementData ( player , "Online" , "N/A" ) end end end ) addEventHandler ( "onResourceStop" , resourceRoot , function ( ) for index , player in ipairs ( getElementsByType ( "player" ) ) do local pAccount = getPlayerAccount ( player ) if not isGuestAccount ( pAccount ) then local timer = getElementData ( player , "Online.timer" ) if isTimer ( timer ) then killTimer ( timer ) end end end end ) addEventHandler ( "onPlayerLogin" , root , function ( _ , pAccount ) local minutes = getAccountData ( pAccount , "Online.minutes" ) if minutes then local hours = getAccountData ( pAccount , "Online.hours" ) if # tostring ( minutes ) == 1 then minutes = "0" .. minutes end if # tostring ( hours ) == 1 then hours = "0" .. hours end setElementData ( source , "Online" , hours .. ":" .. minutes .. ":00" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , source ) setElementData ( source , "Online.timer" , timer ) else setAccountData ( pAccount , "Online.minutes" , 0 ) setAccountData ( pAccount , "Online.hours" , 0 ) setElementData ( source , "Online" , "00:00:00" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , source ) setElementData ( source , "Online.timer" , timer ) end end ) addEventHandler ( "onPlayerLogout" , root , function ( pAccount ) local timer = getElementData ( source , "Online.timer" ) if isTimer ( timer ) then killTimer ( timer ) end end ) addEventHandler ( "onPlayerJoin" , root , function ( ) setElementData ( source , "Online" , "N/A" ) end ) addEventHandler ( "onPlayerQuit" , root , function ( ) local pAccount = getPlayerAccount ( source ) if not isGuestAccount ( pAccount ) then local timer = getElementData ( source , "Online.timer" ) if isTimer ( timer ) then killTimer ( timer ) end end end ) function updatePlayerOnline ( player ) local pAccount = getPlayerAccount ( player ) local minutes = getAccountData ( pAccount , "Online.minutes" ) local hours = getAccountData ( pAccount , "Online.hours" ) minutes = tostring ( tonumber ( minutes ) + 1 ) if minutes == "60" then hours = tostring ( tonumber ( hours ) + 1 ) minutes = "00" end setAccountData ( pAccount , "Online.minutes" , tonumber ( minutes ) ) setAccountData ( pAccount , "Online.hours" , tonumber ( hours ) ) if # tostring ( minutes ) == 1 then minutes = "0" .. minutes end if # tostring ( hours ) == 1 then hours = "0" .. hours end setElementData ( player , "Online" , hours .. ":" .. minutes .. ":00" ) local timer = setTimer ( updatePlayerOnline , 60000 , 1 , player ) setElementData ( player , "Online.timer" , timer ) end
  15. Sil3nT

    Playtime

    This isnt working for Freeroam! The time isnt showing in column! I add resource to acl and nothing hapened! Server side: exports.scoreboard:addScoreboardColumn( 'Play Time' ) local t = { } local uTimers = { } function checkValues( source,arg1,arg2 ) if arg1 > 60 then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 elseif arg2 > 3600 then t[ source ][ 'sec' ] = 0 t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end end function onPlayerLogOut ( _,account ) if ( account ) and not isGuestAccount ( account ) then local sValue = getElementData( source,'Play Time' ) setAccountData ( account, "Play Time", tostring( sValue ) ) end if isTimer( uTimers[ source ] ) then killTimer( uTimers[ source ] ) end uTimers[ source ] = nil t[ source ] = nil end function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'Play Time' ) setAccountData ( playeraccount, "Play Time", tostring( sValue ) ) end if isTimer( uTimers[ source ] ) then killTimer( uTimers[ source ] ) end uTimers[ source ] = nil t[ source ] = nil end function subFind( str,mod ) if mod == 'hour' then return str:sub( 1,str:find( ':' ) -1 ) else return str:sub( str:find( ':' ) + 1,str:len( ) ) end end function onPlayerLogin (_, account ) if account then uTimers[ source ] = setTimer( function( player,acc ) local time = getAccountData ( acc, "Play Time" ) if time then if not t[ player ] then t[ player ] = { ["hour"] = tonumber( subFind( time,'hour' ) ), ["min"] = tonumber( subFind( time ) ), ["sec"] = 0 } end else if not t[ player ] then t[ player ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end end t[ player ][ 'sec' ] = tonumber( t[ player ][ 'sec' ] or 0 ) + 1 checkValues ( player, t[ player ][ 'sec' ] or 0, t[ player ][ 'min' ] or 0 ) setElementData ( player, "Play Time", tostring( t[ player ][ 'hour' ] or 0 )..':'..tostring( t[ player ][ 'min' ] or 0 ) ) end, 1000, 0 ,source,account ) end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) addEventHandler( 'onPlayerLogout',root, onPlayerLogOut )
  16. Sil3nT

    Playtime

    Hi guys! U are the best! I was wondering, do somebody have playtime script? Its like, it show every player playedtime in scoreboard collumn PlayTime? Thanks
  17. noooooooooo if u run that script some time like one hour then everybody have timeouts!
  18. DUDE! your script have some bug! in some time all players have timeout! IDK what script mybe that drift script what u change mybe rank script!
  19. How it looks in script? I dont even know where to start.
  20. Like when i loged in the score apear in tab yes?
  21. Everything is okay! YEAH ALL SAVES TNX A LOT MAN! Edit: CAn u help me one more thing? Ppl are saying that they need to best and total drift saves when reconnect! How to doo that? What to add in script?
  22. but the tab is working for u? is it changing drift rank?
  23. nope! i create something like this now (another script) local mejor is in drift counter resource named "best drift" exports.scoreboard:addScoreboardColumn('Drift Rank') addEventHandler("onVehicleDriftEnd",root, function() local account = getPlayerAccount(source) local mejor = getAccountData(account,"Best drift") if ( value >= 0 ) and ( value <= 29999 ) then setAccountData ( account, "Drift Rank", "Sucky" ) elseif ( value >= 30000 ) and ( value <= 89999 ) then setAccountData ( account, "Drift Rank", "Newbie" ) elseif ( value >= 90000 ) and ( value <= 149999 ) then setAccountData ( account, "Drift Rank", "Grandpa" ) elseif ( value >= 150000) and ( value <= 299999) then setAccountData ( account, "Drift Rank", "Amateur" ) elseif ( value >= 300000) and ( value <= 499999) then setAccountData ( account, "Drift Rank", "NewbieDrifter" ) elseif ( value >= 500000) and ( value <= 699999) then setAccountData ( account, "Drift Rank", "StreetDrifter" ) elseif ( value >= 700000) and ( value <= 9999999) then setAccountData ( account, "Drift Rank", "CrazyDrifter" ) elseif ( value >= 1000000) and ( value <= 1499999) then setAccountData ( account, "Drift Rank", "AwesomeDrifter" ) elseif ( value >= 1500000) and ( value <= 1999999) then setAccountData ( account, "Drift Rank", "MonsterDrift" ) elseif ( value >= 2000000) and ( value <= 2999999) then setAccountData ( account, "Drift Rank", "UltimateDrifter" ) elseif ( value >= 3000000) and ( value <= 3999999) then setAccountData ( account, "Drift Rank", "NoFeaR" ) elseif ( value >= 4000000) and ( value <= 4999999) then setAccountData ( account, "Drift Rank", "AnimalDrifter" ) elseif ( value >= 5000000) and ( value <= 5999999) then setAccountData ( account, "Drift Rank", "ServerDrifter" ) elseif ( value >= 6000000) and ( value <= 6999999) then setAccountData ( account, "Drift Rank", "PsyhoDrifter" ) elseif ( value >= 7000000) and ( value <= 7999999) then setAccountData ( account, "Drift Rank", "JDM|Drifter" ) elseif ( value >= 8000000) and ( value <= 9999999) then setAccountData ( account, "Drift Rank", "ProDrifter" ) elseif ( value >= 10000000) and ( value <= 20000000) then setAccountData ( account, "Drift Rank", "Elite-Drifter" ) end end )
×
×
  • Create New...