Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: matthiasvegh on July 26, 2007, 08:04:06 pm

Title: BASIC mIRC Tutorial
Post by: matthiasvegh 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 (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...
Title: Re: BASIC mIRC Tutorial
Post by: delpozov 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
Title: Re: BASIC mIRC Tutorial
Post by: Mex 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
Title: Re: BASIC mIRC Tutorial
Post by: Watti 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
Title: Re: BASIC mIRC Tutorial
Post by: matthiasvegh 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.
Title: Re: BASIC mIRC Tutorial
Post by: mbalee on August 13, 2007, 05:21:44 pm
HI! I need the AutoProtection script! :) Please help me!!!
Title: Re: BASIC mIRC Tutorial
Post by: Mex 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?
Title: Re: BASIC mIRC Tutorial
Post by: AdTec_224 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
Title: Re: BASIC mIRC Tutorial
Post by: matthiasvegh 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.
Title: Re: BASIC mIRC Tutorial
Post by: AdTec_224 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-
Title: Re: BASIC mIRC Tutorial
Post by: Mex on August 13, 2007, 09:46:13 pm
$2 has no use whatsoever in the vcmp.msg alias

Thanks for your answer.
Title: Re: BASIC mIRC Tutorial
Post by: PMP 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?
Title: Re: BASIC mIRC Tutorial
Post by: Watti on August 14, 2007, 07:21:15 am
:P PMP isthat for argonathrpg
Title: Re: BASIC mIRC Tutorial
Post by: PMP 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.
Title: Re: BASIC mIRC Tutorial
Post by: Watti 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
Title: Re: BASIC mIRC Tutorial
Post by: matthiasvegh on August 15, 2007, 05:09:16 pm
@ adtec.
Only if your using the current rcon.dll
if you use the other one (old) then it will work.
Title: Re: BASIC mIRC Tutorial
Post by: AdTec_224 on August 15, 2007, 06:32:33 pm
there are only 2 official dlls the 0.1 dll and the 0.3 dll the only dll that works with 0.3z is the 0.3 dll so the code must still be wrong unless this tutorial is for 0.1 and thats well kinda pointless :P.
Title: Re: BASIC mIRC Tutorial
Post by: PMP on August 15, 2007, 07:31:11 pm
hehe... in the config, it has teamkill.. but as RPG.. and its not DM i turned off :P
thats the point isn't it?
That way cops can kill witch others.
Title: Re: BASIC mIRC Tutorial
Post by: capitanazo on August 15, 2007, 10:38:18 pm
Need help.
i like the system of gus of kill and earn cash how to add in falcom script?
bye sorry for my english
Title: Re: BASIC mIRC Tutorial
Post by: Watti on August 16, 2007, 09:27:22 am
Yea... ive fixed the skins.. and im very sure how to get colours.. :)...

But the cars... Will the Server be unstable if i add 200 cars?
Title: Re: BASIC mIRC Tutorial
Post by: PMP on August 16, 2007, 03:54:10 pm
Yea... ive fixed the skins.. and im very sure how to get colours.. :)...

But the cars... Will the Server be unstable if i add 200 cars?
Share the skin knowledge with us plz.  :-[

About the cars, why don't you try, just fill the parking lot with bikes and play a bit.
Title: Re: BASIC mIRC Tutorial
Post by: matthiasvegh on August 16, 2007, 06:49:05 pm
skin?

you mean, how to set skins for classes? well thats not mirc im afraid, thats config.ini
syntax is:
Code: [Select]
Class={class number} {skin number} {spawn point coord X} {spawn Y} Spawn Z} { Angle, 0 is north 180 is south 90 is east 270 is west, you get the point } {wep 1, 0-35 } {ammount of wep 1} {wep 2} {wep2 amo} {wep 3} {wep3 ammo}
Title: Re: BASIC mIRC Tutorial
Post by: PMP on August 17, 2007, 01:30:23 am
skin?

you mean, how to set skins for classes? well thats not mirc im afraid, thats config.ini
syntax is:
Code: [Select]
Class={class number} {skin number} {spawn point coord X} {spawn Y} Spawn Z} { Angle, 0 is north 180 is south 90 is east 270 is west, you get the point } {wep 1, 0-35 } {ammount of wep 1} {wep 2} {wep2 amo} {wep 3} {wep3 ammo}
you post alot, but you don't help shit.
Why don't you post how to don't make the selector bug or the team color numbers and shit?
Title: Re: BASIC mIRC Tutorial
Post by: matthiasvegh on August 17, 2007, 05:52:10 pm
if u look at the title, its mIRC tut. not vcmp server tut.
anyway, if i understand corectly, u mean a bug, that when u choose class, at times, the skin freezes to the same skin. well, thats using special skins with normal ones. i dont know where the line is precisely, but i think its somewhere round 120.

btw, i dont have any knowledge of setting classes color. i dont think it possible, but of course, it wasnt me who programmed it.
Title: Re: BASIC mIRC Tutorial
Post by: ALMIGHTY on September 23, 2007, 08:56:40 am
can i use pawno for make the vcmp gamemode???? i dont know how to use the Mirc thing and i cant learn right now (school)