Author Topic: BASIC mIRC Tutorial  (Read 19367 times)

0 Members and 1 Guest are viewing this topic.

Offline matthiasvegh

  • Street Thug
  • *
  • Posts: 40
  • =RA=Phil_Cassidy
    • View Profile
    • InternetDJ
BASIC mIRC Tutorial
« on: July 26, 2007, 08:04:06 pm »
ok, many ppl hav problems with this area of vcmp. so, i thought i might put a little tutorial together. Suggestions welcome!
ok, lets go.

Firstly, download the G.U.S made by tommis. (preferably the OLD)

next open it. this can be done with notepad, mIRC's in built script editor, or any similar program. (Note: i advise notepad ++ for this site: http://notepad-plus.sourceforge.net)

lets start with a basic script every tutorial starts with.
You want the server to say "Hello World!"
but you want it to be a bit more complex, you want the server to say this, when a player says !hello
we now need to decide, wether we want "Hello world" to be public, or just the player who said this can see it.

place this code into your script some where near line 1194 (it doesnt really matter, but near the !info command is a good place to put it)
Code: [Select]
elseif ($2 == !hello) || ($2 == !pmhello) {
vcmp.msg $2 %id Hello World!
}

ok. that was our first code. now, the part vcmp.msg is the actual "what to do" thing in the script. $2 %id specifies who to send the message to. Hello world, is the parameter on the actual action. therefore, irc has to send a message, defined in parameters.
if we want the "Hello world!" to be public, replace vcmp.msg with vcmp.say

If we want to check weather player has the right to see "hello world", place an IF before the vcmp.msg:
Code: [Select]
elseif ($2 == !hello) || ($2 == !pmhello) {
if ($vcmp.cmdcheck(!hello,%id) == fail) !halt
else vcmp.msg $2 %id Hello World!
}
now, the if line, does the following
checks if the value after !hello in vcmp.cmdlevel.ini is larger than the players admin level. if it is larger it goes to !halt. if smaller, it ignores !halt and does the next line, which is hello world
!halt, is a storno, but im not sure, if it gives an error message or not.

basically a command looks like this

