PoLlama Forums  

Go Back   PoLlama Forums > WarCraft > Resources > Recycling Bin

Reply
 
LinkBack Thread Tools
Old 05-08-2007   #1
 
Mr. Zero's Avatar
 
Join Date: Sep 2006
Location: Denmark (GMT+1)
Posts: 2,173
Mr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond repute
[System] VoteKick

VoteKick
Made by Mr. Zero | Version 0.10
  • VoteKick infomation
    VoteKick is a trigger system, for RoC and TFT (Version 1.21), that enables players to vote for a kick, insted of only red can kick.
    Maybe red is jerk and does not care about other people, so he does not kick anybody. Therefore I made this system to all players can vote. If a player gets more than 50% vote for a kick, the system will kick the player. It has alot of options, but a bit hard to config.

  • Import the VoteKick
    Copy and paste the folder called "VoteKick", from the sample map, to your map's triggers. Nothing more...

  • Config VoteKick
    Under developerment...

Source Code:
Not done yet... almost...

Update Log:
Will be added soon...

~Mr. Zero
(Locked until post code and map)

[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]

"In the end there is no greater motivation than revenge"
SO I HERD U LEIK MUDKIPZ?!
Mr. Zero is offline   Reply With Quote
Old 05-14-2007   #2
 
Mr. Zero's Avatar
 
Join Date: Sep 2006
Location: Denmark (GMT+1)
Posts: 2,173
Mr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond repute
Re: [System] VoteKick

So yeah... what happend to this...

To tell the truth, I left WC3 almost. I don't play Bnet anymore nor using WE for anything.

But here. If anyone wants to finish this, you are more then welcome.
It only needs the core struct, which is easier. Count votes, more then 50% of players, kick player.

Code:
constant function VK_CM takes nothing returns string
  return "-votekick" //This is what the players shall write to votekick a player.
endfunction

constant function VK_C takes integer i returns string
  if i == 0 then
    return "Red" //The color's name of the 1st player
  endif
  if i == 12 then
    return "|CFFFF0303" //The color's hex code of the 1st player
  endif
  if i == 1 then
    return "Blue" //The color's name of the 2nd player
  endif
  if i == 13 then
    return "|CFF0042FF" //The color's hex code of the 2nd player
  endif
  if i == 2 then
    return "Teal" //The color's name of the 3nd player
  endif
  if i == 14 then
    return "|CFF1CB619" //The color's hex code of the 3nd player
  endif
  if i == 3 then
    return "Pruple" //The color's name of the 4nd player
  endif
  if i == 15 then
    return "|CFF540081" //The color's hex code of the 4nd player
  endif  
  if i == 4 then
    return "Yellow" //The color's name of the 5nd player
  endif
  if i == 16 then
    return "|CFFFFFF01" //The color's hex code of the 5nd player
  endif
  if i == 5 then
    return "Orange" //The color's name of the 6nd player
  endif
  if i == 17 then
    return "|CFFFE8A0E" //The color's hex code of the 6nd player
  endif
  if i == 6 then
    return "Green" //The color's name of the 7nd player
  endif
  if i == 18 then
    return "|CFF20C000" //The color's hex code of the 7nd player
  endif
  if i == 7 then
    return "Pink" //The color's name of the 8nd player
  endif
  if i == 19 then
    return "|CFFE55BB0" //The color's hex code of the 8nd player
  endif
  if i == 8 then
    return "Gray" //The color's name of the 9nd player
  endif
  if i == 20 then
    return "|CFF959697" //The color's hex code of the 9nd player
  endif
  if i == 9 then
    return "Light blue" //The color's name of the 10nd player
  endif
  if i == 21 then
    return "|CFF7EBFF1" //The color's hex code of the 10nd player
  endif
  if i == 10 then
    return "Dark green" //The color's name of the 11nd player
  endif
  if i == 22 then
    return "|CFF106246" //The color's hex code of the 11nd player
  endif
  if i == 11 then
    return "Brown" //The color's name of the 12nd player
  endif
  if i == 23 then
    return "|CFF4E2A04" //The color's hex code of the 12nd player
  endif
  return "*error*"
endfunction

function VK_M takes integer i, integer PN1, integer PN2 returns string
  local string Prefix = "|cffffcc00[VoteKick]|r " //This will be before all messages
  local string output = ""
  local string input = ""
  local boolean b = false
  
  // Note: Empty messages will not be showed and no sound will be played.
  // Commands:
  // %C1 will return the triggering players color hex code. 
  // %C2 will return the player's color hex code, the triggering player is voting anginst.
  // %CM will return the votekick command. What to type to vote for a kick.
  // %P1 will return the name of triggering player. 
  // %P2 will return the name of player the triggering player is voting anginst.
  // %PC1 will return the name of color of triggering player. 
  // %PC2 will return the name of color of the player the triggering player is voting anginst.
  // Example:
  // %C1%P1 wants to kick %C2%P2.
  // Will become:
  // |cffcc00Player 5|r wants to kick |cffffcc00Player 3|r.
  
  if i == 0 then
    set input = Prefix + "VoteKick has been disabled since there is not enough players." //The message when there is not enought players
  endif
  if i == 1 then
    set input = Prefix + "You can't vote against yourself." //The message when you try to vote anginst yourself
  endif
  if i == 2 then
    set input = Prefix + "You have already vote against %C2%P2." //When try to votekick a player that you have already vote for.
  endif
  if i == 3 then
    set input = Prefix + "No player in %C2%PC2's slot." //When you try to votekick a empty slot
  endif
  if i == 4 then
    set input = Prefix + "No player founded/Unknown command." //When you misstype or write a non-command
  endif
  if i == 5 then
    set input = Prefix + "%C1%P1 wants to kick %C2%P2." //The message to show when a player vote for a kick
  endif
  if i == 6 then
    set input = Prefix + "Type |cffffcc00%CM|r %C2%P2|r |cffffcc00/|r %C2%PN2|r |cffffcc00/|r %C2%PC2|r to vote for kick." //Help to what to type to kick
  endif
  //Nothing under here to change... unless you know that you are doing?
  set i = 0
  loop
    exitwhen i > StringLength(input)
    if SubString(input,i,i+1) == "%" then
      if SubString(input,(i+1),(i+2)) == "C" then
        if SubString(input,(i+2),(i+3)) == "1" then
          set output = output + VK_C((PN1+12))
          set b = true
          set i = i + 2
        else
          if SubString(input,(i+2),(i+3)) == "2" then
            set output = output + VK_C((PN2+12))
            set b = true
            set i = i + 2
          else
            if SubString(input,(i+2),(i+3)) == "M" then
              set output = output + VK_CM()
              set i = i + 2
            endif
          endif
        endif
      endif
      if SubString(input,(i+1),(i+2)) == "P" then
        if SubString(input,(i+2),(i+3)) == "1" then
          set output = output + (GetPlayerName(Player(PN1)))
          set i = i + 2
        else
          if SubString(input,(i+2),(i+3)) == "2" then
            set output = output + (GetPlayerName(Player(PN2)))
            set i = i + 2
          endif
        endif
        if SubString(input,(i+2),(i+3)) == "N" then
          if SubString(input,(i+3),(i+4)) == "1" then
            set output = output + I2S((PN1+1))
            set i = i + 3
          else
            if SubString(input,(i+3),(i+4)) == "2" then
              set output = output + I2S((PN2+1))
              set i = i + 3
            endif
          endif
        endif
        if SubString(input,(i+2),(i+3)) == "C" then
          if SubString(input,(i+3),(i+4)) == "1" then
            set output = output + VK_C(PN1)
            set i = i + 3
          else
            if SubString(input,(i+3),(i+4)) == "2" then
              set output = output + VK_C(PN2)
              set i = i + 3
            endif
          endif
        endif
      endif
    else
      if (SubString(input,i,i+1) == " " or SubString(input,i,i+1) == ".") and b == true then
        set b = false
        set output = output + "|r" + SubString(input,i,i+1)
      else
        set output = output + SubString(input,i,i+1)
      endif
    endif
    set i = i + 1
  endloop
  return output
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
  local integer i = 0
  if GetPlayers() < udg_VK_MP then
    if GetLocalPlayer() == GetTriggerPlayer() then
      call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, VK_M(0,GetPlayerId(GetTriggerPlayer()),-1))
      call StartSound(bj_questHintSound)
    endif
    return
  endif
  loop
    exitwhen i > GetPlayers()
    if StringCase(SubString(GetEventPlayerChatString(), StringLength(VK_CM()) + 1, StringLength(GetEventPlayerChatString())), false) == StringCase(GetPlayerName(Player(i)), false) then
    endif
    set i = i + 1
  endloop
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
  set gg_trg_Untitled_Trigger_001 = CreateTrigger( )
  call TriggerRegisterPlayerChatEvent( gg_trg_Untitled_Trigger_001, Player(0), VK_CM(), false )
  call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction

