Jump to content

Can Someone make a working !Votekick for MTA: SA


HouseMD

Recommended Posts

O rly?

http://forum.mtavc.com/viewtopic.php?t= ... t=votekick - MTA SA/ Same buggy script

http://forum.mtavc.com/viewtopic.php?t= ... t=votekick - A buggy script with no "!Yes" and "!no"

http://forum.mtavc.com/viewtopic.php?t= ... t=votekick - MTA VC / the second script doesn't work on SA

http://forum.mtavc.com/viewtopic.php?t= ... t=votekick - MTA VC

Stop telling me i haven't used the search button properly, Because these were the first ones i looked at.

Someone ready now?

Link to comment

to make a mta:vc script work for sa you only need to change mta.say to mta.text, mta.msg to mta.pm and $mta.name to $mta.nick

and well, on this forum i've seen only scripts with !votekick, !vote.. no !yes or !no. Of course i can write that, but i'm bored of people not doing anything themselves. You could at least show that you tried to do something..

Link to comment

-_-

I asked someone to make one with !yes and !no because i've seen a working one on a server...

Edit: btw, I made lots of stuff on my script, even though I didn't know anything...I still don't understand why $4- is needed, and why there is a %vote.voters ?!?!?!

I think i would be able to make it if i understood the script better

Link to comment
to make a mta:vc script work for sa you only need to change mta.say to mta.text, mta.msg to mta.pm and $mta.name to $mta.nick

I tried that:

alias mta.command {
;Parameters: $1 = Server, $2 = ID, $3- = Text
if ($3 == !votekick) {
if (%vote.nick. [ $+ [ $1 ] ] == $null) {
if ($ini($+(",$scriptdir,$1,.ini,"),ID $+ $4)) {
set %vote.nick. [ $+ [ $1 ] ] $4
set %vote.voters. [ $+ [ $1 ] ] $null
mta.text $1 Votekick "!vote" if u want that $mta.nick($1,$4) shall be kicked. [ $calc($left($did(mta,$1 $+ 21),2) / 2) votes needed][30 sec]
.timervote [ $+ [ $1 ] ] 1 30 mta.vote $1
}
else mta.text $1 Give up an existing ID-number: "!votekick <#ID">
}
else mta.text $1 Another votekick is running: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
}
if (($3 == !vote) && (%vote.nick. [ $+ [ $1 ] ] != $null)) {
if ($2 !isin %vote.voters. [ $+ [ $1 ] ]) {
%vote.voters. [ $+ [ $1 ] ] = %vote.voters. [ $+ [ $1 ] ] $2
mta.text $1 $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes for $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
if ($numtok(%vote.voters. [ $+ [ $1 ] ],32) >= $calc($left($did(mta,$1 $+ 21),2) / 2)) {
mta.text $1 $mta.nick($1,%vote.nick. [ $+ [ $1 ] ]) $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes ur out!
mta.kick $1 %vote.nick. [ $+ [ $1 ] ]
unset %vote.nick. [ $+ [ $1 ] ]
unset %vote.voters. [ $+ [ $1 ] ]
.timervote [ $+ [ $1 ] ] off
}
}
else mta.text $1 $mta.nick($1,$2) You have already voted
}

}
alias mta.vote {
mta.text $1 Vote kick cancelled: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
unset %vote.nick. [ $+ [ $1 ] ]
unset %vote.voters. [ $+ [ $1 ] ]

}

It does absolutelly nothing, whats wrong with it?

