![]() | |
| | #1 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | [System] VoteKick VoteKick Made by Mr. Zero | Version 0.10
Source Code: Not done yet... almost...Update Log: Will be added soon...~Mr. Zero (Locked until post code and map) |
| | |
| | #2 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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 |
| | |
| | #3 |
![]() Join Date: Dec 2006
Posts: 2,995
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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. |
| | |
| | #4 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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. |
| | |
| | #5 |
![]() Join Date: Dec 2006
Posts: 2,995
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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. |
| | |
| | #6 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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. |
| | |
| | #7 |
![]() Join Date: Sep 2006 Location: Denmark (GMT+1)
Posts: 2,173
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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 |
| | |
| | #8 |
![]() Join Date: Mar 2007 Location: Underground
Posts: 5,879
![]() ![]() ![]() | 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... ![]() |
| | |
![]() |
| Thread Tools | |
| |
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 |