Forum

> > CS2D > Scripts > server.lua ingame light
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch server.lua ingame light

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt server.lua ingame light

king923
User Off Offline

Zitieren
my server got very dark and i allmost can't see my player
i will be glad if someone can tell me what can i change here

function p.RemoveVision()
          if p.VisionImage then
               freeimage(p.VisionImage)
               p.VisionImage = nul
          end
     end

     function p.UpdateVision()
          p.RemoveVision()

          if player(id,"exists") then
               p.VisionImage = image("gfx/sprites/block.bmp",0,1,2,id)
               imagepos(p.VisionImage,320,240,0)
               imagescale(p.VisionImage,20,15)

               imagecolor(p.VisionImage,p.VisionColor())
               imagealpha(p.VisionImage,p.VisionAlpha())
          end
     end

alt Re: server.lua ingame light

Blunt
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function p.RemoveVision()
          if p.VisionImage then
               freeimage(p.VisionImage)
               p.VisionImage = nul
          end
     end

     function p.UpdateVision()
          p.RemoveVision()

          if player(id,"exists") then
               p.VisionImage = image("gfx/sprites/block.bmp",0,1,2,id)
               imagepos(p.VisionImage,320,240,0)
               imagescale(p.VisionImage,20,15)

               imagecolor(p.VisionImage,p.VisionColor())
               imagealpha(p.VisionImage,p.VisionAlpha())
          end
     end

use the code

alt Re: server.lua ingame light

king923
User Off Offline

Zitieren
thnx for wasting time with my problem but still not working the screen is dark and i can barely see my player and im sure the problem is because of the vision function can you have a look again?

     function p.VisionColor()
          if player(id,"team") == 1 or p.NightVision then
               return 0, 100, 0
          elseif player(id,"team") == 2 or player(id,"team") == 0 then
               return 0, 0, 0
          end
     end

     function p.VisionAlpha()
          if player(id,"team") == 1 or p.NightVision then
               return 0.5
          elseif player(id,"team") == 2 or player(id,"team") == 0 then
               return 0.85
          end
     end

     function p.RemoveVision()
          if p.VisionImage then
               freeimage(p.VisionImage)
               p.VisionImage = nil
          end
     end

     function p.UpdateVision()
          p.RemoveVision()

          if player(id,"exists") then
               p.VisionImage = image("gfx/sprites/block.bmp",0,1,2,id)
               imagepos(p.VisionImage,320,240,0)
               imagescale(p.VisionImage,20,15)

               imagecolor(p.VisionImage,p.VisionColor())
               imagealpha(p.VisionImage,p.VisionAlpha())
          end
     end
1× editiert, zuletzt 17.07.12 21:14:26
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht