Jump to content

Lock This.


Newbie

Recommended Posts

I need to make it work with: triggerEvent("onBoughtMap",getRootElement(),mapName)

not with: triggerServerEvent("doBuyNextMap",localPlayer,localPlayer,map)

addEvent("doBuyNextMap",true) 
addEventHandler("doBuyNextMap",getRootElement(),function(player,mapName) 
    if not player or not mapName then 
        return 
    else 
        if not g_ForcedNextMap or g_ForcedNextMap == nil then 
            executeCommandHandler("buyMap", player, mapName) 
        end 
         
    end 
end) 
  
addEvent("doBuyRedoMap",true) 
addEventHandler("doBuyRedoMap",getRootElement(),function(player) 
    if not player then 
        return 
    else 
        if not g_ForcedNextMap or g_ForcedNextMap == nil then 
            local mapName = call(getResourceFromName("mapmanager"),"getRunningGamemodeMap") 
            executeCommandHandler("buyMap", player,getMapName(mapName)) 
        end 
    end 
end) 
  
addCommandHandler("buyMap",function(player,command, ...) 
    local query = #{...} > 0 and table.concat ( {...}, ' ' ) or nil 
        if not query then 
            if g_ForcedNextMap then 
                outputDebugString ( 'Next map is ' .. getMapName ( g_ForcedNextMap ) ); 
            else 
                outputDebugString ( 'Next map is not set' ); 
            end 
            return 
        end 
        local map, errormsg = findMap ( query ); 
        if not map then 
            outputRace ( errormsg, player ); 
            return 
        end 
            g_ForcedNextMap = map; 
            outputChatBox ( "#ff6666[MAP] #ffffff"..getPlayerName ( player ) .. ' #ffffffhas bought #ff6666'..getMapName ( g_ForcedNextMap ).." #ffffffas next map", g_Root, 255, 255, 255, true ); 
             
            
end) 

Edited by Guest
Link to comment
  • Moderators
I just cant get it omgf..

Wow such a usefull post for us ...

What's the problem ?

- you didn't understand what I asked you to do ?

- you understood and replaced correctly but my code isn't working ?

- you didn't understand my code but it's working ?

And we would like to see the errors too.

Link to comment
  • Moderators

From my PMs:

omg. can you actually tell me what should i do ? Change racevoting_server or ?..

Ok I'll tell you again one more time:

Here viewtopic.php?f=91&t=72258

in the 1st script, replace this line (l.23):

triggerEvent("onBoughtMap",getRootElement(),mapName) 

by this:

triggerEvent("doBuyNextMap", thePlayer, thePlayer, mapName) 

What's so complicated ?!

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