-
Posts
4,121 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Kenix
-
Не ожидал от Mate_ такого ..
-
Server side. function takeMoney( thePlayer, commandName, target, money ) if exports.global:isPlayerLeadAdmin( thePlayer ) then if not target then outputChatBox( "SYNTAX: /" .. commandName .. " [Partial Player Nick] [Money]", thePlayer, 255, 194, 14 ) else local username = getPlayerName(thePlayer) local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick( thePlayer, target ) if targetPlayer then local adminTitle = exports.global:getPlayerAdminTitle( thePlayer ) exports.logs:logMessage( "[GIVE] " .. getPlayerName(thePlayer):gsub("_", " ") .. "\ gave " .. targetPlayerName .. " to $" .. money, 23 ) exports.global:sendMessageToAdmins( "AdmCmd: " .. getPlayerName( thePlayer ) .. "\ gave " .. targetPlayerName .. " " .. money .. " dollars." ) exports.global:takeMoney( targetPlayer, tonumber( money ) ) outputChatBox( "Random text " .. targetPlayerName .. " $" .. money .. ".", thePlayer ) outputChatBox( "Admin " .. username .. " has taken $" .. money .. ".", targetPlayer ) outputChatBox( " " .. tostring( adminTitle ) .. "\ " .. getPlayerName( thePlayer ) .. " took " .. targetPlayerName .. "\ " .. money .. " dollars.", root, 255, 0, 51 ) end end else outputChatBox( ' not isPlayerLeadAdmin' ) end end addCommandHandler( 'takemoney',takeMoney ) cmd /takemoney [player][ money ]
-
You want check if player not dead but dead? function earnMoney( ) local position = getAliveRacePlayers( ) outputChatBox( 'var:position '..tostring( position ) ) local acc = getPlayerAccount( source ) outputChatBox( 'var:acc '..tostring( acc ) ) outputChatBox( 'var:count '..tostring( count ) ) --if getElementData( source, "state" ) == "dead" then outputChatBox( 'state == dead ' ) if not isGuestAccount( acc ) then outputChatBox( ' not guest account ' ) if type( count ) == 'number' then outputChatBox( 'var:count == number' ) if not position <= 0 then outputChatBox( 'not positon <= 0' ) if getPlayerCount( ) >= count then outputChatBox( 'getPlayerCount( ) >= count' ) local pAlive = getAliveRacePlayers( ) local pDead = getDeadRacePlayers( ) outputChatBox( 'var:pAlive '..tostring( pAlive ) ) outputChatBox( 'var:pDead '..tostring( pDead ) ) local maxCash = 21*( pAlive + pDead ) -- Total cash available to earn. local portion = 0 local finalCash = 0 if not position == 1 then portion = math.ceil( maxCash/( pAlive+pDead-1 ) ) -- The amount to multiply by the number of dead players to later return the money value. finalCash = math.ceil( portion*( pDead ) ) -- Calculate the final money value. else finalCash = maxCash end local playerCash = getAccountData( acc,"Cash" ) or 0 outputChatBox( 'var:playerCash '..tostring( playerCash ) ) outputChatBox("#FFFFFF>> #ff8600You have recieved $" .. tostring( finalCash ) .. "!",source,255,255,255,true) setAccountData( acc,"Cash", tostring( playerCash ) + finalCash ) outputDebugString( "Final cash for player "..getPlayerName( source )..": "..tostring( finalCash ) ) else outputChatBox( "#FFFFFF>> #ff0000Need atleast " .. tostring( count ).. " players to affect the stats!", source, 255, 255, 255, true) return end scoreboardRefresh( source ) end else outputChatBox( 'count variable is not number' ) end else outputChatBox( 'guest account ' ) end --end end addEventHandler( "onPlayerWasted", root, earnMoney ) You not need check it Code updated.
-
Can you explain data name 'state' and value 'dead'?
-
No problem. addEvent( "stopplaySoundRobbery",true ) addEvent( "playSoundRobbery",true ) addEvent( "playSoundRobberyStop",true ) local timerShape,timerWasted bankMarker = createMarker( 364.00500488281,163.38682556152,1008.3828125,"cylinder",3,150,0,0,255 ) bankBip = createBlip ( 2416.5532226563, 1124.1168212891, 10.8203125, 36, 2 ) setElementInterior( bankMarker,3,364.00500488281,163.38682556152,1007.4828125 ) --3 int missionState = 0 bankColshape = createColCircle ( 2414.1735839844,1123.9982910156,10.8203125,1 ) addEventHandler( "onClientColShapeLeave",bankColshape, function( LeaveElement, matchingDimension ) if LeaveElement == localPlayer then if getElementData( LeaveElement,"bank" ) == 1 then setElementAlpha( bankMarker,255 ) outputChatBox( "`Миссия провалена вы не захватили банк!",255,0,0 ) triggerServerEvent( "ServerPlaySoundRobberyStop",root ) setElementData( LeaveElement,"bank",2 ) if isTimer( timerShape ) then killTimer( timerShape ) end timerShape = setTimer( function ( player ) setElementData( player,"bank",0 ) end, 60000, 1,LeaveElement ) end end end ) addEventHandler( "onClientPlayerWasted",localPlayer, function( ) if getElementData( source,"bank" ) == 1 then outputChatBox( "`Миссия провалена вы не захватили банк!",255,0,0 ) setElementAlpha( bankMarker,255 ) triggerServerEvent( "ServerPlaySoundRobberyStop",root ) setElementData( source,"bank",2 ) if isTimer( timerWasted ) then killTimer( timerWasted ) end timerWasted = setTimer( function( player ) setElementData( player,"bank",0 ) end, 60000, 1 , source ) end end ) addEventHandler( "playSoundRobbery",root, function( ) sound = playSound3D ("alarm.mp3", 364.00500488281,163.38682556152,1010.3828125, true ) setSoundMaxDistance ( sound, 50 ) end ) addEventHandler( "playSoundRobberyStop",root, function( ) stopSound( sound ) end ) addEventHandler( "onClientMarkerHit",bankMarker, function( hitElement, matchingDimension ) if hitElement == localPlayer then if getElementData( hitElement,"bank" ) == 1 or getElementData( hitElement,"bank" ) == 2 then return end showCursor( true ) bankWindow = guiCreateWindow(0.3184,0.3568,0.3809,0.306,"ROBBER",true) buttonYes = guiCreateButton(36,147,89,46,"Yes",false,bankWindow) buttonNo = guiCreateButton(251,147,89,46,"No",false,bankWindow) addEventHandler ( "onClientGUIClick", buttonYes, function( ) showCursor( false ) guiSetVisible( bankWindow,false ) triggerServerEvent( "ServerPlaySoundRobbery",root ) --triggerServerEvent("ServerPlaySoundRobbery",localPlayer) outputChatBox( "`Вы захватили банк вы должны продержаться 5 минут.",255,0,0 ) setElementAlpha( bankMarker,0 ) outputChatBox( "`Вы сможете захватить банк через 180 минут.",255,0,0 ) outputChatBox( "`Если вы выйдите из банка то миссия будет провалена!",255,0,0 ) setElementData( hitElement,"bank",1 ) callServerfunction( "setPlayerWantedLevel",hitElement, 6 ) --missionState = 1 if isTimer( bankRobberTimer ) then killTimer( bankRobberTimer ) end bankRobberTimer = setTimer( function( ) outputChatBox("`Вы успешно ограбили банк вы получили 100 000 $.",255,0,0) triggerServerEvent("ServerPlaySoundRobberyStop",root) setTimer( function( ) setElementData( localPlayer,"bank",0 ) setElementAlpha( bankMarker,255 ) end, 60000 , 1 ) callServerfunction( 'givePlayerMoney',localPlayer,100000 ) end, 60000, 1 ) --300000 end ,false ) addEventHandler ( "onClientGUIClick", buttonNo, function ( ) showCursor( false ) guiSetVisible( bankWindow,false ) end ,false ) end end ) function callServerfunction( funcname, ... ) local arg = { ... } if arg[1] then for key, value in next, arg do if type( value ) == "number" then arg[ key ] = tostring( value ) end end end triggerServerEvent( "onClientCallsServerFunction", resourceRoot , funcname, unpack( arg ) ) end addCommandHandler( "data", function( ) setElementData( localPlayer,"bank",0 ) end ) So if you start bank robbing marker is hide. If bank robber is done marker become show in next 1 min. If you left bank robbing or die marker show.
-
This not good. Benox is right.You need search texture and create alpha. https://nightly.multitheftauto.com/files/shaders/ ... _names.zip
-
Nice video. Good job.
-
Test it and say what output. function earnMoney( ) local position = getAliveRacePlayers( ) outputChatBox( 'var:position '..tostring( position ) ) local acc = getPlayerAccount( source ) outputChatBox( 'var:acc '..tostring( acc ) ) outputChatBox( 'var:count '..tostring( count ) ) if not getElementData( source, "state" ) == "dead" then outputChatBox( 'state == dead ' ) if not isGuestAccount( acc ) then outputChatBox( ' not guest account ' ) if type( count ) == 'number' then outputChatBox( 'var:count == number' ) if not position <= 0 then outputChatBox( 'not positon <= 0' ) if getPlayerCount( ) >= count then outputChatBox( 'getPlayerCount( ) >= count' ) local pAlive = getAliveRacePlayers( ) local pDead = getDeadRacePlayers( ) outputChatBox( 'var:pAlive '..tostring( pAlive ) ) outputChatBox( 'var:pDead '..tostring( pDead ) ) local maxCash = 21*( pAlive + pDead ) -- Total cash available to earn. local portion = 0 local finalCash = 0 if not position == 1 then portion = math.ceil( maxCash/( pAlive+pDead-1 ) ) -- The amount to multiply by the number of dead players to later return the money value. finalCash = math.ceil( portion*( pDead ) ) -- Calculate the final money value. else finalCash = maxCash end local playerCash = getAccountData( acc,"Cash" ) or 0 outputChatBox( 'var:playerCash '..tostring( playerCash ) ) outputChatBox("#FFFFFF>> #ff8600You have recieved $" .. tostring( finalCash ) .. "!",source,255,255,255,true) setAccountData( acc,"Cash", tostring( playerCash ) + finalCash ) outputDebugString( "Final cash for player "..getPlayerName( source )..": "..tostring( finalCash ) ) else outputChatBox( "#FFFFFF>> #ff0000Need atleast " .. tostring( count ).. " players to affect the stats!", source, 255, 255, 255, true) return end scoreboardRefresh( source ) end else outputChatBox( 'count variable is not number' ) end else outputChatBox( 'guest account ' ) end end end addEventHandler( "onPlayerWasted", root, earnMoney )
-
Better http://www.colorpicker.com/ Always use.
-
My bad forgot 'g' in function getElementData addEvent( "stopplaySoundRobbery",true ) addEvent( "playSoundRobbery",true ) addEvent( "playSoundRobberyStop",true ) local timerShape,timerWasted bankMarker = createMarker( 364.00500488281,163.38682556152,1008.3828125,"cylinder",3,150,0,0,255 ) bankBip = createBlip ( 2416.5532226563, 1124.1168212891, 10.8203125, 36, 2 ) setElementInterior( bankMarker,3,364.00500488281,163.38682556152,1007.4828125 ) --3 int missionState = 0 bankColshape = createColCircle ( 2414.1735839844,1123.9982910156,10.8203125,1 ) addEventHandler( "onClientColShapeLeave",bankColshape, function( LeaveElement, matchingDimension ) if LeaveElement == localPlayer then if getElementData( LeaveElement,"bank" ) == 1 then outputChatBox( "`Миссия провалена вы не захватили банк!",255,0,0 ) triggerServerEvent( "ServerPlaySoundRobberyStop",root ) setElementData( LeaveElement,"bank",2 ) if isTimer( timerShape ) then killTimer( timerShape ) end timerShape = setTimer( function ( player ) setElementData( player,"bank",0 ) end, 60000, 1,LeaveElement ) end end end ) addEventHandler( "onClientPlayerWasted",localPlayer, function( ) if getElementData( source,"bank" ) == 1 then outputChatBox( "`Миссия провалена вы не захватили банк!",255,0,0 ) triggerServerEvent( "ServerPlaySoundRobberyStop",root ) setElementData( source,"bank",2 ) if isTimer( timerWasted ) then killTimer( timerWasted ) end timerWasted = setTimer( function( player ) setElementData( player,"bank",0 ) end, 60000, 1 , source ) end end ) addEventHandler( "playSoundRobbery",root, function( ) sound = playSound3D ("alarm.mp3", 364.00500488281,163.38682556152,1010.3828125, true ) setSoundMaxDistance ( sound, 50 ) end ) addEventHandler( "playSoundRobberyStop",root, function( ) stopSound( sound ) end ) addEventHandler( "onClientMarkerHit",bankMarker, function( hitElement, matchingDimension ) if hitElement == localPlayer then if getElementData( hitElement,"bank" ) == 1 or getElementData( hitElement,"bank" ) == 2 then return end showCursor( true ) bankWindow = guiCreateWindow(0.3184,0.3568,0.3809,0.306,"ROBBER",true) buttonYes = guiCreateButton(36,147,89,46,"Yes",false,bankWindow) buttonNo = guiCreateButton(251,147,89,46,"No",false,bankWindow) addEventHandler ( "onClientGUIClick", buttonYes, function( ) showCursor( false ) guiSetVisible( bankWindow,false ) triggerServerEvent( "ServerPlaySoundRobbery",root ) --triggerServerEvent("ServerPlaySoundRobbery",localPlayer) outputChatBox( "`Вы захватили банк вы должны продержаться 5 минут.",255,0,0 ) outputChatBox( "`Вы сможете захватить банк через 180 минут.",255,0,0 ) outputChatBox( "`Если вы выйдите из банка то миссия будет провалена!",255,0,0 ) setElementData( hitElement,"bank",1 ) callServerfunction( "setPlayerWantedLevel",hitElement, 6 ) --missionState = 1 if isTimer( bankRobberTimer ) then killTimer( bankRobberTimer ) end bankRobberTimer = setTimer( function( ) outputChatBox("`Вы успешно ограбили банк вы получили 100 000 $.",255,0,0) triggerServerEvent("ServerPlaySoundRobberyStop",root) setTimer( function( ) setElementData( localPlayer,"bank",0 ) end, 60000 , 1 ) callServerfunction( 'givePlayerMoney',localPlayer,100000 ) end, 60000, 1 ) --300000 end ,false ) addEventHandler ( "onClientGUIClick", buttonNo, function ( ) showCursor( false ) guiSetVisible( bankWindow,false ) end ,false ) end end ) function callServerfunction( funcname, ... ) local arg = { ... } if arg[1] then for key, value in next, arg do if type( value ) == "number" then arg[ key ] = tostring( value ) end end end triggerServerEvent( "onClientCallsServerFunction", resourceRoot , funcname, unpack( arg ) ) end addCommandHandler( "data", function( ) setElementData( localPlayer,"bank",0 ) end ) It should work.
-
It should work. addEvent( "stopplaySoundRobbery",true ) addEvent( "playSoundRobbery",true ) addEvent( "playSoundRobberyStop",true ) local timerShape,timerWasted bankMarker = createMarker( 364.00500488281,163.38682556152,1008.3828125,"cylinder",3,150,0,0,255 ) bankBip = createBlip ( 2416.5532226563, 1124.1168212891, 10.8203125, 36, 2 ) setElementInterior( bankMarker,3,364.00500488281,163.38682556152,1007.4828125 ) --3 int missionState = 0 bankColshape = createColCircle ( 2414.1735839844,1123.9982910156,10.8203125,1 ) addEventHandler( "onClientColShapeLeave",bankColshape, function( LeaveElement, matchingDimension ) if LeaveElement == localPlayer then if getElementData( LeaveElement,"bank" ) == 1 then outputChatBox( "`Миссия провалена вы не захватили банк!",255,0,0 ) triggerServerEvent( "ServerPlaySoundRobberyStop",root ) setElementData( LeaveElement,"bank",2 ) if isTimer( timerShape ) then killTimer( timerShape ) end timerShape = setTimer( function ( player ) setElementData( player,"bank",0 ) end, 60000, 1,LeaveElement ) end end end ) addEventHandler( "onClientPlayerWasted",localPlayer, function( ) if getElementData( source,"bank" ) == 1 then outputChatBox( "`Миссия провалена вы не захватили банк!",255,0,0 ) triggerServerEvent( "ServerPlaySoundRobberyStop",root ) setElementData( source,"bank",2 ) if isTimer( timerWasted ) then killTimer( timerWasted ) end timerWasted = setTimer( function( player ) setElementData( player,"bank",0 ) end, 60000, 1 , source ) end end ) addEventHandler( "playSoundRobbery",root, function( ) sound = playSound3D ("alarm.mp3", 364.00500488281,163.38682556152,1010.3828125, true ) setSoundMaxDistance ( sound, 50 ) end ) addEventHandler( "playSoundRobberyStop",root, function( ) stopSound( sound ) end ) addEventHandler( "onClientMarkerHit",bankMarker, function( hitElement, matchingDimension ) if hitElement == localPlayer then if getElementData( hitElement,"bank" ) == 1 or etElementData( hitElement,"bank" ) == 2 then return end showCursor( true ) bankWindow = guiCreateWindow(0.3184,0.3568,0.3809,0.306,"ROBBER",true) buttonYes = guiCreateButton(36,147,89,46,"Yes",false,bankWindow) buttonNo = guiCreateButton(251,147,89,46,"No",false,bankWindow) addEventHandler ( "onClientGUIClick", buttonYes, function( ) showCursor( false ) guiSetVisible( bankWindow,false ) triggerServerEvent( "ServerPlaySoundRobbery",root ) --triggerServerEvent("ServerPlaySoundRobbery",localPlayer) outputChatBox( "`Вы захватили банк вы должны продержаться 5 минут.",255,0,0 ) outputChatBox( "`Вы сможете захватить банк через 180 минут.",255,0,0 ) outputChatBox( "`Если вы выйдите из банка то миссия будет провалена!",255,0,0 ) setElementData( hitElement,"bank",1 ) callServerfunction( "setPlayerWantedLevel",hitElement, 6 ) --missionState = 1 if isTimer( bankRobberTimer ) then killTimer( bankRobberTimer ) end bankRobberTimer = setTimer( function( ) outputChatBox("`Вы успешно ограбили банк вы получили 100 000 $.",255,0,0) triggerServerEvent("ServerPlaySoundRobberyStop",root) setTimer( function( ) setElementData( localPlayer,"bank",0 ) end, 60000 , 1 ) callServerfunction( 'givePlayerMoney',localPlayer,100000 ) end, 60000, 1 ) --300000 end ,false ) addEventHandler ( "onClientGUIClick", buttonNo, function ( ) showCursor( false ) guiSetVisible( bankWindow,false ) end ,false ) end end ) function callServerfunction( funcname, ... ) local arg = { ... } if arg[1] then for key, value in next, arg do if type( value ) == "number" then arg[ key ] = tostring( value ) end end end triggerServerEvent( "onClientCallsServerFunction", resourceRoot , funcname, unpack( arg ) ) end addCommandHandler( "data", function( ) setElementData( localPlayer,"bank",0 ) end ) /debugscript 3?
-
RAFuLL,Юзай бб коды [xml][/xml] addEventHandler( "onClientMarkerHit", marker1, function ( player,dim ) if player == localPlayer then createWindow( wndCreateVehicle ) showCursor ( true ) end end )
-
Explain better. addEvent( "stopplaySoundRobbery",true ) addEvent( "playSoundRobbery",true ) addEvent( "playSoundRobberyStop",true ) bankMarker = createMarker( 364.00500488281,163.38682556152,1008.3828125,"cylinder",3,150,0,0,255 ) bankBip = createBlip ( 2416.5532226563, 1124.1168212891, 10.8203125, 36, 2 ) setElementInterior( bankMarker,3,364.00500488281,163.38682556152,1007.4828125 ) --3 int missionState = 0 bankColshape = createColCircle ( 2414.1735839844,1123.9982910156,10.8203125,1 ) addEventHandler( "onClientColShapeLeave",bankColshape, function( LeaveElement, matchingDimension ) if LeaveElement == localPlayer then if getElementData( LeaveElement,"bank" ) == 1 then outputChatBox( "`Миссия провалена вы не захватили банк!",255,0,0 ) triggerServerEvent( "ServerPlaySoundRobberyStop",root ) if isTimer( bankRobberTimer ) then killTimer( bankRobberTimer ) end setElementData( LeaveElement,"bank",2 ) setTimer( function ( player ) setElementData( player,"bank",0 ) end, 60000, 1,LeaveElement ) end end end ) addEventHandler( "onClientPlayerWasted",localPlayer, function( ) if getElementData( source,"bank" ) == 1 then outputChatBox( "`Миссия провалена вы не захватили банк!",255,0,0 ) triggerServerEvent( "ServerPlaySoundRobberyStop",root ) setElementData( source,"bank",2 ) if isTimer( bankRobberTimer ) then killTimer( bankRobberTimer ) end setTimer( function( player ) setElementData( player,"bank",0 ) end, 60000, 1 , source ) end end ) addEventHandler( "playSoundRobbery",root, function( ) sound = playSound3D ("alarm.mp3", 364.00500488281,163.38682556152,1010.3828125, true ) setSoundMaxDistance ( sound, 50 ) end ) addEventHandler( "playSoundRobberyStop",root, function( ) stopSound( sound ) end ) addEventHandler( "onClientMarkerHit",bankMarker, function( hitElement, matchingDimension ) if hitElement == localPlayer then if getElementData( hitElement,"bank" ) == 1 or etElementData( hitElement,"bank" ) == 2 then return end showCursor( true ) bankWindow = guiCreateWindow(0.3184,0.3568,0.3809,0.306,"ROBBER",true) buttonYes = guiCreateButton(36,147,89,46,"Yes",false,bankWindow) buttonNo = guiCreateButton(251,147,89,46,"No",false,bankWindow) addEventHandler ( "onClientGUIClick", buttonYes, function( ) showCursor( false ) guiSetVisible( bankWindow,false ) triggerServerEvent( "ServerPlaySoundRobbery",root ) --triggerServerEvent("ServerPlaySoundRobbery",localPlayer) outputChatBox( "`Вы захватили банк вы должны продержаться 5 минут.",255,0,0 ) outputChatBox( "`Вы сможете захватить банк через 180 минут.",255,0,0 ) outputChatBox( "`Если вы выйдите из банка то миссия будет провалена!",255,0,0 ) setElementData( hitElement,"bank",1 ) callServerfunction( "setPlayerWantedLevel",hitElement, 6 ) --missionState = 1 if isTimer( bankRobberTimer ) then killTimer( bankRobberTimer ) end bankRobberTimer = setTimer( function( ) outputChatBox("`Вы успешно ограбили банк вы получили 100 000 $.",255,0,0) triggerServerEvent("ServerPlaySoundRobberyStop",root) setTimer( function( ) setElementData( localPlayer,"bank",0 ) end, 60000 , 1 ) callServerfunction( 'givePlayerMoney',localPlayer,100000 ) end, 60000, 1 ) --300000 end ,false ) addEventHandler ( "onClientGUIClick", buttonNo, function ( ) showCursor( false ) guiSetVisible( bankWindow,false ) end ,false ) end end ) function callServerfunction( funcname, ... ) local arg = { ... } if arg[1] then for key, value in next, arg do if type( value ) == "number" then arg[ key ] = tostring( value ) end end end triggerServerEvent( "onClientCallsServerFunction", resourceRoot , funcname, unpack( arg ) ) end addCommandHandler( "data", function( ) setElementData( localPlayer,"bank",0 ) end )
-
No problem
-
local currentSound = nil local musicURL = { [1] = { name='David Guetta - Where Dem Girls At', url='http://199.167.195.178/wdga.mp3' }, [2] = { name='Coldplay - Paradise', url='http://199.167.195.178/pd.mp3' }, [3] = { name='Coldplay - Viva la Vida', url='http://199.167.195.178/vlv.mp3' }, [4] = { name='Ana Malhoa - Danza Kuduro', url='http://199.167.195.178/dk.mp3' }, [5] = { name='Klaas - The Way', url='http://199.167.195.178/tw.mp3' }, [6] = { name='Basshunter - All I ever Wanted', url='http://199.167.195.178/bh-aiew.mp3' }, [7] = { name='Whiz Khalifa - Black and Yellow', url='http://199.167.195.178/wk-bay.mp3' }, [8] = { name='Skrillex - My name is Skrillex', url='http://199.167.195.178/sx-mnis.mp3' }, [9] = { name='Italobrothers - Stamp on the Ground', url='http://199.167.195.178/ib-sotg.mp3' }, [10] = { name='Madcon - Freaky Like Me', url='http://199.167.195.178/mc-flm.mp3' }, [11] = { name='Cut the Music - Greatest Deejay', url='http://199.167.195.178/ctm-gd.mp3' } --[['http://199.167.195.178/tv.mp3', 'http://199.167.195.178/wttc.mp3', 'http://199.167.195.178/iml.mp3', 'http://199.167.195.178/ctwykm.mp3', 'http://199.167.195.178/e-ksb9rx.mp3', 'http://199.167.195.178/Lights.mp3', 'http://199.167.195.178/nod.mp3', 'http://199.167.195.178/atb-yana.mp3']]-- } addEventHandler('onClientResourceStart',resourceRoot, function( ) local rnd = musicURL[ math.random( #musicURL ) ] local name, song = rnd.name,rnd.url currentSound = playSound( song,false ); addEventHandler( 'onClientRender', root, playing ) musicName = tostring( name ) setTimer( function( ) removeEventHandler( 'onClientRender',root,playing ) end,10000, 1 ) end ) addEventHandler('onClientElementDestroy', root, function( ) if isSoundPaused( currentSound ) then return end if source == currentSound then local rnd = musicURL[ math.random( #musicURL ) ] local name, song = rnd.name,rnd.url currentSound = playSound( song,false ); removeEventHandler( 'onClientRender',root,playing ) addEventHandler( 'onClientRender', root, playing ) musicName = tostring( name ) setTimer( function( ) removeEventHandler( 'onClientRender',root,playing ) end, 10000, 1 ) end; end ); rand = setTimer( function( ) if isSoundPaused( currentSound ) then return end if not currentSound then local rnd = musicURL[ math.random( #musicURL ) ] local name, song = rnd.name,rnd.url currentSound = playSound( song,false ); addEventHandler( 'onClientRender', root, playing ) musicName = tostring( name ) setTimer( function( ) removeEventHandler( 'onClientRender',root,playing ) end, 10000, 1 ) end end, 1000,0 )
-
Server triggerClientEvent( 'playSound',root ) Client addEvent( 'playSound',true ) addEventHandler( 'playSound',root, function( ) playSound( ... ) -- ... arguments end )
-
[lua][/lua] highlighting
Kenix replied to Static-X's topic in Site/Forum/Discord/Mantis/Wiki related
[ code=lua ] g = [[ text ]] [ lua ] g = [[ text ]] [ code ] g = [[ text ]] text in [[ ]] should be color coded. -
Server addEventHandler( 'onMarkerHit',marker, -- marker variable function( element,dim ) if getElementType( element ) == 'object' then outputChatBox( 'object detected' ) end end ) Remember is detected only mta elements( object ). If you enter the building ( not mta element ) it not detected. Use processLineOfSight.
-
Use explosions if player weapon fire.