• Welcome to Vice City Multiplayer.
 

Help in Syntax

Started by Tamas, August 07, 2008, 05:35:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tamas

Pls help me about sintax:
My ban command:

Quoteelseif (($2 == ban) && ($vcmp.loggedin($1) > 4)) {
    if ($vcmp.loggedin($1) < 10) vcmp.adminmsg $1 You are not an admin, so you hasn't got permission to ban someone!
    else {
     if ($vcmp.nameid($3) == $null) { vcmp.adminmsg $1 Error: Invalid ID/Name }
       else { vcmp.adminchat vcmp.ban $vcmp.nameid($3) $iif($4-,Reason:[ [ $4-,) ] ] | Kicking: $vcmp.hgetname($vcmp.nameid($3)) }
    }
  }
Thats work fine but i want to add a third if command too that says you cant ban higher level admin than you.

I tryed this:

Quoteelseif (($2 == ban) && ($vcmp.loggedin($1) > 4)) {
    if ($vcmp.loggedin($1) < 10) vcmp.adminmsg $1 You are not an admin, so you hasn't got permission to ban someone!
    else {
      if ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) { vcmp.adminmsg $1 You can't ban someone higher level admin than you. }
    else }
     if ($vcmp.nameid($3) == $null) { vcmp.adminmsg $1 Error: Invalid ID/Name }
       else { vcmp.adminchat vcmp.ban $vcmp.nameid($3) $iif($4-,Reason:[ [ $4-,) ] ] | Kicking: $vcmp.hgetname($vcmp.nameid($3)) }
    }
  }

But when i go ingame the commands not work, i know thats about because i using wrong sintax in the third if command.
So how can i variable that 3rd if command to work fine?

thijn

try:

elseif (($2 == ban) && ($vcmp.loggedin($1) > 4)) {
    if ($vcmp.loggedin($1) < 10) vcmp.adminmsg $1 You are not an admin, so you hasn't got permission to ban someone!
    else {
      if ($hget(vcmp,loggedin. $+ $1) < $hget(vcmp,loggedin. $+ $vcmp.nameid($3))) { vcmp.adminmsg $1 You can't ban someone higher level admin than you. }
    else {
     if ($vcmp.nameid($3) == $null) { vcmp.adminmsg $1 Error: Invalid ID/Name }
       else { vcmp.adminchat vcmp.ban $vcmp.nameid($3) $iif($4-,Reason:[ [ $4-,) ] ] | Kicking: $vcmp.hgetname($vcmp.nameid($3)) }
    }
  }


Tamas

This isnt work too  :(
When i put this version of ban than the script not work anymore.
Same happen like in my version.

szostol

I think it's problem with { and } There have to be as much } as {.

ReVilo

In other words try removing one of the closing brackets at the end.