DarkRP.CanVote
Jump to navigation
Jump to search
ply (Player)
vote (table)
This page refers to DarkRP 2.4.3. This information may be incorrect as of later versions. Check here for a up-to-date list of hooks. |
---|
Syntax[edit]
Description | Decides whether a player can vote on a certain vote. |
---|---|
Syntax |
GAMEMODE:CanVote(Player ply, table vote)
|
Returns | CanVote (boolean): whether the player can vote on this vote message (string): the message shown when they can't |
Arguments
The player to decide suffrage for
the table that contains all the information about the vote
Examples[edit]
Description | Only donators and admins can vote (such censorship, god damn) |
---|---|
Code | hook.Add("CanVote", "example", function(ply, vote)
if ply:GetNWString("usergroup") ~= "donator" and not ply:IsAdmin() then
return false, "Nein!"
end
-- Return nothing otherwise to take the default
end)
|
Output | Nazi Germany |