Code: [Select]
elseif ($2 = !yourcommandhere) || ($2 = !pmyourcommandhere) {
    if ($vcmp.cmdcheck(!heal,%id) == fail) !halt   ;<<< admin check weather player has enough rights
    elseif ($vcmp.setting.heal != on) vcmp.msg %id Error - $2 is Currently Set Off ;<<< specify conditions for command (ie.:IF sky is green THEN Error. ELSE what to do if sky is not green)
    elseif ($vcmp.cost(%b) > $vcmp.cash(%b)) vcmp.msg %id Error - You need atleast $ $+ $bytes($vcmp.cost(%b),b) to use this command
    else {  ;<<< What happens when all conditions are met.
      vcmp.cmdsay $2 %id >> Healed - Name: %name $+ , Cost: $ $+ $bytes($vcmp.cost(%b),b)
      vcmp.cash- %b $vcmp.cost(%b)
      vcmp.sethp $vcmp.getid(%name) 100

btw, due to the error (not sure if its an error)
i would like to clear the alias's

Code: [Select]
alias vcmp.hp !return $iif($hget(VCMPhp,$vcmp.name($1)) != $null,$hget(VCMPhp,$vcmp.name($1)),Unknown)
alias vcmp.armour !return $iif($hget(VCMPArmour,$vcmp.name($1)) != $null,$hget(VCMPArmour,$vcmp.name($1)),Unknown)


alias vcmp.gethp !return $iif($hget(VCMPhp,$1) == $null,0,$v1)
alias vcmp.getarmour !return $iif($hget(VCMPArmour,$1) == $null,0,$v1)
alias vcmp.money dll rcondll.dll RconCommand GetMoney $1-
alias vcmp.say dll rcondll.dll RconCommand AdminChat $1-
alias vcmp.msg dll rcondll.dll RconCommand AdminChat $1-
alias vcmp.ban dll rcondll.dll RconCommand Ban $1-
alias vcmp.kick dll rcondll.dll RconCommand Kick $1-
alias vcmp.coords dll rcondll.dll RconCommand GetLoc $1
alias vcmp.armour1 dll rcondll.dll RconCommand GetArmour $1
alias vcmp.health dll rcondll.dll RconCommand GetHp $1
alias vcmp.sethp dll rcondll.dll RconCommand set 10 $1-
alias vcmp.setweapon dll rcondll.dll RconCommand set 5 $1-
alias vcmp.setvehicle dll rcondll.dll RconCommand set 9 $1-
alias vcmp.setlocation dll rcondll.dll RconCommand set 1 $1-
alias vcmp.setarmour dll rcondll.dll RconCommand set 12 $1-
alias vcmp.players {
  !hadd -m VCMPPlayers Blanking Plate
  !hadd -m VCMPIPs Blanking Plate
  !hfree VCMPPlayers
  !hfree VCMPIPs
  !return $dll(rcondll.dll,RconCommand,players)
}
alias vcmp.connect dll rcondll.dll RconConnect $1-
alias vcmp.disconnect dll rcondll.dll RconDisconnect
alias vcmp.status !return $dll(rcondll.dll,RconIsConnected,)
alias vcmp.name !return $iif($hget(VCMPPlayers,$1),$v1,Unknown)
alias vcmp.ip !return $iif($hget(VCMPIPs,$remove($1,$chr(36))) == $null,Unknown,$v1)
this is not the complete header tho.
i would just like to show to adtec, that this was based on gus 5.
i have removed link to gus 9.

Keep back for more...
« Last Edit: August 13, 2007, 08:55:29 pm by matthiasvegh »

Offline delpozov

  • Street Thug
  • *
  • Posts: 1
    • View Profile
Re: BASIC mIRC Tutorial
« Reply #1 on: August 12, 2007, 12:44:01 am »
Hi. im kinda new at this mirc script. i have some knowledge in C so i undestand a bit but i cant get to modify the goto command. i need to get the !goto coomand only to work with team mates. how can i do that??
thanks

Offline Mex

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Re: BASIC mIRC Tutorial
« Reply #2 on: August 12, 2007, 10:28:56 pm »
$2 %id specifies who to send the message to.

Ok just a small question here,

Code: [Select]
vcmp.msg $2 %id Hello World!
Can you explain what the '$2' bit is for in that code?
As surely that would send a PM to the command the player typed?

Thanks,
Mex

Offline Watti

  • Street Thug
  • *
  • Posts: 24
    • View Profile
Re: BASIC mIRC Tutorial
« Reply #3 on: August 13, 2007, 07:32:16 am »
ok here is ur question Mex

MTA Parameters:

$1 Server
$2 ID
$3 Command
$4 Word that follows command
$5 Word that follows the Word after the command

VCMP Parameters:

$1 User ID
$2 Command
$3 Word that follows Command
$4 Word that follows the Word after the command
$5 Word that follows the word after the word after the command

also $4- Continues it, so if i have

on VCMP

!aragorn Watti ($3) Hello Idoit($4-)

it will go something like

Watti ($3), are you a new Guy to this server Hello Idoit($4-)

i dnot realy know the code off by Heart.. but of xcos Mex i sent you a few commands of it... so yes you should under stand

now as i learned... you get id..

like ummm $vcmp.getid($3) set %id3

then do the

vcmp.cmdsay $2 %id3 are you new $4-

correct me if im wrong

Offline matthiasvegh

  • Street Thug
  • *
  • Posts: 40
  • =RA=Phil_Cassidy
    • View Profile
    • InternetDJ
Re: BASIC mIRC Tutorial
« Reply #4 on: August 13, 2007, 03:23:35 pm »
oo, nice 1  ;D
thats kinda probable
thing is, i just copied out most of he scripts from gus, replaced strings and stuff. i never bothered bout the variables lying round. but now.. i see the point.

@ delpozov. the problem is, rcon doesnt know the class, so u cant script that.

but there is always a way.

on spawn, check players location. that way u know where player spawns, so u might be able to figure out the skin. that way, just right into an ini the current team mates, and on the goto, check if destination player is in the ini.

Offline mbalee

  • Street Thug
  • *
  • Posts: 32
    • View Profile
    • Hungarian GTA Site
Re: BASIC mIRC Tutorial
« Reply #5 on: August 13, 2007, 05:21:44 pm »
HI! I need the AutoProtection script! :) Please help me!!!

Offline Mex

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Re: BASIC mIRC Tutorial
« Reply #6 on: August 13, 2007, 05:36:09 pm »
ok thanks..

but to PM in MTA, the command is "mta.msg $1 $2"
$1 being the server, $2 being the Player, which makes sense.

and to PM in VCMP, the command is "vcmp.msg $2 %id"
$2 being the command typed, %id being the player to PM to.

Ok now why would you need the $2 in the VCM PM?

Offline AdTec_224

  • Administrator
  • Street Thug
  • *****
  • Posts: 30
    • View Profile
Re: BASIC mIRC Tutorial
« Reply #7 on: August 13, 2007, 07:45:49 pm »
Quote from: Tommis,GUS 9.0
  elseif ($2 == !hp) || ($2 == !pmhp) {
    if ($vcmp.cmdcheck(!hp,%id) == fail) !halt
    elseif (%a == -1) vcmp.msg %id Error - Absent ID/Name
    else vcmp.cmdsay $2 %id $vcmp.name(%a) $+ 's - Health: $vcmp.hp(%a) $+ % $+ , Armour: $vcmp.armour(%a) $+ %
  }

so all references to the alias vcmp.msg are wrong in your tutorial.

Code: [Select]
vcmp.msg $2 %id Hello World!
should be:

Code: [Select]
vcmp.msg %id Hello World!
Or

Code: [Select]
vcmp.cmdsay $2 %id Hello World! (not 100% sure what cmdsay is as  i dont use GUS)

Before posting a tutoral please remember to check it over first

-AdTec_224
« Last Edit: August 13, 2007, 08:03:33 pm by AdTec_224 »

Offline matthiasvegh

  • Street Thug
  • *
  • Posts: 40
  • =RA=Phil_Cassidy
    • View Profile
    • InternetDJ
Re: BASIC mIRC Tutorial
« Reply #8 on: August 13, 2007, 08:52:00 pm »
sorry, but this is a tutorial for irc scripting, not editing tommis's gus.
you are right, i should have mentioned aliases
and at the time of creation, the tut was correct.
and you can still use it with the old rcon dll. so theres nothing
so all references to the alias vcmp.msg are wrong in your tutorial.
wrong with the tutorial, just incomplete.

Offline AdTec_224

  • Administrator
  • Street Thug
  • *****
  • Posts: 30
    • View Profile
Re: BASIC mIRC Tutorial
« Reply #9 on: August 13, 2007, 09:33:15 pm »
even if you were just making your own IRC script it would still be wrong.

$2 has no use whatsoever in the vcmp.msg alias

if you used:

Quote
elseif ($2 == !hello) || ($2 == !pmhello) {
if ($vcmp.cmdcheck(!hello,%id) == fail) !halt
else vcmp.msg $2 %id Hello World!
}

output to the rcon would be:

Quote from: Rcon
AdminMsg !hello 1 Hello World!

whereas if i used:

Quote
elseif ($2 == !hello) || ($2 == !pmhello) {
if ($vcmp.cmdcheck(!hello,%id) == fail) !halt
else vcmp.msg %id Hello World!
}

output becomes:

Quote from: Rcon
AdminMsg 1 Hello World!

which is correct.

Quote from: matthiasvegh, August 13, 2007, 10:52:00 AM
sorry, but this is a tutorial for irc scripting, not editing tommis's gus.
you are right, i should have mentioned aliases
and at the time of creation, the tut was correct.
and you can still use it with the old rcon dll. so theres nothing
Quote from: AdTec_224 on Today at 09:45:49 AM
so all references to the alias vcmp.msg are wrong in your tutorial.
wrong with the tutorial, just incomplete.

Not sure what your saying there but the fact remains the code is wrong.

-AdTec_224

EDIT

Just noticed a bug in your vcmp.msg alias

Quote
alias vcmp.msg dll rcondll.dll RconCommand AdminChat $1-

should be

Quote
alias vcmp.msg dll rcondll.dll RconCommand AdminMsg $1-
« Last Edit: August 13, 2007, 09:35:19 pm by AdTec_224 »

Offline Mex

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Re: BASIC mIRC Tutorial
« Reply #10 on: August 13, 2007, 09:46:13 pm »
$2 has no use whatsoever in the vcmp.msg alias

Thanks for your answer.

Offline PMP

  • Street Thug
  • *
  • Posts: 25
    • View Profile
Re: BASIC mIRC Tutorial
« Reply #11 on: August 14, 2007, 04:14:22 am »
on spawn, check players location. that way u know where player spawns, so u might be able to figure out the skin. that way, just right into an ini the current team mates, and on the goto, check if destination player is in the ini.
But then, How do we change the colour of the players icons and chat name?

Offline Watti

  • Street Thug
  • *
  • Posts: 24
    • View Profile
Re: BASIC mIRC Tutorial
« Reply #12 on: August 14, 2007, 07:21:15 am »
:P PMP isthat for argonathrpg

Offline PMP

  • Street Thug
  • *
  • Posts: 25
    • View Profile
Re: BASIC mIRC Tutorial
« Reply #13 on: August 15, 2007, 02:11:02 am »
Actually I'm much closer to get that to work but still need help.
Thats the Classes option on config file.
It could be a better option to spawn scripting cause it's less eavy.
and will avoid TK.

Offline Watti

  • Street Thug
  • *
  • Posts: 24
    • View Profile
Re: BASIC mIRC Tutorial
« Reply #14 on: August 15, 2007, 06:50:41 am »
hehe... in the config, it has teamkill.. but as RPG.. and its not DM i turned off :P