Author Topic: VRocker's New DLL - Scripting is impossible :'(  (Read 4109 times)

0 Members and 1 Guest are viewing this topic.

Offline Force

  • LU Developer
  • Made Man
  • *
  • Posts: 242
    • View Profile
VRocker's New DLL - Scripting is impossible :'(
« 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?

Offline VRocker

  • LU Developer
  • Wiseguy
  • *
  • Posts: 63
    • View Profile
    • Liberty Unleashed - GTA3 Multiplayer Mod
Re: VRocker's New DLL - Scripting is impossible :'(
« Reply #1 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

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
« Last Edit: June 28, 2008, 02:29:09 pm by VRocker »


Offline Force

  • LU Developer
  • Made Man
  • *
  • Posts: 242
    • View Profile
Re: VRocker's New DLL - Scripting is impossible :'(
« Reply #2 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 :(
« Last Edit: June 28, 2008, 02:44:56 pm by [SDT]F_T_F0RC3 »

Juppi

  • Guest
Re: VRocker's New DLL - Scripting is impossible :'(
« Reply #3 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)

Offline Force

  • LU Developer
  • Made Man
  • *
  • Posts: 242
    • View Profile
Re: VRocker's New DLL - Scripting is impossible :'(
« Reply #4 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

Offline bazza

  • Street Thug
  • *
  • Posts: 18
    • View Profile
Re: VRocker's New DLL - Scripting is impossible :'(
« Reply #5 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 damohttp://forum.vicecitymultiplayer.com/index.php?topic=496.0
« Last Edit: July 27, 2008, 03:21:45 pm by bazza »