Jump to content

racevoting_server.LUA


SuleymanM

Recommended Posts

ye..ye decompile ... how decompile ??

this:

LuaQ € A@ ¤ € ‡€ ¤@ ‡À ¤€ ‡ …@ Á€ œ@€…À Á œ@ …@ Á € dÁ œ@ ¤ ‡À ¤@ ‡ ¤€ ‡@ ƒ äÀ Ç€ ÅÀ Á Ü@ Å@ Á E \€ ¤ Ü@ ä@ Ç ÅÀ A Ü@ Å@ A E \€ ¤ Ü@ äÀ Ç€ ÅÀ Á Ü@ Å@ Á E \€ ¤ Ü@ Å@ dA Ü@€Å@ A d Ü@€äÀ Ç€ Å@ Á d Ü@€Å@ E \€ ¤A Ü@ ä€ Ç@ äÀ Ç€ à €$ Á $A $ A $Á € $ Á $A $ A $Á $ €Á $A A AA ¤ A€A A ¤Á A€$ Á $A

$ A

€ * displayHilariarseMessage displayKillerPunchLine startMidMapVoteForRandomMap addCommandHandler new addEvent midMapVoteResult addEventHandler getRootElement startRandomMap outputRace problemChangingMap startNextMapVote onPollModified chooseRandomMap nextMapVoteResult startMidMapVoteForRestartMap midMapRestartVoteResult redo random maybeApplyForcedNextMap

forcevote onResourceStart # getRandomMapCompatibleWithGamemode countSpawnPointsInMap getMapLastTimePlayed setMapLastTimePlayed getMapSpawnPointCount getMapInfo

sqlString sqlInt

getTableName ensureTableExists loadMapInfoAll saveMapInfoItem checkmap nextmap findMap findMaps getMapName # ( 3 @ € €A H €E@ € \€ Ä À€ €Ä € Ì€ÀÈ € Ä € ÀÀÀ €À € • €Ä € @Á €Á€ € AÁ •@ €Ä € ÀÀÀ €À € • @€À € A • @€Á€ È € H À € Á • Å Ü@ €

getPlayerName ð? @# started a vote. Hardly a suprise. $@

Guess what! started ANOTHER vote! started another vote. % continues to abuse the vote system. started a vote. outputRace 0 4 D W À €E@ € Ä •À \@ € outputRace Offical news: Everybody hates = Z ? E \€€ Z €E@ K€À \€ ÀÀ À€ €E @ Å€ Ü€ Á • À \@€ € E € \@ E@ F€Â KÀ \@ E@ F€Â K à ÊÀ É€Ã†É Ä‡É€ÄˆÉ Å‰ € É Š

A A Š܀ € "A É ‹

A AÁ A Š܀ EŽ"A É \€€Z € €…@ Á€ œ@ € stateAllowsRandomMapVote g_CurrentRaceMode getTimeRemaining LÝ@ outputRace % I'm afraid I can't let you do that, getPlayerName . displayHilariarseMessage exports votemanager stopPoll

startPoll title ' Do you want to change to a random map? percentage €I@ timeout .@ allowchange

visibleTo getRootElement ð? Yes midMapVoteResult @ No default

gotoState MidMapVote e o E \€€ Z @€E@ € \@ € €EÀ \@€ @ €E \@€ € stateAllowsRandomMapVoteResult

gotoState Running startRandomMap displayKillerPunchLine y Š & €€ € € @ E€ \€€ À Å Æ@ÁÚ € €Á€ Ú@ @ €ÅÀ Ü€€ € € E@ F€Â KÀ À B€ \€€Z@ @€E \@€ € €E@ € \@ € maybeApplyForcedNextMap # getRandomMapCompatibleWithGamemode getThisResource $@ g_GameOptions

ghostmode getTotalPlayerCount g_IgnoreSpawnCountProblems exports mapmanager changeGamemodeMap problemChangingMap outputWarning startRandomMap failed ’   * Z@ €E …@ Å€ ÆÀÀ AA Ü œ E €€ \ ÀÁÀ €E € \A €EA @ € €E € \A E €€ \ €Â€ €AÁ € €E € À€ @€€ \A €

g_Root getColorFromString string upper get color getElementType console outputServerLog rootElement player [PM] outputChatBox ¨ ³ A@ @ € À@ A € E@ F€Á À Á \€€K@ ä ÁBA A €A \@€ € outputRace $ Changing to random map in 5 seconds exports mapmanager getRunningGamemodeMap

