Author Topic: Problem with /c goto etc.  (Read 4630 times)

0 Members and 1 Guest are viewing this topic.

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Problem with /c goto etc.
« on: August 12, 2008, 05:58:06 pm »
I have a problem.
I want to convert !goto <id/name> to /c goto <id/name>
but when i use this, it doesnt work :-[ :-[
Code: [Select]
  elseif ($2 == goto) {
    if ($vcmp.cmdcheck(!goto,%id) == fail) !halt
    elseif (!$3) vcmp.msg %id Error - Missing Information, $2 <name>
    elseif (%a == -1) vcmp.msg %id Error - Absent ID/Name
    elseif (%a == $vcmp.getid(%name)) vcmp.msg %id Error - Cannot $2 to Yourself
    elseif ($vcmp.cost(%b) > $vcmp.cash(%b)) vcmp.msg %id Error - You need atleast $ $+ $bytes($vcmp.cost(%b),b) to use this command
    else {
      vcmp.cash- %b $vcmp.cost(%b)
      vcmp.goto %b %a
      vcmp.cmdsay $2 %id Goto - Taking: %name $+ , To: $vcmp.name(%a) $+ , Cost: $ $+ $bytes($vcmp.cost(%b),b)
    }
  }
I have the same problem with: Ban, Kick, Warn and Subalias  :-[
Code: [Select]
elseif ($2 == ban) {
    if ($vcmp.cmdcheck(!ban,%id) == fail) !halt
    elseif (!$3) vcmp.msg %id Error - Missing Information, $2 <name> <reason>
    elseif (%a == -1) vcmp.msg %id Error - Invalid ID/Name
    elseif (%a == $vcmp.getid(%name)) vcmp.msg %id Error - Cannot $2 Yourself
    elseif ($vcmp.level(%a) >= $vcmp.level($vcmp.getid(%name))) vcmp.msg %id Error - Cannot $2 a player with the same or higher Level
    else {
      vcmp.cmdsay $2 %id Banning $vcmp.name($vcmp.getid($3)) - By Admin: %name $+ , Reason: $iif($4,$v1,None)
      vcmp.ban $vcmp.getid($3)
    }
  }
  elseif ($2 == kick) {
    if ($vcmp.cmdcheck(!kick,%id) == fail) !halt
    elseif (!$3) vcmp.msg %id Error - Missing Information, $2 <name> <reason>
    elseif (%a == -1) vcmp.msg %id Error - Invalid ID/Name
    elseif (%a == $vcmp.getid(%name)) vcmp.msg %id Error - Cannot $2 Yourself
    elseif ($vcmp.level(%a) >= $vcmp.level($vcmp.getid(%name))) vcmp.msg %id Error - Cannot $2 a player with the same or higher Level
    else {
      vcmp.cmdsay $2 %id Kicking $vcmp.name($vcmp.getid($3)) - By Admin: %name $+ , Reason: $iif($4,$v1,None)
      vcmp.kick $vcmp.getid($3)
    }
  }
  elseif ($2 == warn) {
    if ($vcmp.cmdcheck(!warn,%id) == fail) !halt
    elseif (!$3) vcmp.msg %id Error - Missing Information, $2 <name> <reason>
    elseif (%a == -1) vcmp.msg %id Error - Invalid ID/Name
    elseif (%a == $vcmp.getid(%name)) vcmp.msg %id Error - Cannot $2 Yourself
    elseif ($vcmp.level(%a) >= $vcmp.level($vcmp.getid(%name))) vcmp.msg %id Error - Cannot $2 a player with the same or higher Level
    else {
      vcmp.warn $vcmp.getid($3) %name $4-
    }
  }
  elseif ($2 == goto) {
    if ($vcmp.cmdcheck(!goto,%id) == fail) !halt
    elseif (!$3) vcmp.msg %id Error - Missing Information, $2 <name>
    elseif (%a == -1) vcmp.msg %id Error - Absent ID/Name
    elseif (%a == $vcmp.getid(%name)) vcmp.msg %id Error - Cannot $2 to Yourself
    elseif ($vcmp.cost(%b) > $vcmp.cash(%b)) vcmp.msg %id Error - You need atleast $ $+ $bytes($vcmp.cost(%b),b) to use this command
    else {
      vcmp.cash- %b $vcmp.cost(%b)
      vcmp.goto %b %a
      vcmp.cmdsay $2 %id Goto - Taking: %name $+ , To: $vcmp.name(%a) $+ , Cost: $ $+ $bytes($vcmp.cost(%b),b)
    }
  }
  elseif ($2 == subalias) {
    if ($vcmp.cmdcheck(!subalias,%id) == fail) !halt
    elseif ($vcmp.getid($3) == -1) {
      if (!$vcmp.alias($3)) vcmp.msg %id Error - Could Not Find Sub-Alias Under " $+ $3 $+ " $+ , $2 <name/ip>
      else vcmp.cmdsay $2 %id $3 $+ 's Sub-Alias - Names: $vcmp.alias($3)
    }
    elseif (!$vcmp.alias($gettok($vcmp.ip($vcmp.name($vcmp.getid($3))),1-2,46))) vcmp.msg %id Error - $vcmp.name($vcmp.getid($3)) does not have a Sub-Alias
    else vcmp.cmdsay $2 %id $vcmp.name(%a) $+ 's Sub-Alias - Names: $vcmp.alias($gettok($vcmp.ip($vcmp.name(%a)),1-2,46))
  }

Plz can someone help me ???

Offline Force

  • LU Developer
  • Made Man
  • *
  • Posts: 242
    • View Profile
Re: Problem with /c goto etc.
« Reply #1 on: August 12, 2008, 06:00:26 pm »
Hmm, Did you put them under the logout command?

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Problem with /c goto etc.
« Reply #2 on: August 12, 2008, 06:05:04 pm »
Yeah  :-[

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Problem with /c goto etc.
« Reply #3 on: August 12, 2008, 06:05:47 pm »
Heal works:
Code: [Select]
  elseif ($2 == heal) {
    if ($vcmp.cmdcheck(!heal,%id) == fail) !halt
    elseif ($vcmp.setting.heal != on) vcmp.msg %id Error - $2 is Currently Set Off
    elseif ($vcmp.cost(%b) > $vcmp.cash(%b)) vcmp.msg %id Error - You need atleast $ $+ $bytes($vcmp.cost(%b),b) to use this command
    else {
      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
    }
  }

szostol

  • Guest
Re: Problem with /c goto etc.
« Reply #4 on: August 12, 2008, 06:10:58 pm »
change elseif to if

I mean first elseif not rest.

Like:

Quote
if ($2 == goto) {
    if ($vcmp.cmdcheck(!goto,%id) == fail) !halt
    elseif (!$3) vcmp.msg %id Error - Missing Information, $2 <name>
    elseif (%a == -1) vcmp.msg %id Error - Absent ID/Name
    elseif (%a == $vcmp.getid(%name)) vcmp.msg %id Error - Cannot $2 to Yourself
    elseif ($vcmp.cost(%b) > $vcmp.cash(%b)) vcmp.msg %id Error - You need atleast $ $+ $bytes($vcmp.cost(%b),b) to use this command
    else {
      vcmp.cash- %b $vcmp.cost(%b)
      vcmp.goto %b %a
      vcmp.cmdsay $2 %id Goto - Taking: %name $+ , To: $vcmp.name(%a) $+ , Cost: $ $+ $bytes($vcmp.cost(%b),b)
    }
  }

Offline TanaX01

  • Made Man
  • ***
  • Posts: 214
  • BlackList! <3
    • View Profile
Re: Problem with /c goto etc.
« Reply #5 on: August 12, 2008, 11:21:34 pm »
Hey Szostol code is if ($2 == goto) { for /c goto id

if ($1 == goto) { for !goto id ?

my dude  :-X

szostol

  • Guest
Re: Problem with /c goto etc.
« Reply #6 on: August 13, 2008, 12:13:46 pm »
Look at mine:

Quote
    if ($2 == goto) || ($2 == pmgoto) {
    if ($vcmp.cmdcheck(!goto,%id) == fail) !halt
    elseif (!$3) vcmp.msg %id  Invalid command usage
    elseif (%a == -1) vcmp.msg %id  Invalid ID/Name
    elseif (%a == $vcmp.getid(%name)) vcmp.msg %id You can't transfer to yourself
    else {
      vcmp.goto %id %a
     vcmp.cmdsay $2 %id Transfering: $+($chr(91),$vcmp.name(%id),$chr(93)) To: $+($chr(91),$vcmp.name(%a),$chr(93))
    }
  }