• Welcome to Vice City Multiplayer.
 

BASIC mIRC Tutorial

Started by matthiasvegh, July 26, 2007, 07:04:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

matthiasvegh

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)
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:
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

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

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...

delpozov

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

Mex

Quote from: matthiasvegh on July 26, 2007, 07:04:06 PM
$2 %id specifies who to send the message to.

Ok just a small question here,

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

Watti

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

matthiasvegh

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.

mbalee

HI! I need the AutoProtection script! :) Please help me!!!

Mex

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?

AdTec_224

#7
Quote from: Tommis,GUS 9.0elseif ($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.

vcmp.msg $2 %id Hello World!

should be:

vcmp.msg %id Hello World!

Or

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

matthiasvegh

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 August 13, 2007, 06:45:49 PM
so all references to the alias vcmp.msg are wrong in your tutorial.
wrong with the tutorial, just incomplete.

AdTec_224

#9
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:

Quoteelseif ($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: RconAdminMsg !hello 1 Hello World!

whereas if i used:

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

output becomes:

Quote from: RconAdminMsg 1 Hello World!

which is correct.

Quote from: matthiasvegh, August 13, 2007, 10:52:00 AMsorry, 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

Quotealias vcmp.msg dll rcondll.dll RconCommand AdminChat $1-

should be

Quotealias vcmp.msg dll rcondll.dll RconCommand AdminMsg $1-

Mex

Quote from: AdTec_224 on August 13, 2007, 08:33:15 PM
$2 has no use whatsoever in the vcmp.msg alias

Thanks for your answer.

PMP

Quote from: matthiasvegh on August 13, 2007, 02:23:35 PM
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?

Watti


PMP

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.

Watti

hehe... in the config, it has teamkill.. but as RPG.. and its not DM i turned off :P