• How do i give more pwoer to certain groups in map vote (more power)
    8 replies, posted
I use the map vote system by Willox ( [url]http://facepunch.com/showthread.php?t=1268353[/url] ) and if you're a admin/super admin your votes count as 2. I want donator votes to count as 2 also and i'm not sure how i would do this. mapvote.lua: [url]http://pastebin.com/L6NJhpej[/url]
Can you show us the cl_mapvote.lua as well? Anyways, it depends on how your ranking system is set up, are you using usergroups?
[url]https://github.com/Willox303/gmod-mapvote/blob/master/lua/mapvote/sv_mapvote.lua[/url] It already does that. The file you paste-binned. IsAdmin also counts IsSuperAdmin, you could do IsAdmin || IsSuperAdmin || IsDonator // for IsDonator check the group. [url]https://github.com/Willox303/gmod-mapvote/blob/master/lua/mapvote/sv_mapvote.lua[/url] Here you see it already counts as 2 votes if has extra vote power [lua] if(MapVote.HasExtraVotePower(v2)) then map_results[v] = map_results[v] + 2 else map_results[v] = map_results[v] + 1 end[/lua] Example: [lua]function MapVote.HasExtraVotePower( ply ) local _group = ply:GetNWString( "UserGroup" ); -- Example that gives admins more voting power if ( ply:IsAdmin() || ply:IsSuperAdmin( ) || _group == "donator" ) then return true; end return false; end[/lua]
If you look on the map vote system page, you can see that he says how to make extra power work [QUOTE]You can give players extra voting power in lua/autorun/mapvote.lua with the MapVote.HasExtraVotePower function[/QUOTE]
[QUOTE=Acecool;43552867][url]https://github.com/Willox303/gmod-mapvote/blob/master/lua/mapvote/sv_mapvote.lua[/url] It already does that. The file you paste-binned. IsAdmin also counts IsSuperAdmin, you could do IsAdmin || IsSuperAdmin || IsDonator // for IsDonator check the group. [url]https://github.com/Willox303/gmod-mapvote/blob/master/lua/mapvote/sv_mapvote.lua[/url] Here you see it already counts as 2 votes if has extra vote power [lua] if(MapVote.HasExtraVotePower(v2)) then map_results[v] = map_results[v] + 2 else map_results[v] = map_results[v] + 1 end[/lua] Example: [lua]function MapVote.HasExtraVotePower( ply ) local _group = ply:GetNWString( "UserGroup" ); -- Example that gives admins more voting power if ( ply:IsAdmin() || ply:IsSuperAdmin( ) || _group == "donator" ) then return true; end return false; end[/lua][/QUOTE] I don't exactly understand what you're trying to say i should do. The file i put on paste bin was /addons/mapvote/lua/autorun/mapvote.lua this looks like the function that gives admins more voting power [lua]function MapVote.HasExtraVotePower(ply) -- Example that gives admins more voting power if ply:IsAdmin() then return true end[/lua] Should i change it to this? I don't think this is right though. [lua]function MapVote.HasExtraVotePower(ply) -- Example that gives admins more voting power if ply:IsAdmin() || ply:IsSuperAdmin || plyIsElite then return true end[/lua]
Close; but plyIsElite isn't a function, the IsSuperAdmin doesn't have ( ) on the end so that'll be another error; etc. If you're using groups; then use the code I provided which will give admins, superadmins and group donator 2 votes per vote. The code I posted: [lua] if(MapVote.HasExtraVotePower(v2)) then map_results[v] = map_results[v] + 2 else map_results[v] = map_results[v] + 1 end[/lua] Is showing you that 2 points are already given to those players when HasExtraVotePower returns true; the goal is to get it to return true for your donator group. If you are using user-groups to designate your donator group, this would be the code to use. [lua]function MapVote.HasExtraVotePower( ply ) local _group = ply:GetNWString( "UserGroup" ); -- Example that gives admins more voting power if ( ply:IsAdmin() || ply:IsSuperAdmin( ) || _group == "donator" ) then return true; end return false; end[/lua] If you're using a function, such as IsElite as your posted, you'd use this: [lua]function MapVote.HasExtraVotePower( ply ) -- Example that gives admins more voting power if ( ply:IsAdmin() || ply:IsSuperAdmin( ) || ply:IsElite( ) ) then return true; end return false; end[/lua] We really don't have enough information on your side to give you a definite answer on what function or group to use. If you can share the files which set users to donator when they donate, we can tell you what to do.
My server is pretty new and i haven't edited any of the map vote files so they're all default right now. Basically what i'm asking, if you didn't understand from my first post, is how to make certain groups votes count as 2 votes (admins/superadmins votes have a star by their picture when they vote) My donator rank's name is "Elite" and i just manually give them the rank.
[QUOTE=hexicdragon;43553530]My server is pretty new and i haven't edited any of the map vote files so they're all default right now. Basically what i'm asking, if you didn't understand from my first post, is how to make certain groups votes count as 2 votes (admins/superadmins votes have a star by their picture when they vote) My donator rank's name is "Elite" and i just manually give them the rank.[/QUOTE] [lua]function MapVote.HasExtraVotePower( ply ) local _group = ply:GetNWString( "UserGroup" ); -- Example that gives admins more voting power if ( ply:IsAdmin() || ply:IsSuperAdmin( ) || _group == "Elite" ) then return true; end return false; end[/lua]
(sorry for late reply) Thanks dude it works :D
Sorry, you need to Log In to post a reply to this thread.