Jump to content

Identifiers


LeetCraig

Recommended Posts

Well, I know they are probably the simplest thing in mIRC coding, but I don't understand them. I don't know why but I just don't. I've been learning mIRC lately and looking around at tutorials and such so I can stop asking for scripts and start making them, and I never really understood identifiers. Could someone please explain to me what exactly they are used for in MTA:mA server coding (ex. what does $1 mean, what does $2 mean, etc...)

Thanks...

P.S; Can someone direct me to the thread with the negative money !give error fix? I found it once and I've been searching lately and haven't been able to find it.

Link to comment

Identifiers refer to specific information, depending on there name and context. For example the $time identifier is replaced with the current time.

In Commands the $1 identifier refers to the first parameter (word) that you specify. $2 refers to the second, $1- refers to all, $2- to all but the first.

For example if you had a command /buy and call it like: '/buy pizza big' you could get the foodtype using $1 and the size using $2 in your command execution.

In events, such as "on *:SIGNAL:mta....:{ }" MTA:mA provides more or less data you can get using the $1, $2... identifiers ($1 is usually the server id).

MTA:mA also provides some identifiers that read data out of the .ini files MTA:mA writes when receiving data from the server. Those you can use in all of your scripts, but you need to provide parameters for it (e.g. $mta.nick(serverid,playerid)). The data those identifiers refer to doesn't depend on the context they are used in, but on the parameters you specifiy.

You can also use identifiers in identifiers as parameters (e.g. on *:SIGNAL:mta.join:{ echo -a $mta.nick($1,$2) joined }).

Link to comment
  • Recently Browsing   0 members

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