-
Posts
4,121 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Kenix
-
Понты?Вы сами показали , как вы 'хорошо' знаете русский язык. Лучше не показывайте себя. У вас это не получается.
-
Это ваша проблема , что вы не понимаете.
-
Yeah in him code variable thePlayer not element this is PosX. https://wiki.multitheftauto.com/wiki/OnPlayerSpawn
-
Try Client function click ( ) if source == grid_players then local selectedPlayer = guiGridListGetItemText ( grid_players, guiGridListGetSelectedItem ( grid_players ), 1 ) if selectedPlayer ~= '' then outputChatBox ( tostring( selectedPlayer ) ) -- output it to chat box guiSetText( lbl_f_showstats, "Showing statistics of the player " ..tostring( selectedPlayer ) ) local from = getPlayerFromName( selectedPlayer ) if isElement( from ) then triggerServerEvent( "gStats", from ) end end end end Server addEvent( "gStats", true ) function Get( ) local acc = getPlayerAccount( source ) if acc then if not isGuestAccount ( acc ) then local wins = getAccountData( acc, "wins" ) or "NO" local deaths = getAccountData( acc, "deaths" ) or " NO" local cash = getAccountData( acc, "cash" ) or " NO$" local points = getAccountData( acc, "points" ) or " NO" local ttset = getAccountData( acc, "ttset" ) or " NO" --triggerServerEvent("rStats", root, wins, deaths, cash, points, ttset) outputChatBox( "TRIGGERED: " .. wins .. deaths .. cash .. points .. ttset ) else outputChatBox( "GUEST" ) end else outputChatBox( "not get account" ) end end addEventHandler( "gStats", root, Get ) Updated again.
-
Upload resource. And give me link i test it.
-
local message = { "#ffff00RADIO: #ffffffStream stopped" } local posX, posY, posZ = 269.70001220703, -1895.0999755859, 0.69999998807907 local RadioColshape = createColCircle ( 269.70001220703, -1895.0999755859, 0.69999998807907,150 ) local radioURL = "http://www.181.fm/winamp.pls?station=181-power&style=mp3" local radius = 150 local volume = 4.0 local bSpam local radio = playSound3D( radioURL, posX, posY, posZ, false ) setSoundVolume( radio, volume) setSoundMaxDistance( radio, radius ) addEventHandler( "onClientColShapeLeave",RadioColshape, function( tplayer ) if getElementType( tplayer ) == "player" and tplayer == localPlayer then if not bSpam then setTimer( outputChatBox, 800, 1, message [ math.random( #message ) ], 255, 255, 255, true ) bSpam = true setTimer( function( ) bSpam = false end, 50000, 1 ) end end end ) Idk i tested it and it working.
-
No problem Number https://wiki.multitheftauto.com/wiki/RU/Resource:Race
-
I tested it now it working! local message = { "#ffff00RADIO: #ffffffStream stopped" } local posX, posY, posZ = 269.70001220703, -1895.0999755859, 0.69999998807907 local RadioColshape = createColCircle ( 269.70001220703, -1895.0999755859, 0.69999998807907,150 ) local radioURL = "http://www.181.fm/winamp.pls?station=181-power&style=mp3" local radius = 150 local volume = 4.0 local bSpam local radio = playSound3D( radioURL, posX, posY, posZ, false ) setSoundVolume( radio, volume) setSoundMaxDistance( radio, radius ) addEventHandler( "onClientColShapeLeave",RadioColshape, function( tplayer ) if getElementType( tplayer ) == "player" and tplayer == localPlayer then if not bSpam then setTimer( outputChatBox, 800, 1, message [ math.random( #message ) ], 255, 255, 255, true ) bSpam = true end setTimer( function( ) bSpam = false end, 50000, 1 ) end end )
-
Tested. Lol, If somebody leave it output only 1 time in 50 sec( So if you leave and again leave it not output , but if leave and timer not have it output ). You can remove timer.
-
local message = { "#ffff00RADIO: #ffffffStream stopped" } local posX, posY, posZ = 269.70001220703, -1895.0999755859, 0.69999998807907 local RadioColshape = createColCircle ( 269.70001220703, -1895.0999755859, 0.69999998807907,150 ) local radioURL = "http://www.181.fm/winamp.pls?station=181-power&style=mp3" local radius = 150 local volume = 4.0 local bSpam local radio = playSound3D( radioURL, posX, posY, posZ, false ) setSoundVolume( radio, volume) setSoundMaxDistance( radio, radius ) addEventHandler( "onClientColShapeLeave",RadioColshape, function( tplayer ) if getElementType( tplayer ) == "player" and tplayer == localPlayer then if not bSpam then setTimer( outputChatBox, 800, 1, math.random( #message ), 255, 255, 255, true ) bSpam = true setTimer( function( ) bSpam = false end, 50000, 1 ) end end end )
-
Predator, https://wiki.multitheftauto.com/wiki/AddEventHandler https://wiki.multitheftauto.com/wiki/Scr ... troduction
-
My bad Tested: request = executeSQLQuery [[CREATE TABLE IF NOT EXISTS Top ( map TEXT, player TEXT, time TEXT )]] addEventHandler( 'onGamemodeMapStart',root, function( mapname ) local mapName = getResourceName( mapname ) if mapName then outputChatBox '1' local result = executeSQLQuery ( "SELECT * FROM Top WHERE map = '" ..mapName.. "'" ) if not result or #result == 0 then -- not use result == false just use operator not you check ( if value nil or false ) outputChatBox '2' executeSQLQuery( "INSERT INTO Top VALUES ('"..mapName.."','No one', '')" ) local resultt = executeSQLQuery ( "SELECT * FROM Top WHERE map = '" ..mapName.. "'" ) outputChatBox( 'Top: ' .. tostring( resultt[1]['map'] ).. ' | Time: ' ..tostring( resultt[1]['time'] ) ) else outputChatBox '3' end end end )
-
Client addEvent( 'onAccountsSend',true ) local labels = { } addEventHandler( 'onAccountsSend',root, function( t ) for index, data in ipairs( t ) do labels[ index ] = guiCreateLabel(13,53 * index,526,276,"#"..tostring( index )..": "..tostring( data.account ).."- "..tostring( data.points ),false,tab_leaderboard ) guiSetFont( labels[ index ],"clear-normal" ) if index == 10 then break end end end ) Server function sortAccounts( ) local rowdata = { } for _, account in pairs( getAccounts( ) ) do rowdata[ #rowdata + 1 ] = { account = getAccountName( account ), points = getAccountData( account,"Points" ) } end table.sort( rowdata, function ( a, b ) return ( tonumber( a.points ) or 0 ) > ( tonumber( b.points ) or 0 ) end ) return rowdata end function tables( ) outputChatBox( "Top 3 points:", root, 255,255,255 ) for index, data in ipairs( sortAccounts( ) ) do outputChatBox("#"..tostring( index )..": ".. tostring( data.account ) .." - ".. tostring( data.points ), root, 255, 255, 255 ) if index == 3 then break end end triggerClientEvent( 'onAccountsSend',root,sortAccounts( ) ) end addCommandHandler( "top", tables ) Tested. Updated.
-
If you leave colshape then it output.
-
Try again i update code. Use /debugscript 3.
-
Try Server function sortAccounts( ) local rowdata = { } for _, account in pairs( getAccounts( ) ) do rowdata[ #rowdata + 1 ] = { account = getAccountName( account ), points = getAccountData( account,"Points" ) } end table.sort( rowdata, function ( a, b ) return ( tonumber( a.points ) or 0 ) > ( tonumber( b.points ) or 0 ) end ) return rowdata end function tables( ) outputChatBox( "Top 3 points:", root, 255,255,255 ) for index, data in ipairs( sortAccounts( ) ) do outputChatBox("#"..tostring( index )..": ".. tostring( data.account ) .." - ".. tostring( data.points ), root, 255, 255, 255 ) if index == 3 then break end end triggerClientEvent( 'onAccountsSend',root,sortAccounts( ) ) end addCommandHandler( "top", tables ) Client addEvent( 'onAccountsSend',true ) addEventHandler( 'onAccountsSend',root, function( t ) for index, data in ipairs( t ) do local label = guiCreateLabel(13,53 * index,26,276,"#"..tostring( index )..": "..tostring( data.account ).."\ - "..tostring( data.points ),false,tab_leaderboard ) guiSetFont( label,"clear-normal" ) if index == 10 then break end end end ) Updated again.
-
Try request = executeSQLQuery [[CREATE TABLE IF NOT EXISTS Top ( map TEXT, player TEXT, time TEXT )]] addEventHandler( 'onGamemodeMapStart',root, function( mapname ) local mapName = getResourceName( mapname ) local result = executeSQLQuery ( "SELECT * Top WHERE map = '" ..mapName.. "'" ) if not result or #result == 0 then -- not use result == false just use operator not you check ( if value nil or false ) executeSQLQuery( "INSERT INTO Top VALUES ('"..mapName.."','No one', '')" ) local result = executeSQLQuery ( "SELECT * Top WHERE map = '" ..mapName.. "'" ) outputChatBox( 'Top: ' .. tostring( result['map'] ).. ' | Time: ' ..tostring( result['time'] ) ) else end end ) Updated.