Edit: when i changed alias mta.command { to on *:SIGNAL:mta.command:{ i get this:

[17:21] [RevC]TB: !votekick ice

[17:21] Give up an existing ID-number: "!votekick <#ID">

Need help ^^

Link to comment

eheh that code must be really old

on *:SIGNAL:mta.command:{
 if ($3 == !votekick) {
   if (%vote.nick. [ $+ [ $1 ] ] == $null) {
     if ($ini($mta.dir $+ $1.ini,ID $+ $4)) {
       set %vote.nick. [ $+ [ $1 ] ] $4
       set %vote.voters. [ $+ [ $1 ] ] $null
       mta.text $1 Votekick "!vote" if u want that $mta.nick($1,$4) shall be kicked. [ $calc($left($did(mta,$1 $+ 21),2) / 2) votes needed][30 sec]
       .timervote [ $+ [ $1 ] ] 1 30 mta.vote $1
     }
     else mta.text $1 Give up an existing ID-number: "!votekick <#ID">
   }
   else mta.text $1 Another votekick is running: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
 }
 elseif (($3 == !vote) && (%vote.nick. [ $+ [ $1 ] ] != $null)) {
   if ($2 !isin %vote.voters. [ $+ [ $1 ] ]) {
     %vote.voters. [ $+ [ $1 ] ] = %vote.voters. [ $+ [ $1 ] ] $2
     mta.text $1 $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes for $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
     if ($numtok(%vote.voters. [ $+ [ $1 ] ],32) >= $calc($left($did(mta,$1 $+ 21),2) / 2)) {
       mta.text $1 $mta.nick($1,%vote.nick. [ $+ [ $1 ] ]) $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes ur out!
       mta.kick $1 %vote.nick. [ $+ [ $1 ] ]
       unset %vote.nick. [ $+ [ $1 ] ]
       unset %vote.voters. [ $+ [ $1 ] ]
       .timervote [ $+ [ $1 ] ] off
     }
   }
   else mta.text $1 $mta.nick($1,$2) You have already voted
 }
}
alias mta.vote {
 mta.text $1 Vote kick cancelled: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
 unset %vote.nick. [ $+ [ $1 ] ]
 unset %vote.voters. [ $+ [ $1 ] ]
}

Edited by Guest
Link to comment

Still same.

You mean 1.ini?

[7]
Level=3
Nicks=1
IP=xxx.xxx.xxx.xxx
Nick1=[RevC]W33Man
Ping=21
Time=17757984
Deaths=31
Rank=14
Idle=18162484
Finish=1
[5]
Level=0
Nicks=1
IP=xxx.xxx.xxx.xxx
Nick1={UnEsT}M2FFi2
Ping=28
Time=18157734
Deaths=11
Rank=1
Finish=1
Idle=17675062

Link to comment
on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.nick($1,$4),$4,$mta.getid($1,$4)),$2)
 if ($3 == !votekick) {
   if (%vote.nick. [ $+ [ $1 ] ]) mta.pm $1 $2 Another votekick is running: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
   elseif (%a == -1) mta.pm $1 $2 Error - Absent ID/Name
   else {
     set %vote.nick. [ $+ [ $1 ] ] %a
     unset %vote.voters. [ $+ [ $1 ] ]
     mta.text $1 Votekick "!vote" if u want that $mta.nick($1,%a) shall be kicked. [ $round($calc($mta.server($1).players / 2),0) votes needed][30 sec]
     .timervote [ $+ [ $1 ] ] 1 30 mta.vote $1
   }
 }
 elseif ($3 == !vote) {
   if (!%vote.nick. [ $+ [ $1 ] ]) mta.pm $1 $2 No votekick is currently running.
   elseif ($2 isin %vote.voters. [ $+ [ $1 ] ]) mta.pm $1 $2 $mta.nick($1,$2) $+ , You have already voted.
   else {
     set %vote.voters. [ $+ [ $1 ] ] %vote.voters. [ $+ [ $1 ] ] $2
     mta.text $1 $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes for $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
     if ($numtok(%vote.voters. [ $+ [ $1 ] ],32) >= $round($calc($mta.server($1).players / 2),0)) {
       mta.text $1 $mta.nick($1,%vote.nick. [ $+ [ $1 ] ]) $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes, you're out!
       mta.kick $1 %vote.nick. [ $+ [ $1 ] ]
       unset %vote.nick. [ $+ [ $1 ] ]
       unset %vote.voters. [ $+ [ $1 ] ]
       .timervote [ $+ [ $1 ] ] off
     }
   }
 }
}
alias mta.vote {
 mta.text $1 Vote kick cancelled: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
 unset %vote.nick. [ $+ [ $1 ] ]
 unset %vote.voters. [ $+ [ $1 ] ]
}

