Jump to content

[REL]Mini Map Shop Panel {SELL NEW}


TwiX!

Recommended Posts

because they using the giveplayerMoney if they used element data money then will work + bad maked at alive and ded players

That 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
  • 1 month later...

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

K8t8hLv5

Do you know the problem?

Regards

Link to comment
  • 4 months later...
  • 2 months later...
  • 1 month later...

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
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

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
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

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...