TimerManager createTimerFor resource mapproblem setTimer math random ”±@ |µ@ ð? ¬ ±

E F@À K€À \€ @ @ €À @€ € exports mapmanager getRunningGamemodeMap startRandomMap Æ ˆ @@ €@ @ À €€ € € A @A …€ œ € € T @€ƒ@€E F@ …€ œ € \@ EÀ F à € Å Æ@à T Ü €\@ T ÀÁ Àü€€T Àà À €B … †@D^ €E€ € \ €… †ACÁ œ€Æ ‚ Àa€ ýJ@ I ʼn…€ œ€€ I€€ŠI Æ‹I€ÆŒI Ç…€ À œ À€ÅA A‚ Ü€ÚA € €ÅÁ Ü Â H@€ Š À€C Eƒ \ƒ€ € ¢B B€¡€ @ú… † A‹€Hœ€ š €€ÅÀ Æ È € J Á ÁA ‚ ‚€ @ bA Ü@€H Å A E €€ Ü@ D à €È Å Æ@ÀËÀÉ@€ Ü€€Ú €

AA

A

… œ€ Å A Þ € - exports votemanager stopPoll maybeApplyForcedNextMap mapmanager getMapsCompatibleWithGamemode getThisResource @ math randomseed

getTickCount table remove random ð? @

errorCode onlyOneCompatibleMap ipairs title Choose the next map:

visibleTo getRootElement percentage €I@ timeout .@ allowchange getResourceInfo name getResourceName insert nextMapVoteResult getRunningGamemodeMap Play again

triggerEvent onPollStarting g_Root

startPoll

gotoState NextMapVote addEventHandler

onPollEnd chooseRandomMap € @ À€E \@€ E@ F€À …À œ € \@ E F@Á K€Á ÁÀ \@€E @ Å€ Ü€€ Á \@ € cancelEvent math randomseed

getTickCount exports votemanager finishPoll ð? removeEventHandler

onPollEnd getRootElement chooseRandomMap $ E \€€ Z €€E@ F€À KÀÀ À B€ \€€Z@ @ €E \@€ € stateAllowsNextMapVoteResult exports mapmanager changeGamemodeMap problemChangingMap - J : E \€€ Z@ À€ €E@ € ÅÀ Ü€ • À \@€ € E@ € \@ E€ FÀÁ K  \@ E€ FÀÁ K@ ÊÀ ÉÀB…É@C†ÉÀC‡É@DˆÁ € É ‰

AA ÅÁ Ü€ € "A É Š

A A ÅÁ Ü€ AÄŒ"A É ‹\€€Z € €…€ ÁÀ œ@ € stateAllowsRestartMapVote outputRace % I'm afraid I can't let you do that, getPlayerName . displayHilariarseMessage exports votemanager stopPoll

