Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - matthiasvegh

Pages: [1]
1
mIRC/pawn Scripting / 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...

2
mIRC/pawn Scripting / Counter Strike Scripts
« on: July 25, 2007, 04:02:08 pm »
ok, ive been working on some scripts a while now, to make a gammode like CS
here we go..
Code: [Select]
;------------------------------------
;-----------!plant/!defuse-----------
;------------------------------------
alias vcmp.boom {
vcmp.say Target Succesfully Bombed!
vcmp.say Terrorists Win!
}
alias bomb.status !return $iif($readini(vcmp.bomb.ini,STATUS,Ticking),$v1,0)
  elseif (!plant* iswm $2) || (!pmplant* iswm $2) {
    if ($vcmp.cmdcheck(!plant,%id) == fail) !halt
elseif (Bombsite !isin $vcmp.area(%b)) vcmp.msg %id Error - You must be at the Bombsite (Hyman Stadium) to use this command
else {
vcmp.plant
!writeini -n vcmp.bomb.ini STATUS Ticking=1
.timer.ticking 8 1 vcmp.say The Bomb has been Planted!
.timer.ticking 8 2 vcmp.say 29 seconds until explosion!
.timer.ticking 8 3 vcmp.say Message to all Counter Terrorists: Go to the bombsite (Hyman Stadium) and !defuse the bomb!
.timer.ticking 8 30 vcmp.boom
}
  }
um, i have yet to solved the problem of rounds, coz that would have to make irc check the skins of each player. of course i would freeze players that come in while a game is on.

any ideas?

thx

3
mIRC/pawn Scripting / Talking to the server
« on: June 25, 2007, 04:55:28 pm »
not sure if this is a part of this subject, but how can i talk to the server (like a player) via irc. therefore i could be admin and all, without having to be in game. any possibility?

Pages: [1]