-
Posts
732 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Bean666
-
i want a timer to save for a newly joined player, because this script that i'm doing is a global event, there will be a DX Timer showed in each player's screen , example: Event ending in : 120 seconds then each tick - 1 seconds but when there is a new player that joins the server his timer resets. example: players that were ingame now 50 seconds new player that joined : still 120 seconds. i want the timer for all players the same. should i create a timeTable or smth local sX,sY = guiGetScreenSize() local counter = 120 local r,g,b = 0,255,0 local redzone = createColRectangle ( -2978.78857, -806.87402, 1980, 2500 ) redzonemaparea = createRadarArea (-2978.78857, -806.87402, 1980, 2500, 255, 0, 0, 120) local timeTable = {}; function res(Res) outputChatBox("Event will end in 2 minutes!!", 255, 0, 0) addEventHandler("onClientRender",root,draw) end addEventHandler("onClientResourceStart", getRootElement(), res) function draw() dxDrawText("Event Ending: "..counter,0,sY*0.8,sX,sY,tocolor(r,g,b,255),2,"default","center","top",false,false,false) end removeEventHandler("onClientRender", root, draw) timer = setTimer(function() counter = counter - 1 if counter < 0 then counter = 120 r,g,b = 0,255,0 end if counter <= 10 then r,g,b = 255,0,0 end if counter == 0 then for i,v in ipairs(getElementsByType("player")) do outputChatBox("IMPACT!", 255, 0, 0, false) if isTimer(timer) then killTimer(timer) end if isTimer(timer2) then killTimer(timer2) end end end end,1000,0) timer2 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player, redzone) then outputChatBox("WARNING: Event ending!!", 255, 0, 0, false) end end end, 10000, 0) timer3 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player, redzone) then setElementHealth(player, 0) setWeather(19) if isTimer(timer2) then killTimer(timer2) end end end end, 125000, 1) timer4 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isElementWithinColShape(player, redzone) then fadeCamera ( false, 1.0, 230, 178, 35 ) setTimer(fadeCamera, 3000, 1, true, 0.5) end end end, 122000, 1) timer5 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do sound = playSound("sound.mp3", false) if isElement(sound) then setSoundVolume(sound, 0.-- s8) --> end end end, 109400, 1) timer6 = setTimer(function() for i, player in ipairs(getElementsByType("player")) do if isTimer(timer3) then killTimer(timer3) end if isTimer(timer4) then killTimer(timer3) end if isTimer(timer5) then killTimer(timer3) end end end, 130000, 1)
-
Well im making an event it has a timer with a DX Text, but when a player joins, the timer resets for him , like a brand new timer. how can i save the timer duration to the new players that joined? because basically i want this event , the timer for all players. same timer for all of them , any examples or instructions? Example of how i mean: i start resource DX Text shows up: Event ending in : 120 seconds timer goes on example: player ingame have 40 secs , all of them but when a new player joins his timer goes back to 120 seconds, how to save the timer for new players that joined?
-
tails script is serverside, paste overkillz code into client side. make a new file called client.lua or whatever and paste this on your meta.xml
-
i helped you before. and im just telling you to learn, you cant just ask for anything you need. you also need to try something yourself. i already gave you the functions. just go to wiki and learn what the function does. why can't you try something and show us what you did? for that timer DX thing you'll just need 3 things to learn setTimer dxDrawText onClientRender i'm not against you or anything. but again, you can't just ask for anything you need. i actually like to do scripts for you it's fun but you have to try / do it yourself.
-
make sure that the player is in ACL grid before u do /add because if he is not in the ACL Grid he would give the error of course that's why there is "ELSE"
-
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "grid" ) ) then aclGroupAddObject (aclGetGroup("grid"), "user."..accountName) this one doesn't make sense, if you are in ACL Group "grid" then why are u gonna add yourself again to the acl "grid"? what exactly do u want to do? of course it would give them this error: outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /add [login]", player, 255,255,255, true) if they are not in the ACL gridl
-
what's the error in debugscript 3? edit: try , if there are errors tell us. function dartag (player, commandName, accountName) local accountName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "grid" ) ) then aclGroupAddObject (aclGetGroup("grid"), "user."..accountName) outputChatBox ("Voce adicionou "..accountName.." com sucesso na sua TAG", player, 255,255,255, true) else outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /add [login]", player, 255,255,255, true) end end addCommandHandler ("add", dartag) function removetag (player, commandName, accountName) local accountName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "grid" ) ) then aclGroupRemoveObject (aclGetGroup("grid"), "user."..accountName) outputChatBox ("Voce removeu "..accountName.." com sucesso da sua TAG", player, 255,255,255, true) else outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /rm [login]", player, 255,255,255, true) end end addCommandHandler ("rm", removetag)
-
oh please, if you tried then show us your code.
-
that's why u need to learn. i already gave you the functions. learn the functions and how to script it.
-
you could use dxDrawText onClientRender setTimer it would do.
-
remove your local hour and try replacing it with this: local hour, minute = getTime ( ) no need to edit the if (hour) stuff.
-
man you can't just ask for anything. you won't learn if you won't do / try it yourself. we already gave you alot of examples here : https://wiki.multitheftauto.com/wiki/Sc ... troduction
-
can u try this btw do u have a server to test on? function playerChat(message, messageType, player) if messageType == 0 then cancelEvent() for i,player in ipairs(getElementsByType("player")) do local data = getElementData(player, "Arena") local data2 = getElementData(player, "Arena2") if data == true then setElementData(player, "Arena2", false) outputChatBox("#FF6E6E(Local) #ffffff"..getPlayerName(player)..": #FF6E6E"..message, player, 255, 255, 255, true) outputServerLog("LOCAL: "..getPlayerName(player)..": "..message) end if data2 == true then setElementData(player, "Arena", false) outputChatBox("#FF6E6E(Local) #ffffff"..getPlayerName(player)..": #FF6E6E"..message, player, 255, 255, 255, true) outputServerLog("LOCAL: "..getPlayerName(player)..": "..message) end end end end addEventHandler("onPlayerChat", root, playerChat)
-
try local data = getElementData(player, "Arena") outputChatBox(getPlayerName(player)..": #ffffff"..m, data, 255, 255, 255, true)
-
any errors? try this: function playerChat(message, messageType, player) if messageType == 0 then cancelEvent() for i,player in ipairs(getElementsByType("player")) do local data = getElementData(player, "Arena") local data2 = getElementData(player, "Arena2") if data == true then setElementData(player, "Arena2", false) outputChatBox("#FF6E6E(Local) #ffffff"..getPlayerName(source)..": #FF6E6E"..message, player, 255, 255, 255, true) outputServerLog("LOCAL: "..getPlayerName(source)..": "..message) end if data2 == true then setElementData(player, "Arena", false) outputChatBox("#FF6E6E(Local) #ffffff"..getPlayerName(source)..": #FF6E6E"..message, player, 255, 255, 255, true) outputServerLog("LOCAL: "..getPlayerName(source)..": "..message) end end end end addEventHandler("onPlayerChat", root, playerChat)
-
try not tested. function playerChat(message, messageType, player) if messageType == 0 then cancelEvent() for i,player in ipairs(getElementsByType("player")) do local data = getElementData(player, "Arena") local data2 = getElementData(player, "Arena2") if data == true then outputChatBox("#FF6E6E(Local) #ffffff"..getPlayerName(source)..": #FF6E6E"..message, player, 255, 255, 255, true) outputServerLog("LOCAL: "..getPlayerName(source)..": "..message) end if data2 == true then setElementData(player, "Arena", false) outputChatBox("#FF6E6E(Local) #ffffff"..getPlayerName(source)..": #FF6E6E"..message, player, 255, 255, 255, true) outputServerLog("LOCAL: "..getPlayerName(source)..": "..message) end end end end addEventHandler("onPlayerChat", root, playerChat)
-
SAAW: San Andreas At War - World War II | v1.2 | 24/7 |
Bean666 replied to Einheit-101's topic in Servers to play on
OMFG VERY NICE!! LOOKING FORWARD TO TEST IT! soon when server is done switch this topic to the servers to play on! so more people can see what godly things you are doing! -
u mean like this? triggerServerEvent("eventname", getLocalPlayer(), eventname)
-
try . EDIT: Tested and works ig. try it. : function checkDimension() for i,player in ipairs(getElementsByType("player")) do if ( getElementDimension ( player ) == 0 ) then setElementData(player, "Arena", true) end if ( getElementDimension ( player ) == 1 ) then setElementData(player, "Arena2", true) end end end setTimer( checkDimension, 2000, 0)
-
getElementByID(getElementData(source, "Arena")) remove that and change to player i think it will already work because you're already doing a check who has the data by using if data == true i already tested this ingame with a player before and it seems working. players will not see the outputchatbox if they dont have the data to true, that's why data == true. and why are u using getElementByID it makes no sense.
-
here, it's because i thought you wanted to test the datas every resource start. it might have missing / more ends so if there is an eof problem u just fix it. function onJoin() for i, player in ipairs(getElementsByType("player")) do setElementData(player, "Local", true) outputChatBox("True") end end addEventHandler("onResourceStart", root, onJoin)
-
sorry for double post see up ^ i updated. if u want to test the element data's difference quickly use this by using /set function swag(player) local data = getElementData(player, "Local") if data == false then setElementData(player, "Local", true) outputChatBox("Element data set!") end if data == true then setElementData(player, "Local", false) outputChatBox("Element data false!") end end addCommandHandler("set", swag) here is the onJoin and checkDimension Fix: function onJoin() for i, player in ipairs(getElementsByType("player")) do local data = getElementData(player, "Local") if data == false then setElementData(player, "Local", true) outputChatBox("True") end if data == true then setElementData(player, "Local", false) outputChatBox("False") end end end addEventHandler("onResourceStart", root, onJoin) function checkDimension() for i,player in ipairs(getElementsByType("player")) do if ( getElementDimension ( player ) == 0 ) then setElementData(player, "Arena", true) outputChatBox("arena set") end end end addEventHandler("onResourceStart", root, checkDimension) addEventHandler("onPlayerJoin", root, checkDimension)