Jump to content

MTAMA Scripting


Si|ent

Recommended Posts

ok hmm, people, i need help :x

how would i hide !green !red and !blue from what the admin says, also how would i hide the text above example

{Ns}Opium:!green hello

how would i hide {Ns}Opium:!green hello and ?

if ($3 == !kick) mta.kick $1 $4 
 if ($3 == !ban) mta.ban $1 $4 
 if ($3 == !blue) mta.say $1 áÿ $3-
 if ($3 == !red) mta.say $1 ÿÿ $3-
 if ($3 == !green) mta.say $1 ÿÿ $3-

that is a piece of my admin login script

Link to comment
  • Replies 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You cant. You would have to use /msg instead and script it to only relay from the second word onwards. Or third if you used a password. Which I'd strongly recommend to prevent everyone on the server from discovering and talking via admin :)

Link to comment
  • 2 weeks later...

Sorry, I don't know how old a thread has to be before it's classed as 'old'. :?:

I've had a couple of requests for this, it's a race script I created by butchering several bits from other scripts. It's pretty basic as it only initiates a race and gives participants three minutes to get to the start before it performs a countdown. Obviously, don't expect miracles as it can't tell you who won or anything. I'll leave that for you to battle out amongst yourselves. :lol:

When the guys here release the new MTA and a newer version of Aeron's mIRC tool then maybe it can be improved. :wink:

You need this bit in the mta.text alias:

elseif ($3 == !race) {
     ;
     ; Starts a random race ;
     ;
     if (%race.start. [ $+ [ $1 ] ] == $null) {
         ; Change 22 in the following 2 lines to match the number of destinations in the file
         set %r1 $iif($r(0,22) != 0,$ifmatch,22)
         set %r2 $iif($r(0,22) != 0,$ifmatch,22)
         set %d1 $read(race.txt,%r1)
         set %d2 $read(race.txt,%r2)
         while (%r1 == %r2) || ($abs($calc($right(%d1,1) - $right(%d2,1))) <= 1) {
             ; Change 22 in the following line to match the number of destinations in the file
             set %r2 $iif($r(0,15) != 0,$ifmatch,22)
             set %d2 $read(race.txt,%r2)
         }
         set %race.start. [ $+ [ $1 ] ] $left(%d1,$calc($len(%d1) - 2)) 
         set %race.end. [ $+ [ $1 ] ] $left(%d2,$calc($len(%d2) - 2))
         set %race.user. [ $+ [ $1 ] ] $2
         unset %r
         unset %r2
         unset %d1
         unset %d2
         mta.say $1 !race - Race from %race.start. [ $+ [ $1 ] ] to %race.end. [ $+ [ $1 ] ] . You have THREE minutes to get to the start
         .timerrac1 [ $+ [ $1 ] ] 1 30 mta.say $1 !race - Countdown will start in 150 seconds at ( %race.start. [ $+ [ $1 ] ] ) 
         .timerrac2 [ $+ [ $1 ] ] 1 60 mta.say $1 !race - Countdown will start in 120 seconds at ( %race.start. [ $+ [ $1 ] ] )
         .timerrac3 [ $+ [ $1 ] ] 1 90 mta.say $1 !race - Countdown will start in 90 seconds at ( %race.start. [ $+ [ $1 ] ] )
         .timerrac4 [ $+ [ $1 ] ] 1 120 mta.say $1 !race - Countdown will start in 60 seconds at ( %race.start. [ $+ [ $1 ] ] )
         .timerrac5 [ $+ [ $1 ] ] 1 150 mta.say $1 !race - Countdown will start in 30 seconds at ( %race.start. [ $+ [ $1 ] ] ) 
         .timerrac6 [ $+ [ $1 ] ] 1 160 mta.say $1 !race - Countdown will start in 20 seconds at ( %race.start. [ $+ [ $1 ] ] ) 
         .timerrac7 [ $+ [ $1 ] ] 1 170 mta.say $1 !race - Countdown will start in 10 seconds at ( %race.start. [ $+ [ $1 ] ] ) 
         .timerrace [ $+ [ $1 ] ] 1 180 mta.race $1  
     }
     else {
         mta.say $1 !race - Another race is currently in progress. Get to the start ( %race.start. [ $+ [ $1 ] ] ) quick!
     }
 }
 elseif ($3 == !racecan) {
     ;
     ; Cancels the random race
     ;
     if (%race.user. [ $+ [ $1 ] ] != $null) {
         if (%race.user. [ $+ [ $1 ] ] == $2) {
             .timerrac1 [ $+ [ $1 ] ] off
             .timerrac2 [ $+ [ $1 ] ] off
             .timerrac3 [ $+ [ $1 ] ] off
             .timerrac4 [ $+ [ $1 ] ] off
             .timerrac5 [ $+ [ $1 ] ] off
             .timerrac6 [ $+ [ $1 ] ] off
             .timerrac7 [ $+ [ $1 ] ] off
             .timerrace [ $+ [ $1 ] ] off
             unset %race.start. [ $+ [ $1 ] ]
             unset %race.end. [ $+ [ $1 ] ]
             unset %race.user. [ $+ [ $1 ] ]
             mta.say $1 !racecan - Race cancelled!
         }
         else {
             mta.say $1 !racecan - Race can only be cancelled by $mta.name($1,%race.user. [ $+ [ $1 ] ])
         }
     }
     else {
         mta.say $1 !racecan - No race is currently running!
     }
 }

