• Check team
    6 replies, posted
I was trying to make a script that would check players on the team, and draw the image on the screen. But something went wrong and nothing works and errors. Can you help me [CODE] function team( ply ) if ply:Team() == TEAM_DEATH then surface.SetMaterial( Material( "sss/image.png", "noclamp" ) ) surface.SetDrawColor(255, 255, 255, 255) surface.DrawTexturedRect(71,scrh-301,256,256) else surface.SetMaterial( Material( "sss/image2.png", "noclamp" ) ) surface.SetDrawColor(255, 255, 255, 255) surface.DrawTexturedRect(71,scrh-301,256,256) end end [/CODE]
Did you put this in a hook? Otherwise ply will be undefined.
What are the errors?
Is that all of the code? Is scrh defined anywhere? If not, you should be using ScrH() and ScrW()
[QUOTE=LittleBigBug;49315136]What are the errors?[/QUOTE] [CODE][ERROR] gamemodes/base/gamemode/cl_init.lua:131: attempt to index global 'team' (a function value) 1. GetTeamColor - gamemodes/base/gamemode/cl_init.lua:131 2. Run - gamemodes/base/gamemode/cl_targetid.lua:44 3. HUDPaint - gamemodes/base/gamemode/cl_init.lua:75 4. unknown - gamemodes/deathrun/gamemode/cl_init.lua:652[/CODE] [QUOTE=Nick78111;49315875]Is that all of the code? Is scrh defined anywhere? If not, you should be using ScrH() and ScrW()[/QUOTE] [CODE] scrh = ScrH() scrw = ScrW() [/CODE]
Don't name your function "team".
[QUOTE=Nick78111;49325517]Don't name your function "team".[/QUOTE] Thank you, I fix error, but I have one question. I have an image garlands which I draw on the screen, I need to do to make it flashing garland, what function should I use to do this?
Sorry, you need to Log In to post a reply to this thread.