Author Topic: Converting commands  (Read 4200 times)

0 Members and 2 Guests are viewing this topic.

Offline [NoN]Toiletduck

  • Wiseguy
  • **
  • Posts: 65
    • View Profile
Converting commands
« on: December 29, 2008, 07:33:32 pm »
If you have got hold of any scripts and you want to ask the experts on how to convert them to be compatible with your preferred script base, put it down here.

I'll start:
 
Does anyone know how to convert these scripts from WSV to GUS?

Code: [Select]
    }
    elseif (!spawnall == $3) && ($2 < 100) {
      if ($vcmp.cmdcheck(!pass,%id) == fail) !halt
      var %x = $vcmp.location($2).x
      var %y = $vcmp.location($2).y
      var %z = $calc($vcmp.location($2).z - 1.12)
      var %a = 1,%b = 1
      if (!$4) {
        while (%a <= %vcmp.vehicles) {
          !inc %b 2.6
          vcmp.setvehicleloc %a $calc(%x + %b) %y %z
          !inc %a
        }
      }
      elseif ($4) {
        while (%a <= %vcmp.vehicles) {
          if ($4 isin $hget(vcmp.config.Cars,%a)) {
            !inc %b 2.6
            vcmp.setvehicleloc %a $calc(%x + %b) %y %z
          }
          !inc %a
        }
      }


I tried but it is no where near complete. Please can someone help me please?

Offline [NoN]Toiletduck

  • Wiseguy
  • **
  • Posts: 65
    • View Profile
Re: Converting commands
« Reply #1 on: December 29, 2008, 07:41:17 pm »
I have another one. ;D
From WSV to GUS

Code: [Select]
  }
  elseif (!mute == $3) {
     if ($vcmp.cmdcheck(!mute,%id) == fail) !halt
     if ($5) { vcmp.say $WSV.addmute($4) Reason: $5- }
      else vcmp.msg %id Please type ! $+ $3 <nick> <reason>
    }

if ($5) { vcmp.say $WSV.addmute($4) Reason: $5- } I have problems with this line.


Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Converting commands
« Reply #2 on: December 29, 2008, 11:39:25 pm »
Code: [Select]
    elseif (!spawnall == $3) && ($2 < 100) {
      if ($vcmp.cmdcheck(!pass,%id) == fail) !halt
      var %x = $vcmp.location($2).x
      var %y = $vcmp.location($2).y
      var %z = $calc($vcmp.location($2).z - 1.12)
      var %a = 1,%b = 1
      if (!$4) {
        while (%a <= %vcmp.vehicles) {
          !inc %b 2.6
          vcmp.setvehicleloc %a $calc(%x + %b) %y %z
          !inc %a
        }
      }
      elseif ($4) {
        while (%a <= %vcmp.vehicles) {
          if ($4 isin $hget(vcmp.config.Cars,%a)) {
            !inc %b 2.6
            vcmp.setvehicleloc %a $calc(%x + %b) %y %z
          }
          !inc %a
        }
      }
Use this:
Code: [Select]
    elseif (!spawnall == $2) {
      if ($vcmp.cmdcheck(!pass,%id) == fail) !halt
      var %x = $vcmp.location(%id,x)
      var %y = $vcmp.location(%id,y)
      var %z = $calc($vcmp.location(%id,z) - 1.12)
      var %a = 1,%b = 1
      if (!$3) {
        while (%a <= %vcmp.vehicles) {
          !inc %b 2.6
          vcmp.setvehicleloc %a $calc(%x + %b) %y %z
          !inc %a
        }
      }
      elseif ($3) {
        while (%a <= %vcmp.vehicles) {
          if ($3 isin $vcmp.carname(%a)) {
            !inc %b 2.6
            vcmp.setvehicleloc %a $calc(%x + %b) %y %z
          }
          !inc %a
        }
      }
}

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Converting commands
« Reply #3 on: December 29, 2008, 11:46:19 pm »
I have another one. ;D
From WSV to GUS

Code: [Select]
  }
  elseif (!mute == $3) {
     if ($vcmp.cmdcheck(!mute,%id) == fail) !halt
     if ($5) { vcmp.say $WSV.addmute($4) Reason: $5- }
      else vcmp.msg %id Please type ! $+ $3 <nick> <reason>
    }

Aliases:
Code: [Select]
alias vcmp.addmute {
hadd -m vcmp.Mutelist $vcmp.name($1) Yes
!return *** Added $vcmp.name($1) to the Mute list.
}
alias vcmp.unmute {
  if ($hget(vcmp.Mutelist,$vcmp.name($1))) {
    hdel vcmp.Mutelist $vcmp.name($1)
    !return *** Deleted $vcmp.name($1) from the Mute list.
  }
  else !return *** $vcmp.name($1) is not on the Mute list.
}
alias vcmp.mutekick {
  if ($hget(vcmp.Mutelist,$vcmp.name($1))) {
    timerkick 1 1 /vcmp.kick $vcmp.getid($1)
    return *** Kicking $vcmp.name($1) (Players on the Mute List cannot speak!)
  }
}
And command:
Code: [Select]
elseif (!mute == $2) {
if ($vcmp.cmdcheck(!mute,%id) == fail) !halt
if ($3) { vcmp.say $vcmp.addmute($3) Reason: $4- }
else vcmp.msg %id Please type $2 <nick> <reason>
}
elseif (!unmute == $2) {
if ($vcmp.name($2) !isin %vcmp.mute) {
if ($vcmp.cmdcheck(!unmute,%id) == fail) !halt
if ($3) { vcmp.say $vcmp.unmute($3) }
else vcmp.msg %id Please type $2 <nick>
}
else vcmp.msg %id You have been muted! Bye!
}
;D

EDIT: Forgot to tell: Put on *:SIGNAL:vcmp.text:{ the follow code:
Code: [Select]
vcmp.say $vcmp.mutekick(%id)
« Last Edit: December 29, 2008, 11:48:58 pm by thijn »

Offline [NoN]Toiletduck

  • Wiseguy
  • **
  • Posts: 65
    • View Profile
Re: Converting commands
« Reply #4 on: December 30, 2008, 12:12:54 am »
Thank you very much for your trouble thijn but I put the !spawnall cmd in and it did nothing.  It put all the code underneath it, to the side and the scripts stopped working.  And I don't understand the second instructions.

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Converting commands
« Reply #5 on: December 30, 2008, 12:04:29 pm »
try using /set %vcmp.vehicles <here your amount of vehicles in config>