Jump to content

how create round help please?


Kenix

Recommended Posts

We won't tell you the whole way to do it, you must script it by yourself, or pay with $$$ somebody so he will script it.

But you could use these functions:

  
setTimer 
getElementHealth 
getElementsByType 
getTeamName 
outputChatBox, guiCreateLabel, dxDrawText 
getPlayersInTeam 
  

PS: These functions doesn't work by themselves, you must learn how to use them.

PS2: Click on each one to learn about them.

Link to comment

I here have made a script but it doesn't work. = (

help me please.

Here my script

  
g_Root = getRootElement() 
local g_TimeLimit,g_MissionTimer 
local mapTimers = {} 
  
local defaults = { 
    timeLimit = 300,     
} 
  
function zmMapStart(resource,mapRoot) 
    local resourceName = getResourceName ( resource ) 
    g_TimeLimit = (tonumber(get(resourceName..".time_limit")) and math.floor(tonumber(get(resourceName..".time_limit"))) or defaults.timeLimit)*1000 
     
end 
addEventHandler ( "onGamemodeMapStart", g_Root, zmMapStart ) 
  
  
function startGame() 
    g_MissionTimer = exports.missiontimer:createMissionTimer (g_TimeLimit,true,true,0.5,20,true,"default-bold",1) 
    addEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) 
end 
  
function Endgame(winner,draw) 
    for i,timer in ipairs(mapTimers) do 
        if isTimer ( timer ) then 
            killTimer ( timer ) 
        end 
    end 
    mapTimers = {} 
    destroyElement(g_MissionTimer) 
    setTimer ( reboot, 15000, 1 ) 
    if not winner then  
        if draw then 
            for i,player in ipairs(getElementsByType"player") do 
                toggleAllControls(player,true,true,false) 
                exports.scoreboard:setPlayerScoreboardForced ( player, true ) 
                fadeCamera(player,false,10,0,0,0) 
            end 
             local zombwintextDis = textCreateDisplay () 
             local zombwiitem = textCreateTextItem(getTeamName(winner).."Выживших не осталось. Зомби победили!", 0.5, 0.5, "low", 255, 0, 0, 255, 3, "center", "center" )                               
             textDisplayAddText ( zombwitextDis, zombwiitem ) 
             textDisplayAddObserver ( zombwitextDis, source ) 
             setTimer ( textDestroyTextItem, 4000, 1, zombwiitem ) 
             setTimer ( textDestroyDisplay, 4000, 1, zombwitextDis ) 
            return 
        else 
            return  
        end 
    end 
    for i,player in ipairs(getElementsByType"player") do 
        if player ~= winner then 
            setCameraTarget(player,winner) 
            toggleAllControls(player,true,true,false) 
        end 
        exports.scoreboard:setPlayerScoreboardForced ( player, true ) 
        fadeCamera(player,false,10,0,0,0) 
    end 
    local surwintextDis = textCreateDisplay () 
    local surwinitem = textCreateTextItem(getTeamName(winner).."Выжившие победили! Они пережили нападение", 0.5, 0.5, "low", 255, 0, 0, 255, 3, "center", "center" )                               
    textDisplayAddText ( surwintextDis, surwinitem ) 
    textDisplayAddObserver ( surwintextDis, source ) 
        setTimer ( textDestroyTextItem, 4000, 1, surwinitem ) 
    setTimer ( textDestroyDisplay, 4000, 1, surwintextDis )  
end 
  
function reboot() 
    for i,player in ipairs(getElementsByType"player") do 
        exports.scoreboard:setPlayerScoreboardForced ( player, false ) 
    end 
    zmMapStart(g_MapResource,g_MapRoot) 
end 
  
function isTimer ( timer ) 
    for i,v in ipairs(getTimers()) do 
        if timer == v then  
            return true 
        end 
    end 
    return false 
end 
  

no errors in debugscript.

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