Mossy Posted May 11, 2013 Share Posted May 11, 2013 because they using the giveplayerMoney if they used element data money then will work + bad maked at alive and ded playersThat because you have that Probs Mossy I mean, all I did was remove the map buttons (except for DM) and put in the resource correctly and gave it admin rights etc. What should I do then? Link to comment
Daron90 Posted June 28, 2013 Share Posted June 28, 2013 Hello.. i know this topic is old but i want to use it in my server... and it doesnt work by unknow reason :L [2013-06-28 04:54:11] start: Requested by Admin[2013-06-28 04:54:11] Starting mapratings [2013-06-28 04:57:46] ADMIN: Resource 'tx_minimapshop' restarted by Admin [2013-06-28 04:57:46] Stopping tx_minimapshop [2013-06-28 04:57:46] Starting tx_minimapshop [2013-06-28 04:57:46] tx_minimapshop restarted successfully i did everything writen on install.txt The window loads but it doesnt show the maps Do you know the problem? Regards Link to comment
K4stic Posted July 2, 2013 Share Posted July 2, 2013 realy? follow better the instructions for me it's work Perfect Link to comment
xXHaMoDeXx Posted July 2, 2013 Share Posted July 2, 2013 hmm, i have idea > can create a PVP (Player Vs Player) in the maps same DD or DM win a hunter < Sorry Bad English Link to comment
TwiX! Posted January 18, 2014 Author Share Posted January 18, 2014 I'm back! wait for new updates soon Link to comment
VTX Posted February 28, 2014 Share Posted February 28, 2014 Something is wrong with this: function getAliveGuys ( mode ) if not mode then return end if mode == 1 then pAlive = { }; for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "state" ) == "alive" ) then table.insert ( pAlive, player ); end end return pAlive; elseif mode == 2 then return #pAlive; elseif mode == 3 then if pAlive then pAlive = nil; end return false end end It says i'm always at the last position, and gives mostly 50$. Link to comment
K4stic Posted March 1, 2014 Share Posted March 1, 2014 Something is wrong with this: function getAliveGuys ( mode ) if not mode then return end if mode == 1 then pAlive = { }; for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "state" ) == "alive" ) then table.insert ( pAlive, player ); end end return pAlive; elseif mode == 2 then return #pAlive; elseif mode == 3 then if pAlive then pAlive = nil; end return false end end It says i'm always at the last position, and gives mostly 50$. function getAliveGuys ( mode ) if not mode then return end pAlive = { }; if mode == 1 then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "state" ) == "alive" ) then table.insert ( pAlive, player ); end end return pAlive; elseif mode == 2 then return #pAlive; elseif mode == 3 then if pAlive then pAlive = nil; end return false end end by logic the table must be up i mean before asked if mode == blabla as all modes use that table Link to comment
VTX Posted March 1, 2014 Share Posted March 1, 2014 Sorry, it's my fault, but I don't understand what to do. :\ Link to comment
K4stic Posted March 1, 2014 Share Posted March 1, 2014 easy replace the code that you have of function getAliveGuys ( mode ) with mine that i post after quote Link to comment
VTX Posted March 1, 2014 Share Posted March 1, 2014 Oh, yes.. Forgive my mistake, I was a bit inattentive at the morning and didn't see the difference between the two codes. I have this problem now: http://i.imgur.com/QxoaJWp.png It'd be okay that the player earns nothing if he's alone ot the server, but that -10000000 is kinda scary. Please help... Link to comment
VTX Posted March 2, 2014 Share Posted March 2, 2014 (edited) bump.. Sorry for double-post, but I really need some help in this. It's kinda irritating that everybody gets the last place at every single round. Edited March 6, 2014 by Guest Link to comment
VTX Posted March 5, 2014 Share Posted March 5, 2014 Finally, I mended it!! Here you go: function getAliveGuys() local alivePlayers = 0 for index,player in ipairs(getElementsByType("player")) do if getElementData(player,"state") == "alive" then alivePlayers = alivePlayers + 1 end end return alivePlayers end function getDeadGuys() local deadPlayers = 0 for index,player in ipairs(getElementsByType("player")) do if getElementData(player,"state") == "dead" then deadPlayers = deadPlayers + 1 end end return deadPlayers end function giveMoneyWinDie ( ) local account = getPlayerAccount ( source ); local playersAlive = getAliveGuys ( 2 ); local playersDead = getDeadGuys ( ); local checkYourPos = playersAlive + 1 local pos = nil; if not (checkYourPos <= 0) then if tonumber ( checkYourPos ) == 1 then pos = 1 else pos = checkYourPos; end if tonumber ( checkYourPos ) == 2 then pos = 2; end if pos == 1 or pos == 21 or pos == 31 then posName = "st"; elseif pos == 2 or pos == 22 or pos == 32 then posName = "nd"; elseif pos == 3 or pos == 23 or pos == 33 then posName = "rd"; else posName = "th"; end if not getElementData ( source, "gotMoney" ) then local money = math.ceil ( getPlayerCount ( ) * 50 / pos ); givePlayerMoney ( source, money ); outputChatBox ( "* You were #abcdef[#ff0000" .. pos .. posName .. "#abcdef]#ffffff and #abcdefearned #ffffff" .. money .. "#00ff00$!", source, 255, 255, 255, true ); setElementData ( source, "gotMoney", true ); if account then setAccountData ( account, "money", tostring ( getPlayerMoney ( source ) ) ); end end end end addEventHandler ( "onPlayerWasted", root , giveMoneyWinDie ) Compare it with the original one, and you'll see what changed. Link to comment
TwiX! Posted March 8, 2014 Author Share Posted March 8, 2014 Finally, I mended it!!Here you go: function getAliveGuys() local alivePlayers = 0 for index,player in ipairs(getElementsByType("player")) do if getElementData(player,"state") == "alive" then alivePlayers = alivePlayers + 1 end end return alivePlayers end function getDeadGuys() local deadPlayers = 0 for index,player in ipairs(getElementsByType("player")) do if getElementData(player,"state") == "dead" then deadPlayers = deadPlayers + 1 end end return deadPlayers end function giveMoneyWinDie ( ) local account = getPlayerAccount ( source ); local playersAlive = getAliveGuys ( 2 ); local playersDead = getDeadGuys ( ); local checkYourPos = playersAlive + 1 local pos = nil; if not (checkYourPos <= 0) then if tonumber ( checkYourPos ) == 1 then pos = 1 else pos = checkYourPos; end if tonumber ( checkYourPos ) == 2 then pos = 2; end if pos == 1 or pos == 21 or pos == 31 then posName = "st"; elseif pos == 2 or pos == 22 or pos == 32 then posName = "nd"; elseif pos == 3 or pos == 23 or pos == 33 then posName = "rd"; else posName = "th"; end if not getElementData ( source, "gotMoney" ) then local money = math.ceil ( getPlayerCount ( ) * 50 / pos ); givePlayerMoney ( source, money ); outputChatBox ( "* You were #abcdef[#ff0000" .. pos .. posName .. "#abcdef]#ffffff and #abcdefearned #ffffff" .. money .. "#00ff00$!", source, 255, 255, 255, true ); setElementData ( source, "gotMoney", true ); if account then setAccountData ( account, "money", tostring ( getPlayerMoney ( source ) ) ); end end end end addEventHandler ( "onPlayerWasted", root , giveMoneyWinDie ) Compare it with the original one, and you'll see what changed. you will get warning,and if player will training, your stats will ***cked 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