HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Vote System

04-13-2008, 01:53 PM#1
Billi23CooL
hi everyone, i would like to put a vote system in my Vampirism
it would be for Feeding the Vampire

i found a vote system(kick vote system) but it has like 90trigger :/ and i would like to know how do i do this

a player in team one type -feed [color]
if more than half of the player are okay he will get 2500xp
something like that
04-13-2008, 02:35 PM#2
Gorman
First add this to your map initialization

Trigger:
Add this to you Map Initialzation
Collapse Events
Map initialization
Conditions
Collapse Actions
Set NumberOfUsers = 0
Collapse Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
Collapse Loop - Actions
Set NumberOfUsers = (NumberOfUsers + 1)
Trigger - Add to Feed Trigger <gen> the event (Player - (Picked player) types a chat message containing - feed as An exact match)

Then this is for the actual feeding part

Trigger:
Feed trigger
Events
Collapse Conditions
PlayerHasTyped[(Player number of (Triggering player))] Equal to 1
Collapse Actions
Set PlayerHasTyped[(Player number of (Triggering player))] = 0
Set NumberWhoWantToFeed = (NumberWhoWantToFeed + 1)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
NumberWhoWantToFeed Greater than or equal to (NumberOfUsers / 2)
Collapse Then - Actions
Set NumberWhoWantToFeed = 0
Collapse For each integer (Integer) 1 to 12 do (multiple actions)
Set PlayerHasTyped[Integer] = 1
Hero - Add 2500 experience to Vampire, Show level up graphics
Else - Actions

When more then half the players type -feed it will add 2500 xp to the vampire, then it will reset so you can do it again!

sry i couldnt write more, but i need sleep!

hope this helps.
04-13-2008, 02:50 PM#3
Zandose
Beat me. I was trying to make a vJASS one.
04-13-2008, 05:38 PM#4
zen87
start with something and post your code then only ask, dun beg for it
04-14-2008, 06:20 AM#5
Gorman
Woops, didnt see you wanted it for every player!
Just make the trigger get the player number, and then make NumberWhoWantFeed an array, I can post you a trigger if you want

@Zandose: =D