Link to comment
on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.nick($1,$4),$4,$mta.getid($1,$4)),$2)
 if ($3 == !votekick) {
   if (%vote.nick. [ $+ [ $1 ] ]) mta.pm $1 $2 Another votekick is running: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
   elseif (%a == -1) mta.pm $1 $2 Error - Absent ID/Name
   else {
     set %vote.nick. [ $+ [ $1 ] ] %a
     unset %vote.voters. [ $+ [ $1 ] ]
     mta.text $1 Votekick "!vote" if u want that $mta.nick($1,%a) shall be kicked. [ $round($calc($mta.server($1).players / 2),0) votes needed][30 sec]
     .timervote [ $+ [ $1 ] ] 1 30 mta.vote $1
   }
 }
 elseif ($3 == !vote) {
   if (!%vote.nick. [ $+ [ $1 ] ]) mta.pm $1 $2 No votekick is currently running.
   elseif ($2 isin %vote.voters. [ $+ [ $1 ] ]) mta.pm $1 $2 $mta.nick($1,$2) $+ , You have already voted.
   else {
     set %vote.voters. [ $+ [ $1 ] ] %vote.voters. [ $+ [ $1 ] ] $2
     mta.text $1 $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes for $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
     if ($numtok(%vote.voters. [ $+ [ $1 ] ],32) >= $round($calc($mta.server($1).players / 2),0)) {
       mta.text $1 $mta.nick($1,%vote.nick. [ $+ [ $1 ] ]) $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes, you're out!
       mta.kick $1 %vote.nick. [ $+ [ $1 ] ]
       unset %vote.nick. [ $+ [ $1 ] ]
       unset %vote.voters. [ $+ [ $1 ] ]
       .timervote [ $+ [ $1 ] ] off
     }
   }
 }
}
alias mta.vote {
 mta.text $1 Vote kick cancelled: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
 unset %vote.nick. [ $+ [ $1 ] ]
 unset %vote.voters. [ $+ [ $1 ] ]
}

I see bugs for u to fix :twisted:

Link to comment

From what i can see, theres a few bugs in the script.

In SA, mta.getid doesnt return -1 for unknown, it returns $null.

Theres a few other bugs in there too, /me slaps lil_toady.

it should still kinda work. Id Fix it, but its toadys script, i'll let him sort u out :)

Link to comment

Well, im not scripting much for SA, only to help ppl on this forum with scripting. :roll: It differs a bit from 0.5. But i still blame Aeron for all my mistakes

on *:SIGNAL:mta.command:{
 var %a = $iif($iif($4,$iif($mta.nick($1,$4),$4,$mta.getid($1,$4)),$2),$v1,-1)
 if ($3 == !votekick) {
   if (%vote.nick. [ $+ [ $1 ] ]) mta.pm $1 $2 Another votekick is running: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
   elseif (%a == -1) mta.pm $1 $2 Error - Absent ID/Name
   elseif (%a == $2) mta.pm $1 $2 Error - Can't votekick yourself
   else {
     set %vote.nick. [ $+ [ $1 ] ] %a
     unset %vote.voters. [ $+ [ $1 ] ]
     mta.text $1 Votekick "!vote" if u want that $mta.nick($1,%a) shall be kicked. [ $round($calc($mta.server($1).players / 2),0) votes needed][30 sec]
     .timervote [ $+ [ $1 ] ] 1 30 mta.vote $1
   }
 }
 elseif ($3 == !vote) {
   if ((%vote.nick. [ $+ [ $1 ] ] != $null) || (%vote.nick. [ $+ [ $1 ] ] !isnum)) mta.pm $1 $2 No votekick is currently running.
   elseif ($2 isin %vote.voters. [ $+ [ $1 ] ]) mta.pm $1 $2 $mta.nick($1,$2) $+ , You have already voted.
   else {
     set %vote.voters. [ $+ [ $1 ] ] %vote.voters. [ $+ [ $1 ] ] $2
     mta.text $1 $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes for $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
     if ($numtok(%vote.voters. [ $+ [ $1 ] ],32) >= $round($calc($mta.server($1).players / 2),0)) {
       mta.text $1 $mta.nick($1,%vote.nick. [ $+ [ $1 ] ]) $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes, you're out!
       mta.kick $1 %vote.nick. [ $+ [ $1 ] ]
       unset %vote.nick. [ $+ [ $1 ] ]
       unset %vote.voters. [ $+ [ $1 ] ]
       .timervote [ $+ [ $1 ] ] off
     }
   }
 }
}

