Jump to content

MTA:MA Scripting


Harry

Recommended Posts

on *:TEXT:*:%echochan:{
 do.echo $1-
}
on *:INPUT:%echochan:{
 do.echo $1-
}
alias do.echo {
 if ($1 == !players) {
   var %a = 0,%b,%c = %echoserver
   while (%a <= $mta.server(%c).cmax) {
     if ($mta.nick(%c,%a) != Unknown) %b = $iif(%b,%b $+ $chr(44) $mta.nick(%c,%a),$mta.nick(%c,%a))
     !inc %a
   }
   msg %echochan Players: $iif(%b,$v1,None)
 }
}

make sure %echochan is set to your channel and %echoserver is set to your server ID

Ah yes! It works perfectly now.

Lemme kiss you!!!

Link to comment
  • Replies 357
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...
  • 2 weeks later...
  • 1 month later...

Hey im new here, :)

Ive recently set up my vc server, mainly for learning this mIRC language, and I was wondering if anyone can help me with a few simple commands.

I managed to find the following script:

on *:SIGNAL:mta.command: {
 if ($3 = !test) {
   mta.say $1 this is a test message
 }
}

and had some fun editing that :D.

Anyway, I was wondering if anyone could show me a simple !id script or a !hp script?

Thanks a lot,

James

Link to comment

on *:SIGNAL:mta.command: {
 var %a = $iif($4 == $null,$2,$mta.getid($1,$4))
 if ($3 = !test)  mta.say $1 this is a test message
 elseif ($3 == !hp) {
   if (%a == -1) mta.msg $1 $2 Error: Invalid Name/ID
   else mta.say $1 $mta.name($1,%a) $+ 's Health: $mta.health($1,%a) $+ %
 }
 elseif ($3 == !id) {
   if (%a == -1) mta.msg $1 $2 Error: Invalid Name/ID
   else mta.say $1 $mta.name($1,%a) $+ 's ID: %a
 }
} 

there u go.

Also, if ur still interested,

have a read of my post here>>> http://forum.mtavc.com/viewtopic.php?p=250707#250707

Link to comment
on *:SIGNAL:mta.command: {
 var %a = $iif($4 == $null,$2,$mta.getid($1,$4))
 if ($3 = !test)  mta.say $1 this is a test message
 elseif ($3 == !hp) {
   if (%a == -1) mta.msg $1 $2 Error: Invalid Name/ID
   else mta.say $1 $mta.name($1,%a) $+ 's Health: $mta.health($1,%a) $+ %
 }
 elseif ($3 == !id) {
   if (%a == -1) mta.msg $1 $2 Error: Invalid Name/ID
   else mta.say $1 $mta.name($1,%a) $+ 's ID: %a
 }
} 

there u go.

Also, if ur still interested,

have a read of my post here>>> http://forum.mtavc.com/viewtopic.php?p=250707#250707

hey scoob, this is me in yours msn too: Deemon, but, u never answer to me u are afk only.:P:p but hey I need simple !ban script , could you make me 1 or show ?:P:P

like.. !ban -nick- -reason-

ty.

Link to comment

sure:

on *:SIGNAL:mta.command: {
 var %a = $iif($4 == $null,$2,$mta.getid($1,$4))
 if ($3 = !test)  mta.say $1 this is a test message
 elseif ($3 == !hp) {
   if (%a == -1) mta.msg $1 $2 Error: Invalid Name/ID
   else mta.say $1 $mta.name($1,%a) $+ 's Health: $mta.health($1,%a) $+ %
 }
 elseif ($3 == !id) {
   if (%a == -1) mta.msg $1 $2 Error: Invalid Name/ID
   else mta.say $1 $mta.name($1,%a) $+ 's ID: %a
 }
 elseif ($3 == !ban) {
   if ($mta.name($1,$2) == YOUR_NAME) {
     if (%a == -1) mta.msg $1 $2 Error: Invalid Name/ID
     elseif (%a == $2) mta.msg $1 $2 Error: Cannot Ban Self
     else {
       mta.say $1 $mta.name($1,$2) Is Banning $mta.name($1,%a) - Reason: $iif($5 == $null,None,$5-)
       mta.ban $1 %a $5-
     }
   }
   else mta.msg $1 $2 Error: Admin Only.
 }
}

Replace YOUR_NAME, with ur name 8)

this is just basic since i dont know what u have already.

Link to comment

Hey,

Ive just finished making this script, but its not working properly.

For example, whenever I go to sell a car i own, it says "You dont own this vehicle", its probably to do with one of the variables, but ive tried messing around with them a few times and I didnt get anywhere.

As u can probably guess im making a !infocar, !sellcar & !buycar script for vc.

Just wondering if u guys could point me in the right direction :)

