Jump to content

MTA name code?


DJDenz

Recommended Posts

hii!

what is the script for seeing the nickname from another player?

} 
     elseif $3 == !hp {
    mta.say $1 $mta.name($1,$4) $+ 's health is $mta.health($1,%b)
 }  

that is $mta.name($1,$4) and what i see in mta client is this...

"Unknown's health is 0"

why "Unknown"? is it wrong code? what is the good code?

Tnkx

DJDenz

Link to comment

Ok, well a good one would be:

on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2)
 if ($3 == !hp) mta.say $1 $mta.name($1,%a) $+ 's health is $mta.health($1,%a) $+ %
}

Link to comment

tnkx tnkx tnkx but...

for all another name scripts i most do

var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2) 
 if ($3 == !hp) mta.say $1 $mta.name($1,%a)

for !car and !hp and more..

?

tnkx

DJDenz

Link to comment

although this would be better:

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

Jax for your reference, problems with this code:

on *:SIGNAL:mta.command:{ 
 var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2) 
 if ($3 == !hp) mta.say $1 $mta.name($1,%a) $+ 's health is $mta.health($1,%a) $+ % 
} 

1) if you did "!hp -1" it would return unknown still (ie you have no detection for if $mta.getid returns -1 if it finds not matches)

2) if you did "!hp 0" it would return the hp of the person typing !hp, not the person of ID 0

3) use $ini reference instead of $mta.name reference as its quicker... $mta.name is an ini reference.. this just skips out the mta.mrc part of it.

Link to comment
although this would be better:

3) use $ini reference instead of $mta.name reference as its quicker... $mta.name is an ini reference.. this just skips out the mta.mrc part of it.

Uhm.. cutting out the scripting tools is not nice coding. The you'd better write your own dll with sockets to skip entire MTA:mA.. ugly

Link to comment
although this would be better:

3) use $ini reference instead of $mta.name reference as its quicker... $mta.name is an ini reference.. this just skips out the mta.mrc part of it.

Uhm.. cutting out the scripting tools is not nice coding. The you'd better write your own dll with sockets to skip entire MTA:mA.. ugly

Its smarter and quicker my way. As mIRC is so slow, people should appreciate anything they can use to make it quicker.

Link to comment
  • Recently Browsing   0 members

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