Ulysses
General => Developers Corner => Topic started by: ryno893 on June 20, 2014, 04:51:51 AM
-
Hi, I wanted a command that would use tempadduser or anything of the sort to VIP, then after 3 hours demote them back to user. I'm still learning lua, and would love your help! With every piece of code I learn more, thanks!
-
Look at the code in tempadduser and the various autopromote in the releases section of the forum for ideas?
-
Can you please rephrase that I don't understand.
-
Your first question isn't really clear either.
Do you want someone in trial VIP automatically, then automatically removed?
There are several autopromote scripts in our Releases section.
There is also a temporary add user addon.
If you want it all automated, look at both, see how they work, then mesh together.
If you simply want a tempadd user, see the release already there.
-
Just made this rather quickly
You could improve upon this by recording if they've used their Trial by saving to a text file or using sqlite.
local lengthOfTrial = 60*2 //2 Hours
local textCommandForTrial = "!activateVipTrial"
function activateTrialVIP(ply, text, public)
if IsValid(ply) and text == textCommandForTrial then
RunConsoleCommand("ulx", "adduserid", ply:SteamID(), "VIP")
timer.Simple(lengthOfTrial, function()
RunConsoleCommand("ulx", "removeuser", ply:Nick())
end)
end
end
hook.Add("PlayerSay", "trialVIPlawlCTI", activateTrialVIP)