and this bit as a separate alias:

alias mta.race {
   ;
   ; Starts the race
   ;
   mta.say $1 !race - Start: %race.start. [ $+ [ $1 ] ] End: %race.end. [ $+ [ $1 ] ] COUNTDOWN!
   .timer 1 1 mta.say $1 <5>
   .timer 1 2 mta.say $1 <4>
   .timer 1 3 mta.say $1 <3>
   .timer 1 4 mta.say $1 <2>
   .timer 1 5 mta.say $1 <1>
   .timer 1 6 mta.say $1 
   unset %race.start. [ $+ [ $1 ] ]
   unset %race.end. [ $+ [ $1 ] ]
   unset %race.user. [ $+ [ $1 ] ]

}

You will also need a text file in the mIRC directory called race.txt which lists destinations, the number represents the area on the map. The above script tries not to get locations too close together. Make sure the number is the last character on each line. Here's my example:

Docks (West Island) 1
Sunshine Autos 1
Airport 1
Army Base 2
Cherry Poppers 2
Kaufman Cabs 2
Scrapyard 2
Phil's Place 2
Moist Palms Hotel 3
Stadium 3
Ammunation (West Island) 3
Lovefist Studio 3
Porn Studio 4
North Point Mall 5
Malibu Club (Roof) 5
Malibu Club 5
Vercetti Mansion 6
Golfcourse 6
Ammunation (East Island) 7
Pole Position 7
Lighthouse 7
Ocean View Hotel 7