Link to comment

Hmm that didnt do anything i think.

[21:08] [RevC]puuks: !votekick johan
[21:08] * Admin say's to [RevC]puuks: Another votekick is running: Scient
[21:08] [RevC]puuks: !vote
[21:08] * Admin say's to [RevC]puuks: No votekick is currently running.

I restarted script, server and everything i can restart and it still says the votekick to kick Scient is running :D

Link to comment

GRR

on *:SIGNAL:mta.command:{
 var %a = $iif($iif($4,$iif($mta.nick($1,$4),$4,$mta.getid($1,$4)),$2),$v1,-1)
 if ($3 == !votekick) {
   if (%vote.nick. [ $+ [ $1 ] ] != $null) mta.pm $1 $2 Another votekick is running: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
   elseif (%a == -1) mta.pm $1 $2 Error - Absent ID/Name
   elseif (%a == $2) mta.pm $1 $2 Error - Can't votekick yourself
   else {
     set %vote.nick. [ $+ [ $1 ] ] %a
     unset %vote.voters. [ $+ [ $1 ] ]
     mta.text $1 Votekick "!vote" if u want that $mta.nick($1,%a) shall be kicked. [ $round($calc($mta.server($1).players / 2),0) votes needed][30 sec]
     .timervote [ $+ [ $1 ] ] 1 30 mta.vote $1
   }
 }
 elseif ($3 == !vote) {
   if ((%vote.nick. [ $+ [ $1 ] ] == $null) || (%vote.nick. [ $+ [ $1 ] ] !isnum)) mta.pm $1 $2 No votekick is currently running.
   elseif ($2 isin %vote.voters. [ $+ [ $1 ] ]) mta.pm $1 $2 $mta.nick($1,$2) $+ , You have already voted.
   else {
     set %vote.voters. [ $+ [ $1 ] ] %vote.voters. [ $+ [ $1 ] ] $2
     mta.text $1 $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes for $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
     if ($numtok(%vote.voters. [ $+ [ $1 ] ],32) >= $round($calc($mta.server($1).players / 2),0)) {
       mta.text $1 $mta.nick($1,%vote.nick. [ $+ [ $1 ] ]) $numtok(%vote.voters. [ $+ [ $1 ] ],32) votes, you're out!
       mta.kick $1 %vote.nick. [ $+ [ $1 ] ]
       unset %vote.nick. [ $+ [ $1 ] ]
       unset %vote.voters. [ $+ [ $1 ] ]
       .timervote [ $+ [ $1 ] ] off
     }
   }
 }
}
alias mta.vote {
 mta.text $1 Vote kick cancelled: $mta.nick($1,%vote.nick. [ $+ [ $1 ] ])
 unset %vote.nick. [ $+ [ $1 ] ]
 unset %vote.voters. [ $+ [ $1 ] ]
}

Link to comment

It works fine now :P

Thx again man.

Edit:

[22:22] Someone: !votekick Alo(EST)

[22:22] Votekick "!vote" if u want that Alo(EST) shall be kicked. [ 3 votes needed][60 sec]

[22:22] * Kitlers_LV parted. (87.110.106.237) <<<<< Is it because of this?

[22:22] Someone: !vote

[22:22] 1 votes for Alo(EST)

[22:22] Scient: !vote

[22:22] 2 votes for Alo(EST)

[22:22] Alo(EST) 2 votes, you're out!

[22:22] * Alo(EST) kicked. (88.196.154.182)

If so then let it be

Link to comment

I still see a bug :lol:

Oh, and u should add a line on mta.part to end the votekick.

Do u think just 50% of the votes is a good idea :?

If ur happy playing in a server all alone, checking out some nice new maps, just chilling around and some random person joins, !votekick and ur gonna be out. :shock:

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...