- Initiateur de la discussion
Anthonym05
Geek
- Messages
- 46
- Score réaction
- 0
- Points
- 95
Je voudrais s'avoir dans le code comment set la vie du joueur à 100 voici le code :
include('shared.lua')
net.Receive( "NPCPANEL", function()
local ply = LocalPlayer()
local Menu = vgui.Create("DFrame")
Menu:SetSize(300,400)
Menu:SetTitle("Médecin")
Menu:Center()
Menu:MakePopup()
Menu.Paint = function( self, w, h )
surface.SetDrawColor( Color(0, 110, 255, 200) )
surface.DrawRect( 0, 0, w, h )
end
local SOINS100 = vgui.Create("DButton", Menu)
SOINS100:SetSize( 208, 40 )
SOINS100:SetPos( 40, 120 )
SOINS100:SetText(" 100 HP ")
SOINS100:SetTextColor(Color(0, 0, 0))
SOINS100.DoClick = function ()
ply:SetHealth(100)
chat.AddText(Color(255,0,0),"[Médecin] Vous avez étais soigner.")
end
hook.Add("PostDrawOpaqueRenderables", "NPCPANEL", function()
for _, ent in pairs (ents.FindByClass("panel")) do
if ent:GetPos()istance(LocalPlayer():GetPos()) < 500 then
local Ang = ent:GetAngles()
Ang:RotateAroundAxis( Ang:Forward(), 90)
Ang:RotateAroundAxis( Ang:Right(), -90)
cam.Start3D2D(ent:GetPos()+ent:GetUp()*76, Ang, 0.10)
draw.SimpleTextOutlined( "Panel", "my_npc", 0, 0, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 0, Color(255,255,255,255) )
cam.End3D2D()
end
end
end)
surface.CreateFont( "my_npc", {
font = "Arial",
extended = true,
size = 100,
weight = 1000
} )
end)
include('shared.lua')
net.Receive( "NPCPANEL", function()
local ply = LocalPlayer()
local Menu = vgui.Create("DFrame")
Menu:SetSize(300,400)
Menu:SetTitle("Médecin")
Menu:Center()
Menu:MakePopup()
Menu.Paint = function( self, w, h )
surface.SetDrawColor( Color(0, 110, 255, 200) )
surface.DrawRect( 0, 0, w, h )
end
local SOINS100 = vgui.Create("DButton", Menu)
SOINS100:SetSize( 208, 40 )
SOINS100:SetPos( 40, 120 )
SOINS100:SetText(" 100 HP ")
SOINS100:SetTextColor(Color(0, 0, 0))
SOINS100.DoClick = function ()
ply:SetHealth(100)
chat.AddText(Color(255,0,0),"[Médecin] Vous avez étais soigner.")
end
hook.Add("PostDrawOpaqueRenderables", "NPCPANEL", function()
for _, ent in pairs (ents.FindByClass("panel")) do
if ent:GetPos()istance(LocalPlayer():GetPos()) < 500 then
local Ang = ent:GetAngles()
Ang:RotateAroundAxis( Ang:Forward(), 90)
Ang:RotateAroundAxis( Ang:Right(), -90)
cam.Start3D2D(ent:GetPos()+ent:GetUp()*76, Ang, 0.10)
draw.SimpleTextOutlined( "Panel", "my_npc", 0, 0, Color(255,255,255,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 0, Color(255,255,255,255) )
cam.End3D2D()
end
end
end)
surface.CreateFont( "my_npc", {
font = "Arial",
extended = true,
size = 100,
weight = 1000
} )
end)