|Function name||DarkRP.createVote(string question, string voteid, Player target, number delay, function callback, table excludeVoters, function fail, any ...)|
|Create a vote.|
|Part of Library:||DarkRP|
- question (string)
- voteid (string)
- target (Player)
- delay (number)
- callback (function)
- excludeVoters (table) (optional)
- fail (function) (optional)
- ... (any) (optional)
The question to ask in the vote.
A unique vote id.
Whom the vote is about.
For how long the player will be able to answer.
The function that gets called after the vote.
The players to exclude from voting.
A callback for when the vote fails.
Any other information. If the vote involves multiple parties (i.e. the target of the vote and person who started it are different) you should provide a table with the "source" field set to the player who intiated the vote. This ensures the notifications about the vote are sent to the correct player.
Function return values
- vote (table)
All the vote information. Returns nil if the vote did not start because the canStartVote hook blocked it.