Ajouter l'argent à sa carte d'identité

  • Initiateur de la discussion
NovixGaming

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 :
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
Et le code entier :

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
 
Axel Zemirli

Axel Zemirli

Geek suprême
Messages
86
Score réaction
16
Points
105
T'as juste a créer un "draw.SimpleText" avec la variable
v:getDarkRPVar("money") dans les deux parties de code
 
Dernière édition:
  • Initiateur de la discussion
NovixGaming

NovixGaming

Geek
Messages
229
Score réaction
8
Points
85
J'ai essayer mais ça ne marche pas
20190117203554_1.jpg



ça me fait ça voici mon code :
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("money"), "vukein_font", TextW, TextH+60, 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(LP:getDarkRPVar("money"), "vukein_font", TextW, TextH+60, 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

Le texte ne s'affiche pas et en plus il y a un bug graphique !
 
thepsyca

thepsyca

Psychopathe
Messages
2 164
Score réaction
648
Points
365
NovixGaming à dit:
J'ai essayer mais ça ne marche pas
Regarde la pièce jointe 12579


ça me fait ça voici mon code :
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("money"), "vukein_font", TextW, TextH+60, 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(LP:getDarkRPVar("money"), "vukein_font", TextW, TextH+60, 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

Le texte ne s'affiche pas et en plus il y a un bug graphique !
Ligne 147 : LP -> v et TextH -> Définir la variable / Mettre une valeur numérique
 
  • Initiateur de la discussion
NovixGaming

NovixGaming

Geek
Messages
229
Score réaction
8
Points
85
thepsyca à dit:
Ligne 147 : LP -> v et TextH -> Définir la variable / Mettre une valeur numérique
Merci beaucoup ça marche est-ce possible de rajouter un texte du style "Argent : (money) $ ?
J'ai essayer ça mais ça ne marche pas :
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("Argent : "..LP:getDarkRPVar("money").."€"), "vukein_font", TextW, TextH+60, 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 )
 
Axel Zemirli

Axel Zemirli

Geek suprême
Messages
86
Score réaction
16
Points
105
draw.SimpleText("Argent:"..LP:getDarkRPVar("money").."€", "vukein_font", TextW, TextH+60, Color( 0, 0, 0, 255 ), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER )
Tu Remplaceras le LP par v quand rajouteras le code dans le swep
 
Dernière édition:
  • Initiateur de la discussion
NovixGaming

NovixGaming

Geek
Messages
229
Score réaction
8
Points
85
Maintenant j'ai cette erreur qui s'affiche dans la console :
[ERROR] addons/usa_id_card/lua/weapons/idcardusa/shared.lua:94: unexpected symbol near ','
1. unknown - addons/usa_id_card/lua/weapons/idcardusa/shared.lua:0 (l'objet a disparu, je peux plus le faire spawn)
Mon code :
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("Argent:"..LP:getDarkRPVar("money").."€"), "vukein_font", TextW, TextH+60, 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("Argent:"..v:getDarkRPVar("money").."€"), "vukein_font", TextW, TextH+60, 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
 
Axel Zemirli

Axel Zemirli

Geek suprême
Messages
86
Score réaction
16
Points
105
Il y'a une " ) " à côté du "€" ligne 94 a enlever
 
  • Initiateur de la discussion
NovixGaming

NovixGaming

Geek
Messages
229
Score réaction
8
Points
85
Je doit aussi l'enlever au niveau du draw text swep ou pas ?
 
Axel Zemirli

Axel Zemirli

Geek suprême
Messages
86
Score réaction
16
Points
105
C'est une erreur donc effectivement c'est à enlever
 
  • Initiateur de la discussion
NovixGaming

NovixGaming

Geek
Messages
229
Score réaction
8
Points
85
Axel Zemirli à dit:
C'est une erreur donc effectivement c'est à enlever
OK j'te remercie beaucoup je vais essayer ça demain je passerai le post en résolue quand
ca marchera ;):)
 
  • Initiateur de la discussion
NovixGaming

NovixGaming

Geek
Messages
229
Score réaction
8
Points
85
Problème réglé merci beaucoup a vous ! :D
 
Discord d'entraide
Rejoignz-nous sur Discord