Jump to content

MTAMA Scripting


Si|ent

Recommended Posts

  • Replies 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

HI,

- checkping: not connected to server

what this is ????????

Why this not working ??

alias checkpings {

set %temp.i 0

while (%temp.i < 26) {

set %temp.ping $mta.ping(1, %temp.i)

if ( (%temp.ping > 1000) || (%temp.ping < 0) ) { halt }

if (%temp.ping != $null) {

inc %loop. [ $+ [ %temp.i ] ] 1

if (%loop. [ $+ [ %temp.i ] ] > 12) {

set %loop. [ $+ [ %temp.i ] ] 1

}

set %ping. [ $+ [ %temp.i ] $+ . $+ [ %loop. [ $+ [ %temp.i ] ] ] ] %temp.ping

if (%ping. [ $+ [ %temp.i ] $+ . $+ ] 12 != $null) {

set %temp.j 1

set %temp.average 0

while (%temp.j <= 12) {

inc %temp.average %ping. [ $+ [ %temp.i ] $+ . $+ [ %temp.j ] ]

inc %temp.j 1

}

set %temp.average $calc(%temp.average / 12)

set %average. [ $+ [ %temp.i ] ] %temp.average

if (%temp.average >= %max) {

/mta.say 1 Kicking $mta.name(1, %temp.i) for having average ping over %max

/mta.kick 1 %temp.i

}

}

}

inc %temp.i 1

}

unset %temp.*

}

alias mta.start {

timerping 0 10 checkpings

}

alias mta.join {

unset %ping. [ $+ [ $2 ] $+ ] *

set %loop. [ $+ [ $2 ] ] 0

}

Can you help me AERON ????

Link to comment
Aeron ??

Why if i have this:

/set %life. [ $+ [ $2 ] ] $ctime

}

or this:

unset %ping. [ $+ [ $2 ] $+ ] *

set %loop. [ $+ [ $2 ] ] 0

}

in alias mta.join , doesn't work all scripts in alias mta.text ?? :?:

Just a part for the script to function rite and get no error for unexisting players.

Link to comment
WHO want how make script !stats, but !stats ??

  if (!stat* iswm $3) {
   if ($4 isnum) mta.say $1 Name: $mta.name($1,$4) - ID: $4 - Ping: $mta.ping($1,$4) - Kills: $mta.kills($1,$4) - Deaths: $mta.deaths($1,$4) - Online: $duration($mta.online($1,$4)) - Status: $iif($mta.status($1,$4) == 1,Out Game,In Game)
   else mta.say $1 Name: $mta.name($1,$2) - ID: $2 - Ping: $mta.ping($1,$2) - Kills: $mta.kills($1,$2) - Deaths: $mta.deaths($1,$2) - Online: $duration($mta.online($1,$2)) - Status: $iif($mta.status($1,$2) == 1,Out Game,In Game)
 }

Is there already somebody who spend some time in an !alias script :?:

What does is supposed to do?

Link to comment

hey thx aeron it works but the timer isn't doing anything, i can't get it to stop by itself, so now when i test it everytime i activate a votekick it continues to run, can u see anything else wrong with this??

if ($3 == !votekick) {
  %vote.percentage = 50
   if (%vote.nick. [ $+ [ $1 ] ] == $null) {
     if ($ini($+(".$scriptdir,$1,.ini,"),ID $+ $4)) {
       set %vote.nick. [ $+ [ $1 ] ] $4
       set %vote.voters. [ $+ [ $1 ] ] $null
       mta.say $1 Votekick "!vote" if u want that $mta.name($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.say $1 Give up an exisiting ID-number: "!votekick <#ID">
   }
   else mta.say $1 Another votekick is running: $mta.name($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.say $1 $numtok(%vote.voters. [ $+ $1 ] ],32 votes for $mta.name($1,%vote.nick. [ $+ [ $1 ] ])
     if ($calc($numtok(%vote.voters. [ $+ [$1 ] ],32) / $mta.players($1) *100)  >= %vote.percentage) {
       mta.say $1 $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) $numtok(%vote.voters. [ $+ [ $! ] ],32 votes ur out!
       mta.kick $1 %vote.nick. [ $+ [ $1 ] ]
       unset %vote.nick. [ $+ [ $1 ] ]
       unset %vote.voters. [ $+ [ $1 ] ]
       .timervote [ $+ [ $1 ] ] on
     }
   }
   else mta.say $1 $mta.name($1,$2) You have already voted
 }
}
alias mta.vote {
 mta.say $1 Vote kick cancelled: $mta.name($1,%vote.nick. [ $+ [ $1 ] ])
 unset %vote.nick. [ $+ $1 ] ]
 unset %vote.voters. [ $+ [ $1 ] ]
}

