Bug Fixes & Edits

This commit is contained in:
Zero 2020-03-30 18:33:52 -04:00
parent 3ce9ed17cb
commit 12e805c592

View File

@ -1,20 +1,24 @@
function injectPointshop1Module()
hook.Add("PlayerInitialSpawn", "ULXCC_VariableSet", function (ply)
timer.Simple(10, function ()
ply.canbrag = true;
if (IsValid(ply)) then
ply.canbrag = true;
end
end);
end);
function startTimer(ply)
timer.Simple(180, function ()
ply.canbrag = true;
if (IsValid(ply)) then
ply.canbrag = true;
end
end);
end
function ulx.brag(calling_ply)
if (IsValid(calling_ply) && calling_ply.canbrag) then
calling_ply.canbrag = false;
startTimer(calling_ply);
local pts = calling_ply:PS_GetPoints();
if (isnumber(tonumber(pts)) && (tonumber(pts) != 0)) then
local pts = tonumber(calling_ply:PS_GetPoints());
if (isnumber(pts) && (pts != 0)) then
for _, v in ipairs(player.GetHumans()) do
if (IsValid(v)) then
v:ChatPrint("[BRAG]: " .. ((calling_ply.Nick && calling_ply:Nick()) || "?") .. " has " .. tostring(pts) .. " points!");
@ -27,7 +31,7 @@ function injectPointshop1Module()
ULib.tsayError(calling_ply, "[ERROR]: You can't brag yet!");
end
end
local brag = ulx.command("Custom", "ulx brag", ulx.brag, {"!brag", "!brags", "!points", "!mypoints", "!point"}, true);
local brag = ulx.command("Custom", "ulx brag", ulx.brag, {"!brag", "!mypoints"}, true);
brag:defaultAccess(ULib.ACCESS_ALL);
brag:help("Brag about your pointshop points!");
function ulx.viewpoints(calling_ply, target_plys)
@ -51,12 +55,12 @@ function injectPointshop1Module()
v:ChatPrint(calling_ply:Nick() .. " has given you " .. (tostring(points) || 0) .. " points!");
end
end
ulx.fancyLogAdmin(calling_ply, "#A gave #i pointshop points to #T", points, target_plys);
ulx.fancyLogAdmin(calling_ply, "#A gave #i points to #T", points, target_plys);
end
local givepoints = ulx.command("Utility", "ulx givepoints", ulx.givepoints, {"!reward", "!givepoints", "!points"}, true);
local givepoints = ulx.command("Fun", "ulx givepoints", ulx.givepoints, "!givepoints", true);
givepoints:addParam({type = ULib.cmds.PlayersArg});
givepoints:addParam({type = ULib.cmds.NumArg, min = 5, max = 9999999, hint = "NumberPoints", ULib.cmds.round});
givepoints:help("Award a player with pointshop points generated by the server.");
givepoints:addParam({type = ULib.cmds.NumArg, min = 5, max = 99999999, hint = "Points", ULib.cmds.round});
givepoints:help("Give a player pointshop points.");
givepoints:defaultAccess(ULib.ACCESS_SUPERADMIN);
end