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