- Initiateur de la discussion
NovixGaming
Geek
- Messages
- 229
- Score réaction
- 8
- Points
- 85
Bonjour,
J'aimerais ajouter une ligne qui permet d'afficher l'argent du joueur sur sa carte d'identité.
L'addon de la carte d'identité vien de vukein : https://steamcommunity.com/sharedfiles/filedetails/?id=1188504956
Voici où je suppose qu'il faut rajouter une ligne :
Et le code entier :
J'aimerais ajouter une ligne qui permet d'afficher l'argent du joueur sur sa carte d'identité.
L'addon de la carte d'identité vien de vukein : https://steamcommunity.com/sharedfiles/filedetails/?id=1188504956
Voici où je suppose qu'il faut rajouter une ligne :
Code:
draw.SimpleText(LP:Nick(), "vukein_font", TextW, TextH, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) draw.SimpleText(LP:SteamID(), "vukein_font", TextW, TextH+30, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) draw.SimpleText(LP:getDarkRPVar("name"), "vukein_font", TextW, TextH+60, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) draw.SimpleText("Gun License :", "vukein_font", TextW, TextH+90, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) if LP:getDarkRPVar("HasGunlicense") then draw.SimpleText("YES", "vukein_font", TextW+160, TextH+92, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) else draw.SimpleText("NO", "vukein_font", TextW+160, TextH+92, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end local DIS = 0 local CS = 5 local LicenseW, LicenseH = W+325, H+90
end
Code:
if SERVER then AddCSLuaFile("shared.lua")
end
if CLIENT then SWEP.PrintName = "USA ID Card" SWEP.Slot = 2 SWEP.SlotPos = 2 SWEP.DrawAmmo = false SWEP.DrawCrosshair = false
end
SWEP.Author = "Vukein"
SWEP.Instructions = "Keep this card in your hand to show it to the other players."
SWEP.Contact = "https://steamcommunity.com/id/vukein/"
SWEP.Purpose = ""
SWEP.HoldType = "pistol";
SWEP.WorldModel = ""
SWEP.AnimPrefix = "pistol"
SWEP.Category = "Vukein"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = ""
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = 0
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = ""
function SWEP:Initialize() self:SetHoldType("pistol") end
function SWEP:CanPrimaryAttack ( ) return false; end
function SWEP:CanSecondaryAttack ( ) return false; end
function SWEP:DrawWorldModel()
end
function SWEP:PreDrawViewModel(vm) return true
end
if CLIENT then
surface.CreateFont( "vukein_font", { font = "Roboto", size = 24, weight = 1500, antialias = true,
} )
surface.CreateFont( "vukein_font_bis", { font = "Roboto", size = 20, weight = 1500, antialias = true,
} )
surface.CreateFont( "vukein_font_yn", { font = "Roboto", size = 28, weight = 1500, antialias = true,
} )
local VUMat = Material("id_card_usa.png")
function SWEP:DrawHUD() local LW, LH = 500, 250 local W,H = ScrW()-LW-5, ScrH()-LH-5 local LP = LocalPlayer() LP.PIcon = LP.PIcon or vgui.Create( "ModelImage") LP.PIcon:SetSize(146,144) LP.PIcon:SetModel(LP:GetModel()) surface.SetMaterial(VUMat) surface.SetDrawColor(255, 255, 255, 255) surface.DrawTexturedRect(W, H, LW, LH) LP.PIcon:SetPos(W+25,H+71) LP.PIcon:SetPaintedManually(false) LP.PIcon:PaintManual() LP.PIcon:SetPaintedManually(true) local TextW,TextH = W+175, H + 75 draw.SimpleText(LP:Nick(), "vukein_font", TextW, TextH, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) draw.SimpleText(LP:SteamID(), "vukein_font", TextW, TextH+30, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) draw.SimpleText(LP:getDarkRPVar("name"), "vukein_font", TextW, TextH+60, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) draw.SimpleText("Gun License :", "vukein_font", TextW, TextH+90, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) if LP:getDarkRPVar("HasGunlicense") then draw.SimpleText("YES", "vukein_font", TextW+160, TextH+92, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) else draw.SimpleText("NO", "vukein_font", TextW+160, TextH+92, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end local DIS = 0 local CS = 5 local LicenseW, LicenseH = W+325, H+90
end
hook.Add("PreDrawTranslucentRenderables", "DrawDICards", function() local LPlayer = LocalPlayer() for k,v in pairs(player.GetAll()) do local CurWep = v:GetActiveWeapon() if v != LPlayer and IsValid(CurWep) and v:GetActiveWeapon():GetClass() == "idcardusa" and v:HasWeapon("idcardusa") then if LPlayer:GetPos():Distance(v:GetPos()) > 1000 then return end v.PIcon = v.PIcon or vgui.Create( "ModelImage") v.PIcon:SetSize(90,93) v.PIcon:SetModel(v:GetModel()) local boneindex = v:LookupBone("ValveBiped.Bip01_R_Hand") if boneindex then local HPos, HAng = v:GetBonePosition(boneindex) HAng:RotateAroundAxis(HAng:Forward(), -90) HAng:RotateAroundAxis(HAng:Right(), -90) HAng:RotateAroundAxis(HAng:Up(), 5) HPos = HPos + HAng:Up()*4 + HAng:Right()*-5 + HAng:Forward()*1 cam.Start3D2D(HPos, HAng, 1) surface.SetMaterial(VUMat) surface.SetDrawColor(255, 255, 255, 255) surface.DrawTexturedRect(0, 0, 15, 8) cam.End3D2D() cam.Start3D2D(HPos, HAng, .05) v.PIcon:SetPos(12,45) v.PIcon:SetPaintedManually(false) v.PIcon:PaintManual() v.PIcon:SetPaintedManually(true) local TextW = 105 draw.SimpleText(v:Nick(), "vukein_font_bis", TextW, 50, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) draw.SimpleText(v:SteamID(), "vukein_font_bis", TextW, 70, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) draw.SimpleText("Gun", "vukein_font_bis", TextW, 110, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) draw.SimpleText("License :", "vukein_font_bis", TextW, 125, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) if v:getDarkRPVar("HasGunlicense") then draw.SimpleText("Yes", "vukein_font_yn", TextW+75, 125, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) else draw.SimpleText("NO", "vukein_font_yn", TextW+75, 125, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER ) end local LicenseW = 225 local DIS = 35 local CS = 40 cam.End3D2D() end end end
end)
end