• Welcome to Vice City Multiplayer.
 

Script Help

Started by Tamas, July 27, 2008, 07:35:13 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Tamas

Hi
This is my transfer script:

[/quote] elseif ($2 == !testgoto) {
      if ($hget(vcmp,loggedin. $+ %id) < 10) { vcmp.adminmsg %id You must be Admin Level 10 or higher to attempt this command. }
      else {
        if ($vcmp.nameid($3) == $null) vcmp.adminmsg %id Error: Invalid ID.
        else {
          if ($hget(vcmp,loggedin. $+ %id) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) { vcmp.adminmsg %id You can't teleport someone higher level than you... }
          else {
             vcmp.setloc %id $vcmp.hgetpos.x($3) $vcmp.hgetpos.y($3) $vcmp.hgetpos.z($3) 0
             vcmp.adminchat Transfering:[ [ $vcmp.hgetname(%id) ] ] to:[ [ $vcmp.hgetname($3) ] ]
}
}
[/quote]

I want to do that when i type !testgoto --> i can give the player Name (not the ID only.) If i give examp: !testgoto 3 its work.
But in this format: !testgoto Tomi not .
Any idea how can i use this script with name variables too?

Tam

thijn

I think this work:
Quoteelseif ($2 == !testgoto) {
      if ($hget(vcmp,loggedin. $+ %id) < 10) { vcmp.adminmsg %id You must be Admin Level 10 or higher to attempt this command. }
      else {
        if ($vcmp.nameid($vcmp.hgetname($3)) == $null) vcmp.adminmsg %id Error: Invalid Name/ID.
        else {
          if ($hget(vcmp,loggedin. $+ %id) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) { vcmp.adminmsg %id You can't teleport someone higher level than you... }
          else {
             vcmp.setloc %id $vcmp.hgetpos.x($vcmp.nameid($vcmp.hgetname($3))) $vcmp.hgetpos.y($vcmp.nameid($vcmp.hgetname($3))) $vcmp.hgetpos.z($vcmp.nameid($vcmp.hgetname($3))) 0
             vcmp.adminchat Transfering:[ [ $vcmp.hgetname(%id) ] ] to:[ [ $vcmp.hgetname($3) ] ]
}
}


Force

I think that might be a bit buggy :P Here is the one I use, just added in the part about not being able to teleport to someone higher than you.


    elseif ($2 == !testgoto) {
      if ($hget(vcmp,loggedin. $+ %id) < 10) { vcmp.adminmsg %id You must be Admin Level 10 or higher to attempt this command. }

      elseif ($vcmp.nameid($3) == $null) vcmp.adminmsg %id Error: Invalid ID.

      elseif ($hget(vcmp,loggedin. $+ %id) < $hget(vcmp,loggedin. $+ $3) { vcmp.adminmsg %id You can't teleport someone higher level than you... }

      else {
        vcmp.adminchat ** Transferring: $chr(91) $vcmp.hgetname(%id) $chr(93) To: $chr(91) $vcmp.hgetname($3) $chr(93)
        vcmp.setloc $1 $vcmp.hgetpos.x($3) $vcmp.hgetpos.y($3) $vcmp.hgetpos.z($3)
      }
    }


That should work

Note: Not Tested

bazza

thijn's one worked for me.

TanaX01

Hey Force Thx 2 code ID and Name /c get id or name  :D

Nemesis2500



Tamas

#6
Hmm
That code is the same what i has just another variable:

Example: elseif ($vcmp.nameid($3) == $null) vcmp.adminmsg %id Error: Invalid ID.
I has the same too, anyway if i use your code my script didnt start.
Because my script not accept "elseif" command sometimes only "if" and "else"
But i dont understound why the name variables dont work, because if i write !testgoto fghzt --> it says invalid ID, but if i write correct name than its not work, teleport me to the center of the golf stage... strange.

Tamas

Okay i rewrited the command, and i puted to /c command.
Now its look like this:
Quote
elseif (($2 == goto) && ($vcmp.loggedin($1) > 4)) {
if ($vcmp.hgetname($3) == $null) vcmp.adminmsg $1 Error: Invalid ID.
  else {
     if ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) { vcmp.adminmsg $1 You can't transfer someone higher level admin than you. }
      else { vcmp.adminchat Transfering:[ [ $vcmp.hgetname($1) ] ] to:[ [ $vcmp.hgetname($3) ] ] | vcmp.setloc $1 $vcmp.hgetpos.x($3) $vcmp.hgetpos.y($3) $vcmp.hgetpos.z($3) 0 }
}
}
Anyway its work fine but if i insert command suc: /c goto [SRS]Tomi it says invalid ID, if i repleace the ($vcmp.hgetname($3) to: ($vcmp.nameid($3) its still not work and also the server teleport me to golf stage if i use name instead number..

Any idea?

thijn

try:
Quote from: [SRS]Tomi on August 01, 2008, 07:03:45 PM
elseif (($2 == goto) && ($vcmp.loggedin($1) > 4)) {
if (!$3) vcmp.adminmsg $1 Error: Invalid ID.
  else {
     if ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) { vcmp.adminmsg $1 You can't transfer someone higher level admin than you. }
      else { vcmp.adminchat Transfering:[ [ $vcmp.hgetname($1) ] ] to:[ [ $vcmp.hgetname($3) ] ] | vcmp.setloc $1 $vcmp.hgetpos.x($3) $vcmp.hgetpos.y($3) $vcmp.hgetpos.z($3) 0 }
}
}


Tamas


Force

Try this:


elseif (($2 == goto) && ($vcmp.loggedin($1) > 4)) {
if (!$3) vcmp.adminmsg $1 Error: Invalid ID.
  elseif ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) {
vcmp.adminmsg $1 You can't transfer someone higher level admin than you.
}
      else {
vcmp.adminchat Transfering:[ [ $vcmp.nameid($1) ] ] to:[ [ $vcmp.nameid($3) ] ]

vcmp.setloc $1 $vcmp.hgetpos.x($vcmp.nameid($3)) $vcmp.hgetpos.y($vcmp.nameid($3)) $vcmp.hgetpos.z($vcmp.nameid($3)) 0
}
}


Note: Untested!

Tamas

Yeah just a little modd:

Quoteelseif (($2 == goto) && ($vcmp.loggedin($1) > 4)) {
    if (!$3) vcmp.adminmsg $1 Error: Invalid ID.
    elseif ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) {
       vcmp.adminmsg $1 You can't transfer someone higher level admin than you.
  }
    else {
       vcmp.adminchat Transfering:[ [ $vcmp.hgetname($vcmp.nameid($1)) ] ] to:[ [ $vcmp.hgetname($vcmp.nameid($3)) ] ]

       vcmp.setloc $1 $vcmp.hgetpos.x($vcmp.nameid($3)) $vcmp.hgetpos.y($vcmp.nameid($3)) $vcmp.hgetpos.z($vcmp.nameid($3)) 0
    }
  }
And works 100% Thanks!

Tamas

2 More questions :D
How can i add name variables to these codes too:

Quoteelseif (($2 == bringp) && ($vcmp.loggedin($1) > 4)) {
    if (!$3) vcmp.adminmsg $1 Error: Invalid ID.
    elseif ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) {
       vcmp.adminmsg $1 You can't transfer someone higher level admin than you.
  }
    else {
       vcmp.adminchat Transfering:[ [ $vcmp.hgetname($vcmp.nameid($3)) ] ] to:[ [ $vcmp.hgetname($vcmp.nameid($1)) ] ]

       vcmp.setloc $3 $vcmp.hgetpos.x($vcmp.nameid($1)) $vcmp.hgetpos.y($vcmp.nameid($1)) $vcmp.hgetpos.z($vcmp.nameid($1)) 0
    }
  }

And this:
Quoteelseif (($2 == setmon) && ($vcmp.loggedin($1) > 4)) {
     if (!$3) vcmp.adminmsg $1 Error: Invalid ID.
    elseif ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) {
       vcmp.adminmsg $1 You can't give cash to someone higher level admin than you.
  }
    else {
       vcmp.adminchat Admin $vcmp.hgetname($1) Gave Cash To:[ $vcmp.hgetname($3) ] Amount:[ $4- ]

       vcmp.setmon $3 $4
    }
  }

Because i use the same code what you sent me, but thats only work with goto command.

TanaX01

use !get is bring  ;)

setmon:
type /admin password (config.ini)
 
you are already logged admin type /setmon id ammount is easy  :)

Tamas

I know its easy but i want to add that to ingame command