battle309 Posted October 1, 2012 Share Posted October 1, 2012 (edited) im making a sumo server i need to finish it to open it to public i need time alive on scoreboard when you win, you win $22000 to win you must last 5 minutes without dieing you die and your time resets and start counting backup to 5 minutes again when you the person wins 22000 load another race map people that loose get 500 for good effort this image is an example of what im looking for where its says "score" thats the time counting up to five mins Edited October 1, 2012 by Guest Link to comment
manve1 Posted October 1, 2012 Share Posted October 1, 2012 are you trying to make a script copy? Link to comment
battle309 Posted October 1, 2012 Author Share Posted October 1, 2012 no not a copy my own version of it theres no version on mta this will be the first Link to comment
manve1 Posted October 1, 2012 Share Posted October 1, 2012 you know the shape of the score board? you want it the same? P.S. You should give more information of what you need. Link to comment
battle309 Posted October 1, 2012 Author Share Posted October 1, 2012 no i used that image to show you how the scoring worked with the time Link to comment
battle309 Posted October 1, 2012 Author Share Posted October 1, 2012 I just need a way for the game to end by someone winning e.g i last for 5 mins without dieing so i win 22000 and the map changes to another map loosers win 500 for good effort i need the time counting up so players know whos wining if anyone want skype is richard.duberry Link to comment
robhol Posted October 1, 2012 Share Posted October 1, 2012 Seriously then, two whole pounds? Link to comment
manve1 Posted October 2, 2012 Share Posted October 2, 2012 Seriously then, two whole pounds? thats what i though, it isn't really hard to make a new scoreboard, the score would be bit harder. Link to comment
battle309 Posted October 2, 2012 Author Share Posted October 2, 2012 ok ill try make it clearer i dont want a new scoreboard listen people i want score in this picture to be made e.g. (i hold TAB button and i see players scores) when i press tab and see scores, the scores needs to be how long a player has been alive for. e.g if a player has lived for 3 minutes the score will be 300, if that player dies score is reset to 0, to win you must reach 500 = 5 mins if they win they win 22000 and popup says you are the Winner ! once they have won map changes to another race map. Link to comment
Castillo Posted October 2, 2012 Share Posted October 2, 2012 300000 / 1000 / 60 = 5 minutes. I did understand what did you want, though, I don't know if anyone is willing to make it for 2 pounds. Link to comment
battle309 Posted October 2, 2012 Author Share Posted October 2, 2012 can someone please help me with this Link to comment
battle309 Posted October 7, 2012 Author Share Posted October 7, 2012 i explained it the best i could Link to comment
robhol Posted October 8, 2012 Share Posted October 8, 2012 I'd say that being ridiculously cheap, you'd be better off checking the wiki. Link to comment
Scooby Posted October 8, 2012 Share Posted October 8, 2012 keep ur pocket change.... local time = {} local timerInc = setTimer(incTimes,1000,0) local scoreboardName = "score" -- not sure what ur scoreboard column name is.. function playerSpawned() time[source] = 0 end addEventHandler("onPlayerSpawn",root,playerSpawned) function incTimes() for k,v in ipairs(getElementsByType("player")) do time[v] = time[v] + 1000 setElementData(v,scoreboardName,tostring(time[v] / 600)) if time[v] > 300000 then killTimer(timerInc) payPlayers(v) --if u dont want people to draw, u will need to break the loop here end end end function playerQuit() time[source] = nil end addEventHandler("onPlayerQuit",root,playerQuit) function payPlayers(winner) givePlayerMoney(winner,22000) outputChatBox(getPlayerName(winner) .. " Wins $22000!!!",root,0,255,0) for k,v in ipairs(getElementsByType("player")) do if v ~= winner then givePlayerMoney(winner,500) end end startNewMap() end function startNewMap() -- i dont use race resource so... add what u need here to start a new map end this should get u started... i dont use race resource so i dont know how u normally start new maps... i'll let u figure that part out, also i dont know if u already have the scoreboard column already added.. u didnt say sorry i dont have time to test this script... ive just woke up and have to go to work soon. post any errors and im sure i or someone else can help u out. probably best not to insult people again with ur pocket change. Link to comment
battle309 Posted October 10, 2012 Author Share Posted October 10, 2012 i tryed it and got bad arguements exports [ "scoreboard" ]:addScoreboardColumn ( "Money", 3 ) -- Add the "Money" column to the scoreboard. exports [ "scoreboard" ]:addScoreboardColumn ( "TimeAlive", 4 ) -- Add the "Time to the Scoreboard" column to the scoreboard. local time = {} local timerInc = setTimer(incTimes,1000,0) local scoreboardName = "scoreboard" -- scoreboard column name is.. function playerSpawned() time[source] = 0 end addEventHandler("onPlayerSpawn",root,playerSpawned) function incTimes() for k,v in ipairs(getElementsByType("player")) do time[v] = time[v] + 1000 setElementData(v,scoreboardName,tostring(time[v] / 600)) end end Link to comment
Castillo Posted October 10, 2012 Share Posted October 10, 2012 How about posting where you got them? Link to comment
Scooby Posted October 10, 2012 Share Posted October 10, 2012 You will get errors if u didnt add a function on start to set the players timers to 0 just add a simple loop like this: function startGameTimer() for k,v in ipairs(getElementsByType("player")) do time[v] = 0 end end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), startGameTimer) also i see u changed the 'Score' to 'TimeAlive' so make sure u update the variable name If u still get errors, post ur error msgs from debug along with the relevant lines in the script so we can help u fix it. Link to comment
battle309 Posted October 11, 2012 Author Share Posted October 11, 2012 does anyone know why ? Link to comment
Cadu12 Posted October 11, 2012 Share Posted October 11, 2012 Battle, don't ignore Scooby, he is helping you. If you are ignoring him, you're not getting help. Link to comment
battle309 Posted October 15, 2012 Author Share Posted October 15, 2012 can anyone help ? Link to comment
Castillo Posted October 15, 2012 Share Posted October 15, 2012 You will get errors if u didnt add a function on start to set the players timers to 0just add a simple loop like this: function startGameTimer() for k,v in ipairs(getElementsByType("player")) do time[v] = 0 end end addEventHandler( "onResourceStart", getResourceRootElement(getThisResource()), startGameTimer) also i see u changed the 'Score' to 'TimeAlive' so make sure u update the variable name If u still get errors, post ur error msgs from debug along with the relevant lines in the script so we can help u fix it. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now