Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Topic started by: thijn on August 12, 2008, 04:58:06 PM

Title: Problem with /c goto etc.
Post by: thijn on August 12, 2008, 04: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 :-[ :-[

  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  :-[

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 ???
Title: Re: Problem with /c goto etc.
Post by: Force on August 12, 2008, 05:00:26 PM
Hmm, Did you put them under the logout command?
Title: Re: Problem with /c goto etc.
Post by: thijn on August 12, 2008, 05:05:04 PM
Yeah  :-[
Title: Re: Problem with /c goto etc.
Post by: thijn on August 12, 2008, 05:05:47 PM
Heal works:

  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
    }
  }
Title: Re: Problem with /c goto etc.
Post by: szostol on August 12, 2008, 05:10:58 PM
change elseif to if

I mean first elseif not rest.

Like:

Quoteif ($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)
    }
  }
Title: Re: Problem with /c goto etc.
Post by: TanaX01 on August 12, 2008, 10:21:34 PM
Hey Szostol code is if ($2 == goto) { for /c goto id

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

my dude  :-X
Title: Re: Problem with /c goto etc.
Post by: szostol on August 13, 2008, 11:13:46 AM
Look at mine:

Quoteif ($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))
    }
  }