[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]

"In the end there is no greater motivation than revenge"
SO I HERD U LEIK MUDKIPZ?!
Mr. Zero is offline   Reply With Quote
Old 05-14-2007   #3
 
MrOrange's Avatar
 
Join Date: Dec 2006
Posts: 2,995
MrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond repute
Re: [System] VoteKick

Cool. If only I knew JASS I could complete it for you but even if I did know. I'm guessing it would still be hard to complete it.
MrOrange is offline   Reply With Quote
Old 05-14-2007   #4
 
Mr. Zero's Avatar
 
Join Date: Sep 2006
Location: Denmark (GMT+1)
Posts: 2,173
Mr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond repute
Re: [System] VoteKick

Hehe, do you know what... I never have written a fully working JASS trigger!
Yep that's right. Convert to JASS is nice.

I like GUI but if it just didn't had leaks, bj, unneed function, I would only use GUI.
I just convert it and clean up the leaks, bj's, ect.

[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]

"In the end there is no greater motivation than revenge"
SO I HERD U LEIK MUDKIPZ?!
Mr. Zero is offline   Reply With Quote
Old 05-14-2007   #5
 
MrOrange's Avatar
 
Join Date: Dec 2006
Posts: 2,995
MrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond reputeMrOrange has a reputation beyond repute
Re: [System] VoteKick

So let me get this stright. What you do is make GUI triggers and then convert them and then edit them to get rid of unneeded functions, leaks, et cetera? Ok.
MrOrange is offline   Reply With Quote
Old 05-15-2007   #6
 
Mr. Zero's Avatar
 
Join Date: Sep 2006
Location: Denmark (GMT+1)
Posts: 2,173
Mr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond repute
Re: [System] VoteKick

You could do. Remember if you are using variables, then try and see if you can make them local, just so the user doesn't have to have alot of variables.

[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]

"In the end there is no greater motivation than revenge"
SO I HERD U LEIK MUDKIPZ?!
Mr. Zero is offline   Reply With Quote
Old 06-16-2007   #7
 
Mr. Zero's Avatar
 
Join Date: Sep 2006
Location: Denmark (GMT+1)
Posts: 2,173
Mr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond reputeMr. Zero has a reputation beyond repute
Re: [System] VoteKick

This system is either no longer supported by its creator or unnecessary with current versions of Warcraft, and belongs in the Recycling Bin Forum.

Topic Moved

[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]
[Only registered and activated users can see links. ]

"In the end there is no greater motivation than revenge"
SO I HERD U LEIK MUDKIPZ?!
Mr. Zero is offline   Reply With Quote
Old 06-16-2007   #8
 
King Stubby's Avatar
 
Join Date: Mar 2007
Location: Underground
Posts: 5,879
King Stubby is just really niceKing Stubby is just really niceKing Stubby is just really nice
Re: [System] VoteKick

if you ever finish it, look me up. I might need that on my map to kill retarded people who are attacking their ally's base to ruin the game for everyone or something.

edit: huh, weird. it didn't say that someone already posted right before me!


And now, directly from chip's signature...
King Stubby is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[System] Item Stacking System Mr. Zero Spells and Systems 1 12-01-2007 05:28 PM
[New] shared gold luigi_fan64 New Feature Requests 16 06-23-2007 06:38 PM
[System] String Compare System 0.2 MrApples Spells and Systems 6 06-13-2007 08:15 PM
[System] Leaver & Kick System CaptainSnake Recycling Bin 6 05-14-2007 07:07 PM


All times are GMT -5. The time now is 03:54 PM.

A friend of Wc3Happy
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165