on *:SIGNAL:mta.command:{ 

 var %a = $iif($readini(carprices.ini,cars,$mta.vehicle($1,$2)) == null,0,$vl)
 var %b = $iif($readini(cars.ini,cars,$mta.vehicle($1,$2)) == null,0,$vl)
 var %c = $iif($readini(cars.ini,cars,$mta.vehicle($1,$2),$mta.name($1,$2).name) == null,0,$vl)

 if ($3 == !infocar) {
   mta.msg $1 $2 You are driving a $mta.vehicle($1,$2).name $+ , Owner: $readini(cars.ini,cars,$mta.vehicle($1,$2))
 }

 elseif ($3 == !buycar) {

   if (%b == 1) {

     if ($mta.area($1,$2) == Sunshine Autos && $mta.health($1,$2) > 0) {

       if ($mta.cash($1,$2) > %a) {

         writeini -n cars.ini cars $mta.vehicle($1,$2) $mta.name($1,$2).name
         writeini nms.ini Cash $mta.name($1,$2) $calc($mta.cash($1,$2) - %a) 
         mta.msg $1 $2 You just bought car $mta.vehicle($1,$2) $+ , $mta.vehicle($1,$2).name
       }

       else mta.msg $1 $2 You dont have enough cash
     }

     else mta.msg $1 $2 You need to be at Sunshine Autos
   }

   else mta.msg $1 $2 Vehicle already owned
 }


 elseif ($3 == !sellcar) {

   if ($mta.name($1,$2).name == %b) {

     if ($mta.area($1,$2) == Sunshine Autos && $mta.health($1,$2) > 0) {

       remini -n cars.ini cars $mta.vehicle($1,$2) $mta.name($1,$2).name
       writeini nms.ini Cash $mta.name($1,$2) $calc($mta.cash($1,$2) + %a) 
       mta.msg $1 $2 You just sold car $mta.vehicle($1,$2) $+ , $mta.vehicle($1,$2).name
     }

     else mta.msg $1 $2 You need to be at Sunshine Autos
   }

   else  mta.msg $1 $2 You dont own this vehicle
 }

alias mta.cash {  
 !return $iif($readini(nms.ini,Cash,$mta.name($1,$2)) == $null,0,$v1)
}

thanks,

James

Edited by Guest
Link to comment

I managed to get it working (i think) :D

Heres the code if anyones wants it:

on *:SIGNAL:mta.command:{ 

 var %a = $readini(carprices.ini,cars,$mta.vehicle($1,$2))
 var %b = $readini(cars.ini,cars,$mta.vehicle($1,$2))

 if ($3 == !infocar) {
   mta.msg $1 $2 You are driving a $mta.vehicle($1,$2).name $+ , Owner: %b
 }

 elseif ($3 == !buycar) {

   if ($mta.name($1,$2).name != %b) {

     if ($mta.area($1,$2) == Sunshine Autos && $mta.health($1,$2) > 0) {

       if ($mta.cash($1,$2) > %a) {

         writeini -n cars.ini cars $mta.vehicle($1,$2) $mta.name($1,$2).name
         writeini nms.ini Cash $mta.name($1,$2) $calc($mta.cash($1,$2) - %a) 
         mta.msg $1 $2 You just bought car $mta.vehicle($1,$2) $+ , $mta.vehicle($1,$2).name
       }

       else mta.msg $1 $2 You dont have enough cash
     }

     else mta.msg $1 $2 You need to be at Sunshine Autos
   }

   else mta.msg $1 $2 Vehicle already owned
 }


 elseif ($3 == !sellcar) {

   if ($mta.name($1,$2).name == %c) {

     if ($mta.area($1,$2) == Sunshine Autos && $mta.health($1,$2) > 0) {

       remini -n cars.ini cars $mta.vehicle($1,$2) $mta.name($1,$2).name
       writeini nms.ini Cash $mta.name($1,$2) $calc($mta.cash($1,$2) + %a) 
       mta.msg $1 $2 You just sold car $mta.vehicle($1,$2) $+ , $mta.vehicle($1,$2).name
     }

     else mta.msg $1 $2 You need to be at Sunshine Autos
   }

   else  mta.msg $1 $2 You dont own this vehicle
 }

 alias mta.cash {  
   !return $iif($readini(nms.ini,Cash,$mta.name($1,$2)) == $null,0,$v1)
 }

Obviously you'd have to change the ini locations.

Link to comment

ok here is one for you ... a area script?.. for MTA:VC

Watti: !area user
User is in Little havana

and a place script

Watti: !place
PM from admin : Business Dispensary(50) - Not Owned - Price 35000

!place 50
PM from admin Business Dispensary(50) - Not Owned - Price 35000

Link to comment

ahh the motd, u need to upload ur motd somewhere, then edit ur config.

it should look like this in ur config:

# MOTDEnabled

# Required: No

# Purpose: Tells the server whether or not it should send a Message of the Day to the clients when they connect.

MOTDEnabled 0

# MOTDURL

# Required: No

# Purpose: Defines where the client will download the client (Rich Text) MOTD from

# Notes: Must include the initial http://

MOTDURL ""

so just edit this in ur config. also, u should remember, if u have this enabled and for some reason the host of ur motd goes down, noone can join ur server.

so make sure ur host is ok:)

Link to comment
  • 4 weeks later...

Hey can anyone tell me if its possible to add a PHP script into a mIRC script?

thanks

Edit:

Or a MySQL Script? As I was thinking is it possible to update a website as something happened, such as someone bought a car?

thanks

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...