Link to comment
what i want it to do is if noone votes in say 5mins it would stop itself that way

if the server is busy u won't have multiple votekicks running at the same time

-------------------------------

alias mta.text {

if ($3 == !votekick) {

%vote.percentage = 50

if (%vote.nick. [ $+ [ $1 ] ] == $null) {

if ($ini($+(".$scriptdir,$1,.ini,"),ID $+ $4)) {

set %vote.nick. [ $+ [ $1 ] ] $4

set %vote.voters. [ $+ [ $1 ] ] $null

mta.say $1 Votekick "!vote" if u want that $mta.name($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.say $1 Give up an exisiting ID-number: "!votekick <#ID">

}

else mta.say $1 Another votekick is running: $mta.name($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.say $1 $numtok(%vote.voters. [ $+ $1 ] ],32 votes for $mta.name($1,%vote.nick. [ $+ [ $1 ] ])

if ($calc($numtok(%vote.voters. [ $+ [$1 ] ],32) / $mta.players($1) *100) >= %vote.percentage) {

mta.say $1 $mta.name($1,%vote.nick. [ $+ [ $1 ] ]) $numtok(%vote.voters. [ $+ [ $! ] ],32 votes ur out!

mta.kick $1 %vote.nick. [ $+ [ $1 ] ]

unset %vote.nick. [ $+ [ $1 ] ]

unset %vote.voters. [ $+ [ $1 ] ]

.timervote [ $+ [ $1 ] ] on

}

}

else mta.say $1 $mta.name($1,$2) You have already voted

}

}

alias mta.vote {

mta.say $1 Vote kick cancelled: $mta.name($1,%vote.nick. [ $+ [ $1 ] ])

unset %vote.nick. [ $+ $1 ] ]

unset %vote.voters. [ $+ [ $1 ] ]

}

-------------------

THe script parts in bold should start/stop the timer

It had to check all the names that once logged in on the same IP... my english isn't that good so i hope you understand it :?:?: . If you don't i can explane it in dutch

:wink:

alias mta.join {
 var %a = 1
 while (%a <= $mta.maxplayers($1)) {
   if ($ini($scriptdir $+ $1.ini,ID $+ %a)) {
     if (($mta.ip($1,%a) == $mta.ip($1,$2)) && (%a != $2)) {
       mta.say $1 $mta.name($1,$2) Reason: Clone
       mta.kick $1 $2
     }
   }
   inc %a
 }
}

Link to comment

Aeron ik bedoel:

Stel ik ben een keer op me server ingelogd als Vincent. Dan disconnect ik kom ik terug als Test.

Nou wil ik dus dat als ik als admin {dbc}montana !alias vincent doe dat ik iets zie als: Vincent aka Test, etc, etc...

You think this is possible :wink::?:

Link to comment
Aeron ik bedoel:

Stel ik ben een keer op me server ingelogd als Vincent. Dan disconnect ik kom ik terug als Test.

Nou wil ik dus dat als ik als admin {dbc}montana !alias vincent doe dat ik iets zie als: Vincent aka Test, etc, etc...

You think this is possible :wink::?:

I just have one thing to say: have about a week (hopefully :roll:) patience :wink:

Link to comment
Thenks Aeron !

I have 1 question hehe again. How make !stats with total kills and total deaths --> mta.name - kills - deaths - Total kills - total death ??

Ask [FMJ]Oli because he has such script...

Aeron ik bedoel:

Stel ik ben een keer op me server ingelogd als Vincent. Dan disconnect ik kom ik terug als Test.

Nou wil ik dus dat als ik als admin {dbc}montana !alias vincent doe dat ik iets zie als: Vincent aka Test, etc, etc...

You think this is possible :wink::?:

alias mta.join {
 var %a = $read(ips.txt,w,$mta.ip($1-2) *)
 if (%a != $null) {
   var %a = $gettok(%a,2,32)
   if ($mta.name($1-2) != %a) {
     mta.say $1 $mta.name($1-2) is %a
   }
 }
 else !write ips.txt $mta.ip($1-2) $mta.name($1-2)
}

Link to comment

Thnx Aeron,

But a few more questions $mta.name($1-2) = Unknown? When i change it into $mta.name($1,$2) it works. But then it only writes down one name behind the ip. So i can never check all the names the player on that IP ever used?

U think this is possible or am i to (lastig) don't know how to say in english :oops:

Thnx anyway

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...