startPoll title ( Do you want to restart the current map? percentage €I@ timeout .@ allowchange

visibleTo getRootElement ð? Yes midMapRestartVoteResult @ No default

gotoState MidMapVote T ` E \€€ Z @€E@ € \@ €€EÀ F Á K@Á ÅÀ Æ ÁË€ÁÜ€ B€ \€€Z@ €EÀ \@€ @ €E \@€ € stateAllowsRandomMapVoteResult

gotoState Running exports mapmanager changeGamemodeMap getRunningGamemodeMap problemChangingMap displayKillerPunchLine d r

. Å EA FÀÜ€€Ú @€ÅÀ Æ ÁË@ÁÜ€ Ú €€ AÁ … À œ U…A Á  A‚ A Á AC€€Ã€€ €A À€A A€ € AÁ € A€À €Å€ @ Ü@€ € isPlayerInACLGroup g_GameOptions admingroup exports mapmanager getRunningGamemodeMap outputChatBox Map restarted by getPlayerName g_Root n@ changeGamemodeMap problemChangingMap outputRace 4 You can't restart the map because no map is running You are not an Admin w 4 Å EA FÀÜ€€Ú À

€ÅÀ Ü€€ Ú €Å Ë@ÁÜ€ €Á €ÅÀ @ Ü@€@€Ê A A Á Á B A‚  Á â@ A A …Á †EÁA €œ€†Á  @ ‚ U‚… ÁA ‚ AB A Á A€ € isPlayerInACLGroup g_GameOptions admingroup stateAllowsRandomMapVote g_CurrentRaceMode getTimeRemaining @@ outputRace G Random command only works during a race and when no polls are running.

curtailed

cut short terminated given the heave ho dropkicked expunged put out of our misery got rid of outputChatBox

Current map math random ð? by getPlayerName g_Root n@ startRandomMap Š » € €€ C € G @ E€ …À œ€€ Á A A € €Á A @ € € \€ G@ Z €G@ …€ ÁÀ € EA €€ \ œ@ …€ †ÀC‹ D C€‚€ œ€€š@ €…@ Á€ œ@ ‚ ž ‚ € ž €@ @€@ C € G@ @ E€ …À œ€€ Á A A € €Á A @ € € \€ G@ Z €G@ …€ ÁÀ € EA €€ \ œ@ …€ †ÀC‹ D C€‚€ œ€€š@ €…@ Á€ œ@ ‚ ž ‚ € ž € EÀ \€€ Å@ Æ€ÁÚ € €ÁÀ Ú@ @ €Å Ü€€ € @ €@ E€ À Š܀€ A @ \@ B ^ € g_ForcedNextMap2 g_IgnoreSpawnCountProblems # getRandomMapCompatibleWithGamemode getThisResource $@ g_GameOptions

ghostmode getTotalPlayerCount g_ForcedNextMap triggerClientEvent setNextMap getRootElement getMapName exports mapmanager changeGamemodeMap outputWarning Forced next map failed Å Ê Å Ú@ À€Å@ E FÁÀÜ€€Ú@ € € Å Ü@€ € _TESTING isPlayerInACLGroup g_GameOptions admingroup startNextMapVote × Û E F@À K€À À \€€Z € €EÀ € \@ € exports mapmanager isMap setMapLastTimePlayed Þ % Æ Å Æ@ÀË€À@ Ü€€€À@@€ AA A€

EÁ €€\ €Š †‰B„†Å‚ €Ü‚ ‰Â‚„a ýEÁ FÀ ä \A€T …A †CÔ ÎA€ÏÁÃœ M… ÁA ‚ œA€… ÁA  A …B À œ‚ Á‚ C T ƒ Aà …C À€œƒ Á D T MDL„Á„ œA€…A †AFŠ܀ ÐÁÆœA ƒ Ô À@€ÅA ÆÇ €T Ü€ÂBš €EB € \‚ @€€E B Á ƒ EC …à À œ \ƒ ÅC D @ ܃ D ED …„ œ„€ Å„ Ü„ Ä \„ ÕB„\B€ š À€EB € \‚ …B À œ‚ €‚ €€ E B Á à EC …à À œ \ƒ ÅC D @ ܃ D ED …„ œ„€ Å„ Ü„ Ä \„ ÕB„\B€E FÉ€ À€\B€EB FBÉ€€Ô \‚€@€€èÅ B A ‚ ÅB à @ Ü‚ EC …C À œ \ƒ à ÅC „ „€ E„ € \„

D܃ UƒÜA€ž € ( exports mapmanager getMapsCompatibleWithGamemode outputDebugString - getRandomMapCompatibleWithGamemode: No maps. ð? ipairs map lastTimePlayed getMapLastTimePlayed table sort math floor Y@ outputDebug RANDMAP # getRandomMapCompatibleWithGamemode minSpawns: tostring

nummaps: cutoff: poolsize: randomseed

getTickCount jè@ random getMapSpawnPointCount ++ using map: getResourceName spawns: age: getRealTimeSeconds skip: remove min ** fallback map:

ageLstPlyd: ð ð † @ Æ À X€€ €‚@ ‚ € ž € lastTimePlayed ) ;

< A …@ Á€ Á @ A A Õ€œ€ š @€Å€ AÁ Ü€ Ú@ €Å€ A Ü€ €À €A @€ €EÁ € \A €€EA ÅÁ Ü @ •A\ Z À€… À€ @€ œ š @ €L@à €ý…Á À€œA ^ € xmlLoadFile : getResourceName / meta.xml

xmlFindChild map race xmlNodeGetAttribute src xmlUnloadFile spawnpoint ð? B E E € \€ †@À š@ €€ ž € getMapInfo lastTimePlayed G M Z@ € €… œ€€ @ …@ À œ€ ‰@ ÆÀ@Ú@ €Á Ì@Á‰À€Å€ @ Ü@€ € getRealTimeSeconds getMapInfo lastTimePlayed playedCount ð? saveMapInfoItem O V E € \€ †@À š@ À€…€ À œ€ I€€€…À À € œ@€†@À ž € getMapInfo spawnPointCount countSpawnPointsInMap saveMapInfoItem X f D Z@ @ €E \@€ D F € Z@ € €D Š I€ D F € †@À Å€ Ü€ WÀ €…€ À œ€ I€€€I Á^ € loadMapInfoAll loadTime getResourceLoadTime spawnPointCount l o E € \€ @€ €@ A€ ‹À@ AA œ€ Á€ UÀ€ ^ € tostring ' gsub ([']) '' q s E € \€ Z@ €A@ ^ € tonumber u w E @ ] ^ €

sqlString race_mapmanager_maps y ƒ

E@ \€€ € ÁÀ AA ÁÁ AB @ E€ € \@ € CREATE TABLE IF NOT EXISTS

getTableName ( resName TEXT UNIQUE , infoName TEXT , spawnPointCount INTEGER , playedCount INTEGER , lastTimePlayedText TEXT , lastTimePlayed INTEGER ) executeSQLQuery † ’ @€ @ A€ …À œ€€ U€€ € J H E € \ À€…A ÆÁœ š €€ÅÁ Ü ÂÉ„BÂÉ‚„a€ @ü €

ensureTableExists executeSQLQuery SELECT * FROM

getTableName ipairs getResourceFromName resName getMapInfo playedCount lastTimePlayed • ° _ … Á@ œ@ …€ œ@€ À Š܀€ A A …Á Å Ü œ ÁA  A‚ ‚ AB …‚ Á œ‚ ÁB ƒ Aà ƒ AC …à Áƒ œƒ ÁC „ AÄ „ A •@Å Ü@ Á@ € A Á ÅÁ @ B €Ü ‚ E‚ †ÂÄ \‚ Å‚ CÅ Ü‚ ƒ Eà †ÃÅ š @€†ÃÅ €ƒ…€€… ÅC ÄÅ Ü œƒ šC €ƒ \ƒ à Ń ÄŠ܃ AD …Ä Å Ü œ„ •€„Å Ü@ Å Ü@ € executeSQLQuery BEGIN TRANSACTION ensureTableExists INSERT OR IGNORE INTO

getTableName

VALUES (

sqlString getResourceName , sqlInt ) UPDATE SET

infoName= getResourceInfo name ,spawnPointCount= spawnPointCount ,playedCount= playedCount ,lastTimePlayedText= lastTimePlayed getRealDateTimeString getRealTime - ,lastTimePlayed= WHERE resName= END TRANSACTION » Á Ê % â@ Ô €À € €Å@ Æ€À

e "A AÁ Ü€€Ú@ €Ã €Ú €€ @€Á …A À€ œA€ € table concat findMap outputRace Å ô

Ì Ê % â@ Ô €À € €Å@ Æ€À

e "A AÁ Ü€€Ú@ €Ã €Ú@ €€ A € €A À€ AÁ … Å ÚA €ÅA œ U€ A€À € AA € A€ € @ …Á †C€ €€A @€Á A €€… ÛA€ €ÁÁ A Á € œA€ € … W @€… šA À€…A € … ÁA E ZB €EB ‚ Õ‚ A Á € œA€ € … ÁÁ ‚€ E € \ œA … ÁA E ‚ A‚ … À œ‚ Õ‚ A Á œA À€ @ …Á †AF€ € A €A @€Á A €€… ÛA€ €ÁÁ A Á € œA€ € …A € … Á E ZB €EB ‚ Õ‚ A Á € œA€ € … ÁÁ ‚€ E € \ œA … ÁA E ‚ A‚ … À œ‚ Õ‚ A Á œA € AÁ € Á A ‚€ A€À€ A € Á A ‚€ A€ € table concat g_ForcedNextMap2 g_ForcedNextMap outputRace

Next map is getMapName Next map is not set isPlayerInACLGroup g_GameOptions admingroup findMap outputChatBox n@ Next map is already set to triggerClientEvent setNextMap getRootElement Next map set to by getPlayerName g_Root admingroup2 # Next map is already set to #ffffff Next map is already set. You are not an Admin. ø

D E € \€ @ Ô € T€ ÀÀ€ €A ZA €AA •@ÁÀ ÁAA ”€ €AÁ à €À À@€ €B B €‚ A … Æ‚ œ‚ Á •À‚ß@üÔ € À „@€À A T€ M •€Ô € ÀÀ€Ã € A € ÁÁ ÁÞ €Ô € ÀÀ€ €ÆÀÀ Þ €Ô € À€€ €Ã € Þ € € findMaps Found match ð? es math min @ : , ' getMapName ( more) for ' $

1 J … †@@À AÁ œ€ … Å@ Æ€ÁËÀÁE \€ Ü œ À€ÅA Ü ‚ @ ‚ WÀ @ € À €J€ € bB€ ^ E F‹Cœ‚ ËC Ü \‚ Z €EB F‚À€ À \B€¡€ @ø^ € string gsub $ ([%*%+%?%.%(%)%[%]%{%}%%/%|%^%$%-]) %%%1 ipairs exports mapmanager getMapsCompatibleWithGamemode getThisResource getResourceName getMapName find lower table insert & ( E € Á@ \€€Z@ @€E€ € \€ Z@ €AÀ ^ € getResourceInfo name getResourceName unknown

Link to comment
yes .... i copy/paste and replace racevoting_server.lua with an decopiled(original) racevoting_server....

And why always lose must vote maps ??? and no last survivor continue run ?

you need a racevoting_server.lua uncompiled and as @ Mike said above. "needs editing destructionderby.lua"

Link to comment

its eddited !! look:

DestructionDerby = setmetatable({}, RaceMode) 
DestructionDerby.__index = DestructionDerby 
  
DestructionDerby:register('Destruction derby') 
  
function DestructionDerby:isApplicable() 
    return not RaceMode.checkpointsExist() and RaceMode.getMapOption('respawn') == 'none' 
end 
  
function DestructionDerby:getPlayerRank(player) 
    return #getActivePlayers() 
end 
  
-- Copy of old updateRank 
function DestructionDerby:updateRanks() 
    for i,player in ipairs(g_Players) do 
        if not isPlayerFinished(player) then 
            local rank = self:getPlayerRank(player) 
            if not rank or rank > 0 then 
                setElementData(player, 'race rank', rank) 
            end 
        end 
    end 
    -- Make text look good at the start 
    if not self.running then 
        for i,player in ipairs(g_Players) do 
            setElementData(player, 'race rank', '' ) 
            setElementData(player, 'checkpoint', '' ) 
        end 
    end 
end 
  
function DestructionDerby:onPlayerWasted(player) 
    if isActivePlayer(player) then 
        self:handleFinishActivePlayer(player) 
        if getActivePlayerCount() <= 0 then 
            RaceMode.endMap() 
        else 
            TimerManager.createTimerFor("map",player):setTimer(clientCall, 2000, 1, player, 'Spectate.start', 'auto') 
        end 
    end 
    RaceMode.setPlayerIsFinished(player) 
    showBlipsAttachedTo(player, false) 
end 
  
function DestructionDerby:onPlayerQuit(player) 
    if isActivePlayer(player) then 
        self:handleFinishActivePlayer(player) 
        if getActivePlayerCount() <= 0 then 
            RaceMode.endMap() 
        end 
    end 
end 
  
function DestructionDerby:handleFinishActivePlayer(player) 
    -- Update ranking board for player being removed 
    if not self.rankingBoard then 
        self.rankingBoard = RankingBoard:create() 
        self.rankingBoard:setDirection( 'up', getActivePlayerCount() ) 
    end 
    local timePassed = self:getTimePassed() 
    self.rankingBoard:add(player, timePassed) 
    -- Do remove 
    finishActivePlayer(player) 
    -- Update ranking board if one player left 
    local activePlayers = getActivePlayers() 
    if #activePlayers == 1 then 
        self.rankingBoard:add(activePlayers[1], timePassed) 
        showMessage(getPlayerName(activePlayers[1]) .. ' winner!', 30, 144, 255) 
    end 
end 
  
  
  
------------------------------------------------------------ 
-- activePlayerList stuff 
-- 
  
function isActivePlayer( player ) 
    return table.find( g_CurrentRaceMode.activePlayerList, player ) 
end 
  
function addActivePlayer( player ) 
    table.insertUnique( g_CurrentRaceMode.activePlayerList, player ) 
end 
  
function removeActivePlayer( player ) 
    table.removevalue( g_CurrentRaceMode.activePlayerList, player ) 
end 
  
function finishActivePlayer( player ) 
    table.removevalue( g_CurrentRaceMode.activePlayerList, player ) 
    table.insertUnique( g_CurrentRaceMode.finishedPlayerList, _getPlayerName(player) ) 
end 
  
function getFinishedPlayerCount() 
    return #g_CurrentRaceMode.finishedPlayerList 
end 
  
function getActivePlayerCount() 
    return #g_CurrentRaceMode.activePlayerList 
end 
  
function getActivePlayers() 
    return g_CurrentRaceMode.activePlayerList 
end 
  
  

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...