function ulx.votekick( calling_ply, target_ply, reason )
if voteInProgress then
ULib.tsayError( calling_ply, "There is already a vote in progress. Please wait for the current one to end.", true )
return
end
if calling_ply.VoteKickCooldown == nil then
calling_ply.VoteKickCooldown = CurTime() - 1
end
if (calling_ply.VoteKickCooldown < CurTime()) then
calling_ply.VoteKickCooldown = CurTime() + 180
local msg = "Kick " .. target_ply:Nick() .. "?"
if reason and reason ~= "" then
msg = msg .. " (" .. reason .. ")"
end
ulx.doVote( msg, { "Yes", "No" }, voteKickDone, _, _, _, target_ply, time, calling_ply, reason )
ulx.fancyLogAdmin( calling_ply, "#A started a votekick against #T", target_ply )
else
ULib.tsayError(calling_ply, "Please do not spam votes!")
end
end
This should do the trick, although it only prevents the same player from using the votekick over and over until it is on cooldown, again.
Kind regards,
Avoid