Jump to content

TDM Script


Recommended Posts

Posted

Error: errortdm.png

Client:

addEventHandler("onClientRender", root, 
function() 
    local redp = countPlayersInTeam("Red Team") 
    local bluep = countPlayersInTeam("Blue Team") 
    local screenWidth, screenHeight = guiGetScreenSize() 
    local ax, ay = screenWidth - 34, 70 
    local ax1, ay1 = screenWidth - 34, 65    
    dxDrawText("Red Team:".. redp .. "", ax,ay ) 
   dxDrawText("Blue Team:".. bluep .. "", ax1,ay1 ) 
end    
) 

Posted
addEventHandler("onClientRender", root, 
function() 
    local redp = countPlayersInTeam(getTeamFromName("Red Team")) 
    local bluep = countPlayersInTeam(getTeamFromName("Blue Team")) 
    local screenWidth, screenHeight = guiGetScreenSize() 
    local ax, ay = screenWidth - 34, 70 
    local ax1, ay1 = screenWidth - 34, 65    
    dxDrawText("Red Team:"..redp, ax,ay) 
    dxDrawText("Blue Team:"..bluep, ax1,ay1) 
end) 

Posted
addEventHandler("onClientRender", root, 
function() 
    local redp = countPlayersInTeam(getTeamFromName("Red Team")) 
    local bluep = countPlayersInTeam(getTeamFromName("Blue Team")) 
    local screenWidth, screenHeight = guiGetScreenSize() 
    local ax, ay = screenWidth - 34, 70 
    local ax1, ay1 = screenWidth - 34, 65    
    dxDrawText("Red Team:"..redp, ax,ay) 
    dxDrawText("Blue Team:"..bluep, ax1,ay1) 
end) 

Same Error :/

Posted
addEventHandler("onClientRender", root, 
function() 
    local redp = countPlayersInTeam(getTeamFromName("Red Team")) 
    local bluep = countPlayersInTeam(getTeamFromName("Blue Team")) 
    local screenWidth, screenHeight = guiGetScreenSize() 
    local ax, ay = screenWidth - 34, 70 
    local ax1, ay1 = screenWidth - 34, 65   
    dxDrawText("Red Team:"..tostring(redp), ax,ay) 
    dxDrawText("Blue Team:"..tostring(bluep), ax1,ay1) 
end) 

Posted
addEventHandler("onClientRender", root, 
function() 
    local redp = countPlayersInTeam(getTeamFromName("Red Team")) 
    local bluep = countPlayersInTeam(getTeamFromName("Blue Team")) 
    local screenWidth, screenHeight = guiGetScreenSize() 
    local ax, ay = screenWidth - 34, 70 
    local ax1, ay1 = screenWidth - 34, 65   
    dxDrawText("Red Team:"..tostring(redp), ax,ay) 
    dxDrawText("Blue Team:"..tostring(bluep), ax1,ay1) 
end) 

bad arg @ countPlayersInTeam Line 3 and 4

Posted
Do You have Teams with name 'Red Team' and 'Blue Team' ?

seems like you don't.

They are

addEventHandler("onResourceStart",root 
function(thePlayer) 
   createTeam("Red Team" 255,0,0) 
   createTeam("Blue Team" 0,0,255) 
end 
) 

Posted

Try with this:

local redTeam = getTeamFromName ( "Red Team" ) 
local blueTeam = getTeamFromName ( "Blue Team" ) 
  
addEventHandler ( "onClientRender", root, 
    function ( ) 
        local redp = countPlayersInTeam ( redTeam ) 
        local bluep = countPlayersInTeam ( blueTeam ) 
        local screenWidth, screenHeight = guiGetScreenSize ( ) 
        local ax, ay = ( screenWidth - 34 ), 70 
        local ax1, ay1 = ( screenWidth - 34 ), 65 
        dxDrawText ( "Red Team:".. tostring ( redp ), ax, ay ) 
        dxDrawText ( "Blue Team:".. tostring ( bluep ), ax1, ay1 ) 
    end 
) 

Posted
Do You have Teams with name 'Red Team' and 'Blue Team' ?

seems like you don't.

They are

addEventHandler("onResourceStart",root 
function(thePlayer) 
   createTeam("Red Team" 255,0,0) 
   createTeam("Blue Team" 0,0,255) 
end 
) 

you forgot to put ',' after "RedTeam" and "Blue Team"

addEventHandler("onResourceStart",resourceRoot 
function() 
   createTeam("Red Team",255,0,0) 
   createTeam("Blue Team",0,0,255) 
end) 

Posted
Do You have Teams with name 'Red Team' and 'Blue Team' ?

seems like you don't.

They are

addEventHandler("onResourceStart",root 
function(thePlayer) 
   createTeam("Red Team" 255,0,0) 
   createTeam("Blue Team" 0,0,255) 
end 
) 

you forgot to put ',' after "RedTeam" and "Blue Team"

addEventHandler("onResourceStart",resourceRoot 
function() 
   createTeam("Red Team",255,0,0) 
   createTeam("Blue Team",0,0,255) 
end) 

Same Error Stupid countPlayersInTeam

addEvent("tdmstart", true) 
addEventHandler("tdmstart",root, 
addEventHandler("onClientRender", root, 
function() 
    local redteamname = getTeamFromName("Red Team") 
    local blueteamname = getTeamFromName("Blue Team") 
    local redp = countPlayersInTeam( redteamname ) 
    local bluep = countPlayersInTeam( blueteamname ) 
    local screenWidth, screenHeight = guiGetScreenSize() 
    local ax, ay = screenWidth - 90, 200 
    local ax1, ay1 = screenWidth - 92, 180   
    dxDrawText("Red Team: "..tostring(redp), ax,ay) 
    dxDrawText("Blue Team: "..tostring(bluep), ax1,ay1) 
end) 
) 

Posted
addEventHandler("onResourceStart",resourceRoot, 
function() 
   createTeam("Red Team",255,0,0) 
   createTeam("Blue Team",0,0,255) 
end) 

Posted
addEventHandler("onResourceStart",resourceRoot, 
function() 
   createTeam("Red Team",255,0,0) 
   createTeam("Blue Team",0,0,255) 
end) 

If you noticed i missed the comma i just noticed it because i got a error

addEventHandler("onResourceStart",root 
function(thePlayer) 
   createTeam("Red Team", 255,0,0) 
   createTeam("Blue Team", 0,0,255) 
end 
) 

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