- Initiateur de la discussion
Firyo89
Geek suprême
- Messages
- 572
- Score réaction
- 123
- Points
- 170
Salut, tout est dit dans le titre, je n'ai rien trouvé sur le wiki
Code:
if then
end
if then
end
if LocalPlayer():GetActiveWeapon():GetClass() == "ur_class" then -- content
end
Montre ton codeFiryo89 à dit:Aucun des 2 ne fonctionnent :'(
local NextThink = CurTime()
local Compass_Reposition = nil
local Moving = false
local pos
--Chat notification--
CreateClientConVar("compass_messagetoggle","1",true,false)
local compass_messagetoggle1 = GetConVar("compass_messagetoggle"):GetInt()
if compass_messagetoggle1 == 1 then chat.AddText(Color(255,255,255),"To move the compass, type ", Color(0,255,0),"move_compass", Color(255,255,255)," in console!") chat.AddText(Color(255,255,255),"To hide these messages, type ", Color(0,255,0), "compass_messagetoggle 0", Color(255,255,255), " in console!")
else
end
--The Actual Compass--
if Player:GetWeapon( "sswep_bousolle" ) then hook.Add("HUDPaint", "DrawCompass", function() if NextThink < CurTime() then pos = LocalPlayer():GetPos() NextThink = CurTime() + 0.1 end if Compass_Reposition == nil then x, y = 40, 30 else if Moving and Compass_Reposition != nil then x, y = Compass_Reposition:GetPos() x = x - 5 y = y + 25 end end local ang = LocalPlayer():GetAimVector():Angle().y local pos_text = math.Round(pos.x)..", "..math.Round(pos.y) local key_texture = surface.GetTextureID("compass/compass_key") local ring_texture = surface.GetTextureID("compass/compass_ring") local h, w = 128, 128 local x2, y2 = x+(w/2), y+(h/2) local pos_text_y = y2+(h/2) local text_color = Color(255,255,255,255) local bearing_text =math.abs(math.Round(ang) - 360) surface.SetDrawColor(255,255,255,255) surface.SetTexture(key_texture) surface.DrawTexturedRectRotated(x2,y2,w,h,ang-(ang*2)) surface.SetTexture(ring_texture) surface.DrawTexturedRect(x,y,w,h) draw.DrawText(pos_text, "Trebuchet24", x2, pos_text_y, text_color, TEXT_ALIGN_CENTER) draw.DrawText(bearing_text,"Trebuchet24", x2, pos_text_y + 20, text_color,TEXT_ALIGN_CENTER) end)
end
--Move Compass--
concommand.Add("move_compass", function() if Compass_Reposition == nil then Compass_Reposition = vgui.Create("DFrame") Compass_Reposition:SetSize(200, 200) Compass_Reposition:SetPos(45, 5) Compass_Reposition:MakePopup() Compass_Reposition:ShowCloseButton(false) Compass_Reposition:SetTitle("Reposition Compass") Compass_Reposition.Paint = function() draw.RoundedBox(8,0,0,110,22,Color(100,100,100,100)) end local Close = vgui.Create("DButton") Close:SetParent(Compass_Reposition) Close:SetSize(40, 15) Close:SetPos(120, 5) Close:SetText("Finish") Close.DoClick = function() Compass_Reposition:SetVisible(false) Moving = false end Close.Paint = function() draw.RoundedBox(8,0,-1,Close:GetWide()-4,Close:GetTall()+1,Color(100,100,100,100)) end else Compass_Reposition:SetVisible(true) Compass_Reposition:MakePopup() end Moving = true
end)
[ERROR] 1. unknown - [C]:-1
Error in hook HUDPaint: addons/compass/lua/autorun/client/compass.lua:18: Tried to use a NULL entity!
stack traceback: [C]: in function 'GetClass' addons/compass/lua/autorun/client/compass.lua:18: in function 'fn' addons/ulib/lua/ulib/shared/hook.lua:109: in function <addons/ulib/lua/ulib/shared/hook.lua:92> [C]: in function ''
Firyo89 à dit:Enfait nan, quand je meurs une erreur fait son apparition
Code:[ERROR] 1. unknown - [C]:-1 Error in hook HUDPaint: addons/compass/lua/autorun/client/compass.lua:18: Tried to use a NULL entity! stack traceback: [C]: in function 'GetClass' addons/compass/lua/autorun/client/compass.lua:18: in function 'fn' addons/ulib/lua/ulib/shared/hook.lua:109: in function <addons/ulib/lua/ulib/shared/hook.lua:92> [C]: in function ''
if LocalPlayer():Alive() and LocalPlayer():GetActiveWeapon():GetClass() == "ur_class" then -- content
end
Je vais testthepsyca à dit:Code:if LocalPlayer():Alive() and LocalPlayer():GetActiveWeapon():GetClass() == "ur_class" then -- content end
Cette violence gratuiteSIGEMT à dit:mais @Deadman69330 faut vraiment que t’arrêtes d'essayer de faire du Lua, c'est fou quand même y'en a qui auraient progressé mais toi, non tu fais toujours n’importe quoi,