Author Topic: Help in kick error  (Read 5278 times)

0 Members and 1 Guest are viewing this topic.

Offline TanaX01

  • Made Man
  • ***
  • Posts: 214
  • BlackList! <3
    • View Profile
Help in kick error
« on: July 27, 2008, 12:41:58 am »
hey

help my

in commands kick i quit !kick a kick

Code: [Select]
   elseif ($2 == kick) {
      if ($hget(vcmp,loggedin. $+ %id) < 2) { vcmp.adminmsg %id You Must Be Admin Level 2 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 kick someone higher level admin than you... }
          else { vcmp.kick2 $3 | vcmp.adminchat ** Admin $vcmp.hgetname(%id) kicked player:[ $vcmp.hgetname($vcmp.nameid($3)) ] Reason:[ $4- ]
          }
        }
      }
    }

code alias

Code: [Select]
alias vcmp.kick {
  vcmp.adminchat ** Admin $vcmp.hgetname(%id) kicking player:[ $$vcmp.hgetname($vcmp.nameid($1)) ] $iif($2,Reason:[ $4- ],)
  .timer. $+ $$vcmp.nameid($1) $+ .kick -m 1 250 vcmp.command kick $$vcmp.nameid($1)
}
alias vcmp.kick2 {
  ** Admin $nick kicking player:[ $$vcmp.hgetname($vcmp.nameid($1)) ] $iif($2,Reason:[ $4- ],)
  .timer. $+ $$vcmp.nameid($1) $+ .kick -m 1 250 vcmp.command kick $$vcmp.nameid($1)
}

in game  /c kick tanax01 test

Code: [Select]
<MarciSpeems> ** 0 TaNaX01 joined the server.
<MarciSpeems> ** Admin kicking player:[ TaNaX01 ]
<MarciSpeems> ** 0 TaNaX01 left the server. (Kicked)

please help in Admin TanaX kicked player:[ tanax01 ] Reason:[ test ] ;)

Offline Tamas

  • Made Man
  • ***
  • Posts: 127
    • View Profile
    • http://www.tamasnet.eu/
Re: Help in kick error
« Reply #1 on: July 27, 2008, 01:22:09 am »
Yeah
I have the same problem too
<@BootRobocop> ** Admin kicked player: [SRS]Tomi Reason: noob

But the code is seems to be good:
else { vcmp.kick2 $3 | vcmp.adminchat ** Admin $vcmp.hgetname(%id) kicked player: [ $vcmp.hgetname($vcmp.nameid($3)) ] Reason: [ $4- ]

The problem is in the : $vcmp.hgetname(%id) code.


Offline TanaX01

  • Made Man
  • ***
  • Posts: 214
  • BlackList! <3
    • View Profile
Re: Help in kick error
« Reply #2 on: July 27, 2008, 01:25:48 am »
Yeah
I have the same problem too
<@BootRobocop> ** Admin kicked player: [SRS]Tomi Reason: noob

But the code is seems to be good:
else { vcmp.kick2 $3 | vcmp.adminchat ** Admin $vcmp.hgetname(%id) kicked player: [ $vcmp.hgetname($vcmp.nameid($3)) ] Reason: [ $4- ]

The problem is in the : $vcmp.hgetname(%id) code.



WTF is error ! look alias   8)

Please Help
« Last Edit: July 27, 2008, 02:41:57 am by TanaX01 »

Offline bakasan

  • VC:MP Developer
  • Made Man
  • *
  • Posts: 169
    • View Profile
Re: Help in kick error
« Reply #3 on: July 27, 2008, 03:43:11 am »
it could be the brackets

maybe try using bra (wraps in brackets) because brackets can also be used for evaluation in mirc
Code: [Select]
;--- misc aliases
alias par !return $chr(40) $+ $1 $+ $chr(41)
alias bra !return $chr(91) $+ $1 $+ $chr(93)

that is... if i even understand the problem correctly..
« Last Edit: July 27, 2008, 03:44:49 am by bakasan »

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Help in kick error
« Reply #4 on: July 27, 2008, 12:20:32 pm »
Try this:
Code: [Select]
   elseif ($2 == kick) {
      if ($hget(vcmp,loggedin. $+ %id) < 2) { vcmp.adminmsg %id You Must Be Admin Level 2 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 kick someone higher level admin than you... }
          else { vcmp.kick %id $3 $4- | vcmp.adminchat ** Admin $vcmp.hgetname(%id) kicked player:[ $vcmp.hgetname($vcmp.nameid($3)) ] Reason:[ $4- ]
          }
        }
      }
    }

code alias

Code: [Select]
alias vcmp.kick {
  vcmp.adminchat ** Admin $vcmp.hgetname($1) kicking player:[ $$vcmp.hgetname($vcmp.nameid($2)) ] $iif($2,Reason:[ $3- ],)
  .timer. $+ $$vcmp.nameid($1) $+ .kick -m 1 250 vcmp.command kick $$vcmp.nameid($2)
}
alias vcmp.kick2 {
  ** Admin $nick kicking player:[ $$vcmp.hgetname($vcmp.nameid($1)) ] $iif($2,Reason:[ $4- ],)
  .timer. $+ $$vcmp.nameid($1) $+ .kick -m 1 250 vcmp.command kick $$vcmp.nameid($1)
}
NOTE: UNTESTED!!!

Offline TanaX01

  • Made Man
  • ***
  • Posts: 214
  • BlackList! <3
    • View Profile
Re: Help in kick error
« Reply #5 on: July 27, 2008, 09:09:44 pm »
thijn Thx friend nice aport  8)


Offline Nemesis2500

  • Wiseguy
  • **
  • Posts: 63
  • The Joker
    • View Profile
    • Grand VCMP Server
Re: Help in kick error
« Reply #6 on: July 29, 2008, 04:04:37 am »
nice fixes cmd