Jump to content

Sil3nT

Members
  • Posts

    50
  • Joined

  • Last visited

About Sil3nT

  • Birthday 22/05/1996

Details

  • Gang
    |ExP-Drifters|Owner
  • Location
    www.expgaming.ucoz.com
  • Interests
    MTA SA DRIFTTTTTTTTTTTTTT

Sil3nT's Achievements

Snitch

Snitch (10/54)

0

Reputation

  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 )
×
×
  • Create New...