Advertisement
Guest User

Untitled

a guest
Jul 6th, 2010
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.88 KB | None | 0 0
  1.             if ( trace.Entity:IsPlayer() ) then
  2.                 local alpha = math.Clamp(255 - ( (255 / fadeDistance) * ( LocalPlayer():GetPos():Distance( trace.Entity:GetPos() ) ) ), 0, 255);
  3.                
  4.                 -- Get the x and y position.
  5.                 local x, y = self:GetScreenCenterBounce();
  6.                
  7.                 -- Draw the player's name.
  8.                 y = self:DrawInformation(trace.Entity:Name(), "ChatFont", x, y, team.GetColor( trace.Entity:Team() ), alpha);
  9.                
  10.                 -- Check if the player is in a clan.
  11.                 if (trace.Entity:GetNetworkedString("cider_Clan") != "") then
  12.                     y = self:DrawInformation("Clan: "..trace.Entity:GetNetworkedString("cider_Clan"), "ChatFont", x, y, Color(255, 255, 255, 255), alpha);
  13.                 end;
  14.                
  15.                 -- Draw the player's job.
  16.                 y = self:DrawInformation("Job: "..trace.Entity:GetNetworkedString("cider_Job"), "ChatFont", x, y, Color(255, 255, 255, 255), alpha);
  17.             elseif ( ValidEntity( trace.Entity:GetNetworkedEntity("cider_Player") ) ) then
  18.                 local player = trace.Entity:GetNetworkedEntity("cider_Player");
  19.                
  20.                 -- Check if the player is alive.
  21.                 if ( player:Alive() and player != LocalPlayer() ) then
  22.                     local alpha = math.Clamp(255 - ( (255 / fadeDistance) * ( LocalPlayer():GetPos():Distance( trace.Entity:GetPos() ) ) ), 0, 255);
  23.                    
  24.                     -- Get the x and y position.
  25.                     local x, y = self:GetScreenCenterBounce();
  26.                    
  27.                     -- Draw the player's name.
  28.                     y = self:DrawInformation(player:Name(), "ChatFont", x, y, team.GetColor( player:Team() ), alpha);
  29.                    
  30.                     -- Check if the player is in a clan.
  31.                     if (player:GetNetworkedString("cider_Clan") != "") then
  32.                         y = self:DrawInformation("Clan: "..player:GetNetworkedString("cider_Clan"), "ChatFont", x, y, Color(255, 255, 255, 255), alpha);
  33.                     end;
  34.                    
  35.                     -- Draw the player's job.
  36.                     y = self:DrawInformation("Job: "..player:GetNetworkedString("cider_Job"), "ChatFont", x, y, Color(255, 255, 255, 255), alpha);
  37.                 end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement