
Tony Brand
Members-
Posts
46 -
Joined
-
Last visited
Everything posted by Tony Brand
-
i need to use an event that checks time every second ,then if find 1:00 2:00 3:00 4:00 5:00 ... 23:00 00:00 for time,give a payday and start a hour timer,may better help?
-
Error in Line4: attempt to perform arithmetic on local 'Hour' (a nil value) function Payday() local Time = getRealTime() local Hour = Time.Hour local payTime = (Hour+60)*60 D = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24} for _,Hour in ipairs(D) do outputChatBox("Your Payday Is Here") setTimer(payday,payTime, 1) end end addEventHandler("onResourceStart",root, Payday)
-
function Payday() local Hour = Time.Hour local Minute = Time.Minute local payTime = Hour+60*60 D = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24] for Hour in ipairs(D) do outputChatBox("Your Payday Is Here") setTimer(payTime) end end addEventHandler(OnResourceStart,root) do you mean something like this?@Dimos7
-
hi guys i want to make a payday system that get time from RealTime for example if VPS time is 13:00 then resource Sends a message to all players "You Recived your Payday" but my problem is i can't understand how to do this with getRealTime and add an hourly timer too it,may any help?
-
thank you guys, now i learned where to use end in script
-
Hi, i made a cmd that runs an animation on a target player,is there anyway to make sure that the target player can't stop animation until code does something?
-
hi this is my code that prints player that have a elementdata for index,player in ipairs(getElementsByType("player") ) do if getElementData(player,"Money") == 10000 then local name = getPlayerName(player) outputChatBox(" "..name.." ",player) end end but as you it will use a single outputChatBox for each one, For Example result can be: Player1 Player2 Player3 ... PlayerN how to show all of them in one or few lines? like this ==> Player1, Player2, Player3, ..., PlayerN
-
Hi everyone,i am new to lua and i don't know exactly where i must put ends in code! i think i must put end under of every if & for when commands happens! so i made a code like this: function eventDeath(killer) local killed = getPlayerName (source) if ( killer ) then local killerPerson = getPlayerName (killer) if ( getElementData(killer,"Prison") == true ) or ( getElementData(source,"Prison") == true ) then for index,player in ipairs (getElementsByType("player")) do if ( getElementData(player,"Police") == true ) or ( getElementData(player,"AdminRank") >= 5 ) then outputChatBox(""..killerPerson.." Killed "..killed.." while he/she was in jail! ",player,255,255,255,true) end end end end addEventHandler ( "onPlayerWasted", getRootElement(), eventDeath ) can you help me to fix it and also tell me where i should exactly put end in my code?
-
it is not usefull, remove this
-
channelTable = { ["The Beat FM"] = "http://thebeat.no/thebeatlisten.m3u", [1] = "The Beat FM", ["101.9FM Chicago - The Mix"] = "http://playerservices.streamtheworld.com/pls/WTMXFM.pls", [2] = "101.9FM Chicago - The Mix", ["100.3FM Chicago - Rewind"] = "http://playerservices.streamtheworld.com/pls/WILVFM.pls", [3] = "100.3FM Chicago - Rewind", } local veh = getPedOccupiedVehicle(localPlayer) function onClientChangeStreamState_Handler() local veh = getPedOccupiedVehicle(localPlayer) if isPedInVehicle(localPlayer) then if getVehicleController(veh) == localPlayer then if(source == radioPlayerPlayButton) then if iAllowed == false then showWarning("Please Wait few seconds!") return false end iAllowed = false setTimer(setAllowed, 5000, 1) if Stream[veh] == nil then triggerServerEvent("sendSoundForAll", localPlayer, veh, currentChannel, radioVolume) guiSetVisible(radioPlayerPlayButton, false) guiSetVisible(radioPlayerStopButton, true) isMouseOverStop = true end elseif(source == radioPlayerStopButton) then if Stream[veh] then triggerServerEvent("getSoundStopForAll", veh) guiSetVisible(radioPlayerStopButton, false) guiSetVisible(radioPlayerPlayButton, true) guiSetText(radioMetaArtistLabel, "Artist: "..streamArtist) guiSetText(radioMetaTitleLabel, "Title: "..streamTitle) end end end end end addEventHandler("onClientGUIClick", getRootElement(), onClientChangeStreamState_Handler)
-
errors solved but now there are 4 warnings in debugscript gui and music doesn't play! https://pasteboard.co/HDRcH1e.png the part of that client side that made errors: addEvent("syncradio", true) addEventHandler("syncradio", root, function( ) local x, y, z = getElementPosition(source) Stream[source] = playSound3D(channelTable[channelTable[path]], x, y, z) setSoundEffectEnabled ( Stream[source], "compressor", true ) sPath[source] = path setSoundVolume(Stream[source], volume) setSoundMaxDistance(Stream[source], 50) attachElements(Stream[source], source) end)
-
hi, i am newbie in lua, i want to make a radio system that plays sound from vehicle for all players so i downloaded radio :O system from here but it doesn't have server side, so i made it my problem is that i get error when running resource but i think i don't have any mitake... error is Bad argument radio/server.lua:2 @ 'addEventHandler' [Expected function at argument 3, got nill] & radio/server.lua:10@ 'addEventHandler' [Expected function at argument 3, got nill] whole the server side is this: addEvent("getSoundStopForAll", true) addEventHandler("getSoundStopForAll", root, getSoundStopForAll ) function getSoundStopForAll( ) stopSound(Stream[source]) Stream[source] = nil sPath[source] = nil end addEvent("sendSoundForAll", true) addEventHandler("sendSoundForAll", root, sendSoundForAll ) function sendSoundForAll( ) triggerClientEvent(root, "syncradio", sendSoundForAll) end also here is syncradio ClientEvent addEvent("syncradio", true) addEventHandler("syncradio", root, function( ) local x, y, z = getElementPosition(source) Stream[source] = playSound3D(channelTable[channelTable[path]], x, y, z) setSoundEffectEnabled ( Stream[source], "compressor", true ) sPath[source] = path setSoundVolume(Stream[source], volume) setSoundMaxDistance(Stream[source], 50) attachElements(Stream[source], source) end)
-
tnx fixed
-
it has no error but again whole the server can hear the sound
-
addEvent("syncSong", true) addEventHandler("syncSong", root, function( ) local x,y,z = getElementPosition( ) local song = playSound3D("data/sound.mp3", x, y, z, false) setSoundVolume(song, 0.9) setSoundMaxDistance( song, 100 ) end) where i did wrong?
-
There is currently no text in this page , it is what i see in getPlayerPosition
-
yes i saw it, i need to get player x y z ! can you help me?
-
so it must change to local song = playSound3D("data/sound.mp3", false)
-
Hi, i made a function called syncSong it works like this: addEvent("syncSong", true) addEventHandler("syncSong", root, function( ) local song = playSound("data/sound.mp3", false) setSoundVolume(song, 0.9) setSoundMaxDistance(song, 2) end) as you see i setSoundMaxDistance(song, 2) so now sound must be played in a short range!but problem is when players use that command thats trigger this event,sound plays for whole server in every place! also here is the CommandHandler addCommandHandler( "alarm", triggerClientEvent("syncSong", getRootElement()) etc(another codes under this line...)
-
can you add any cmd or option for house owners to change House Price & make House for sell for another players?
-
bad argument #1 to 'ipairs' (table expected, got boolean) i have this error on resource start and resource won't work! it happens on Sqlite & Sql