You also need to change the numbers in the !race section above (the 22s) so they match the number of destinations in the file. Someone like Aeron can probably advise of a function to count all the lines in a file as I suck at mIRC scripting (I've been doing it for 1 week). :lol:

There is a million things that could be done to it now I'm more familiar with mIRC. More destinations added, all those timers replaced with one and probably put in an ini file. I just can't be bothered to change it at the moment - it works for me!

Link to comment

This bit:

while (%r1 == %r2) || ($abs($calc($right(%d1,1) - $right(%d2,1))) <= 1) { 
 ; Change 22 in the following line to match the number of destinations in the file 
 set %r2 $iif($r(0,15) != 0,$ifmatch,22) 
 set %d2 $read(race.txt,%r2) 
} 

Should be: -

while (%r1 == %r2) || ($abs($calc($right(%d1,1) - $right(%d2,1))) <= 1) { 
 ; Change 22 in the following line to match the number of destinations in the file 
 set %r2 $iif($r(0,22) != 0,$ifmatch,22) 
 set %d2 $read(race.txt,%r2) 
} 

Note the 22 changed from 15. See above for details.

Link to comment

The main problem with your race script is people wont know where half the checkpoints are. nor will the script know when to cal the next etc.

Really its only realistic to provide a basic !countdown and allow players themselves to organise the start position and the route etc. Cooperation peeps.

Link to comment

i thought this would be eloborate :D

alias mta.kill {
mta.say $1 No killing on this server!
mta.kick $1 $3

for the stunt servers, that many admins say no killing, but people do it anyway...here u go...lol....almost not even worth posting, lol, also correct me if im wrong, im know for sloppy mIRC scripting :P

Link to comment

Anyone can call the next race by typing !race, I know this could mean one is in progress while the second is called but those racing are too busy to notice. :lol:

And there's only a few locations I've found that people are not too familiar with, scrapyard for instance.

It's been heavily used on my server and it saves people going "Where from?" "Where to?" "Wait for me!" etc. It takes all the pain out of it... :lol:

I only posted it because a few people asked for it and I've nowhere to host it. :cry:

Link to comment

-i'm looking for some more scripts for my server someone pls hlp :D

something like capture the flag and i'm sure there lots more out there.

-and i'm also lookin for a code so i can look up the stats fro any player in the server. i have the normal stats script but i only does me

Link to comment

stats script i made for my server to get stats from a player (by typing id) (note: aerons script is better)

elseif ($3 == !stats) {

if ($4 == $null) mta.say $1 =[Nickname: $mta.name($1,$2) ]= =[iD: $2]= =[Kills: $mta.kills($1,$2) ]= =[Deaths: $mta.deaths($1,$2) ]= =[Ping: $mta.ping($1,$2) ]=

else {

mta.say $1 =[Nickname: $mta.name($1,$4) ]= =[iD: $4]= =[Kills: $mta.kills($1,$4) ]= =[Deaths: $mta.deaths($1,$4) ]= =[Ping: $mta.ping($1,$4) ]=

}

and for ctw: it isn't possible (yet?) cause the admin can't read player coordinates or player cars

Link to comment

Well im a complete n00b and don't have a single CLUE how to write one of those. I was wondering instead of kicking the person can you make a script were it replaces the word you don't like with something like *****.

Link to comment

here is a stats code that simply combines the best of the 2 available stat posters:

elseif ($3 == !stats) { 
if ($4 == $null) mta.say $1 =[Nickname: $mta.name($1,$2) ]= =[iD: $2]= =[Kills: 

$mta.kills($1,$2) ]= =[Deaths: $mta.deaths($1,$2) ]= =[Ping: $mta.ping($1,$2) ]= 
else { 
mta.say $1 =[Nickname: $mta.name($1,$4) ]= =[iD: $4]= =[Kills: $mta.kills($1,$4) ]= 

=[Deaths: $mta.deaths($1,$4) ]= =[Ping: $mta.ping($1,$4) ]= =[Online: 

$duration($mta.online($1,$4)) ]= =[status: $iif($mta.game($1,$4) == 1,Out Game,In Game) ]=
}
}

also, this one is for anybody who can help.......i want to make a script that allows me to kick players from ingame (actually playing myself) by typing !kick , but i want to code it so that it ONLY works if i say it......can you help me?

Link to comment
alias mta.pm { 
if ($3- == admin ) { 
 mta.say $1 Admin rights given to $mta.name($1-2) 
 writeini $+(",$scriptdir,$1.ini") ID $+ $2 op 1 
} 
} 
alias mta.text { 
if ($readini($scriptdir $+ $1.ini,ID $+ $2,op)) { 
 if ($3 == !kick) mta.kick $1 $4 
 if ($3 == !ban) mta.ban $1 $4 

} 
} 

This is a sort of 'admin' script.

1. Replace with the password you want.

2. Join you server.

3. Type "/msg admin "

4. If the password is correct you see the msg: "Admin rights given to "

5. Now you can run the commands that are between the brackets. like "!kick " or "!ban " Normal user who didn't login can't do this

script by aeron, just attempt harder next time :wink:

Link to comment

hey thanks, i appreciate your help. Sometimes its hard to catch all of the details when you've already put in an 11 hr day and its around midnight ;-)

Link to comment

for some reason it isnt working for me...............i obviously have to add each different section under its appropriate action, is there anything else special about the coding that i should be aware of?

Link to comment

heres what i ahve under my mta.pm......

;START ADMIN KICKBAN

if ($3- == admin password) { 
 mta.say $1 Admin rights given to $mta.name($1-2) 
 writeini $+(",$scriptdir,$1.ini") ID $+ $2 op 1 
} 
}

;END ADMIN KICKBAN

and my mta.text:

;START ADMIN KICKBAN


elseif ($readini($scriptdir $+ $1.ini,ID $+ $2,op)) { 
 if ($3 == !kick) mta.kick $1 $4 
 if ($3 == !ban) mta.ban $1 $4 

} 
}


;END ADMIN KICKBAN

tried using elseif since others are above it

Link to comment

umm...yea....

alias mta.text
elseif ($readini($scriptdir $+ $1.ini,ID $+ $2,op)) { 
 if ($3 == !kick) mta.kick $1 $4 
 if ($3 == !ban) mta.ban $1 $4 

} 
alias mta.pm
if ($3- == admin password) { 
 mta.say $1 Admin rights given to $mta.name($1-2) 
 writeini $+(",$scriptdir,$1.ini") ID $+ $2 op 1 
} 
} 

you need to include alisas' as well :wink:

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

    • No registered users viewing this page.

×
×
  • Create New...