- Initiateur de la discussion
M
Membre supprimé 148402
Anonyme
DermaButton.DoClick = function()
if (name == "Use" and ply:IsPlayer() and (ply:GetNWInt("player_argent_sale") <= 0)) then
if not (table.HasValue(Cops_Job, team.GetName(activator:Team()))) then
ply:SendLua("local tab = {Color(218,218,218,255), [["..AS_Name..": ]], Color(255,255,255), [["..table.Random(AS_not).."]] } chat.AddText(unpack(tab))");
timer.Simple(0.25, function() self:EmitSound(table.Random(AS_not_sond), 100, 100) end);
end
elseif (name == "Use") and (ply:IsPlayer()) and (ply:GetNWInt("player_argent_sale") > 0) then
if not (table.HasValue(Cops_Job, team.GetName(activator:Team()))) then
taxeargentsale = math.Round(math.Round(ply:GetNWInt("player_argent_sale")*AS_Taxe))
--DarkRP.notify(ply,1,5, "Vous avez gagner ["math.Round(ply:GetNWInt("player_argent_sale") - taxe)"] moins la taxe de "..taxe.."€")
ply:addMoney(math.Round(ply:GetNWInt("player_argent_sale") - taxeargentsale));
ply:SendLua("local tab = {Color(218,218,218,255), [["..AS_Name..": ]], Color(255,255,255), [["..table.Random(AS_yes)..", tient tes ]], Color(128, 255, 128), [["..math.Round(ply:GetNWInt("player_argent_sale") - taxeargentsale).."€.]], Color(255,255,255), [[Je t'ai pris "..taxeargentsale.."€,il me faut des sous !]] } chat.AddText(unpack(tab))");
ply:SetNWInt("player_argent_sale", 0);
timer.Simple(0.25, function() self:EmitSound(table.Random(AS_yes_sond), 100, 100) end);
ply:SetNWInt("iftradewithwhite", 1)
end
end;
if (table.HasValue(Cops_Job, team.GetName(activator:Team()))) then
if (self:GetNWInt("Scary") < 1) then
self:SetNWInt("Scary", AS_Scary)
ply:SendLua("local tab = {Color(218,218,218,255), [["..AS_Name..": ]], Color(255,255,255), [[Voilà les noms de mes clients !]] } chat.AddText(unpack(tab))");
for k, client in pairs( player:GetAll() ) do
if (client:GetNWInt("iftradewithwhite") == 1 ) then
ply:SendLua("local tab = {Color(218,218,218,255), [["..AS_Name..": ]], Color(255,255,255), [["..client:Nick().."]] } chat.AddText(unpack(tab))");
client:SetNWInt("iftradewithwhite", 0)
end
end
else
ply:SendLua("local tab = {Color(218,218,218,255), [["..AS_Name..": ]], Color(255,255,255), [[Je ne parlerais pas !]] } chat.AddText(unpack(tab))");
end
end
end
J'utilise l'addon d'argent sale de Samgaze et Skyyrize et je ne sais pas pourquoi mais mon bouton ne fonctionne pas.
Voici l'erreur:
[ERROR] lua/dermatest.lua:44: attempt to index global 'activator' (a nil value)
1. DoClick - lua/dermatest.lua:44
2. unknown - lua/vgui/dlabel.lua:237
Dans leur code, pour blanchir l'argent il y a ça au dessus mais si je le laisse ça ne fonctionne pas à cause du "ENT":
function ENT:AcceptInput(name, activator, caller)
(J'ai remplacé les caller par ply dans mon code sans la function)