Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Force on June 28, 2008, 02:01:37 pm

Title: VRocker's New DLL - Scripting is impossible :'(
Post by: Force on June 28, 2008, 02:01:37 pm
Hi,

I downloaded VRockers new DLL and vc-mp and now I am trying to edit to get it to a script that I can use, however, I can't seem to be able to make a login/ register system and for now I am trying to do a sethp command but that is failing:

Code: [Select]
on *:SIGNAL:vcmp.player.command2:{
  ; $1 = ServerID, $2 = PlayerID, $3 = Command, $4- = Params
  vcmp.addchat $1 $vcmp.name( $1, $2 ) $+ : /c $3-

  elseif ($3 == sethp) {
    elseif (!$4) vcmp.msg $2 Error - Missing Information, $3 <name> <amount>
    elseif (!$5) vcmp.msg $2 Error - Missing Information, $3 <name> <amount>
    elseif ($4 == -1) vcmp.msg $2 Error - Invalid ID/Name
    else {
      vcmp.sethp $4 $5
      vcmp.say Setting HP on: $4 To Amount: $5 $+ % By Admin: $2
    }
    !.signal vcmp.command2 $strip( $1- )
  }
}

Any ideas?
Title: Re: VRocker's New DLL - Scripting is impossible :'(
Post by: VRocker on June 28, 2008, 02:24:19 pm
All commands need the $1 parameter. This is used to do multiple things to multiple servers.

Heres the fixed code:
Code: [Select]
on *:SIGNAL:vcmp.player.command2:{
  ; $1 = ServerID, $2 = PlayerID, $3 = Command, $4- = Params
  vcmp.addchat $1 $vcmp.name( $1, $2 ) $+ : /c $3-

  if ($3 == sethp) {
    if (!$4) vcmp.msg $1 $2 Error - Missing Information, $3 <name> <amount>
    elseif (!$5) vcmp.msg $1 $2 Error - Missing Information, $3 <name> <amount>
    elseif ($4 == -1) vcmp.msg $1 $2 Error - Invalid ID/Name
    else {
      vcmp.sethp $1 $4 $5
      vcmp.say $1 Setting HP on: $4 To Amount: $5 $+ % By Admin: $2
    }
  }
!.signal vcmp.command2 $strip( $1- )
}

Also for reference, see my scripts Here (http://liberty-unleashed/AdminSystem.zip)

Edit: Also just noticed you using Elseif's without a starting if. You must have an if before an elseif within the same set of brackets
Title: Re: VRocker's New DLL - Scripting is impossible :'(
Post by: Force on June 28, 2008, 02:29:07 pm
Thanks dude, Hopefully I get my head around the $1 part soon  :)

Edit: For some reason it says there is missing information when I put in everything, for example:

/c sethp 0 20 --> could it be the 0?

Info: Yes it was the 0 but now u cant hp on daft things like bob or w/e and it don't even set the hp...meh! i give up :(

Edit 2: Linkage doesn't work :(
Title: Re: VRocker's New DLL - Scripting is impossible :'(
Post by: Juppi on June 28, 2008, 04:10:12 pm
Well the $1 thing is easy, you just need to add it to every alias before id or other input parameters.

About that sethp command, use vcmp.sethealth, not vcmp.sethp (if you haven't changed the dll alias configurations in any way)
Title: Re: VRocker's New DLL - Scripting is impossible :'(
Post by: Force on June 28, 2008, 04:35:07 pm
Yeah I realised that and changed it to vcmp.sethealth and it all works fine now, however, until my skills are a bit better im going back to sansan :P
Title: Re: VRocker's New DLL - Scripting is impossible :'(
Post by: bazza on July 27, 2008, 12:51:42 pm
To all that need a example of the new dll

we found this one to be the best example



WSV v0.2 by Windlord, VRocker, and damo
http://forum.vicecitymultiplayer.com/index.php?topic=496.0