Raised This Month: $66 Target: $400
 16% 

Eject Commander


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Natural Selection        Category:   Admin Commands        Approver:   SniperBeamer (61)
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-03-2004 , 23:43   Eject Commander
Reply With Quote #1

Is there some idoit hogging the commander chair and just destroying the game for ya and refusing to get out....

Eject Him

By using the command "amx_eject" he will be ejected out of the commander chair =D

Required nshelpers.inc
Attached Files
File Type: sma Get Plugin or Get Source (ejectcommander.sma - 2029 views - 695 Bytes)
__________________
My Plugins

Got ??
AssKicR is offline
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 04-06-2004 , 20:45  
Reply With Quote #2

nice
__________________
QwertyAccess is offline
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 04-25-2004 , 01:41  
Reply With Quote #3

doesnt work
__________________
QwertyAccess is offline
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-25-2004 , 13:06  
Reply With Quote #4

Quote:
Originally Posted by QwertyAccess
doesnt work
weird.. worked fine when i tested it =/
__________________
My Plugins

Got ??
AssKicR is offline
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 04-25-2004 , 14:51  
Reply With Quote #5

No Commander Found
__________________
QwertyAccess is offline
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-25-2004 , 18:16  
Reply With Quote #6

Quote:
Originally Posted by QwertyAccess
No Commander Found
Prolly meens there wasn't a commander at the time you issued command
__________________
My Plugins

Got ??
AssKicR is offline
mahnsawce
Senior Member
Join Date: Apr 2004
Location: internet
Old 04-25-2004 , 18:36  
Reply With Quote #7

Did you test it out on NS 2.0?...

The way NS stores models (which is how you determine the player's class in ns_getclass) is not through Keyvalues any more, rather it's through the player's pev->model setting. So your stock for ns_getclass would only really work on NS 2.0, meaning if this script were executed on NS 3.0, it would result in no commander being found.

However, a method I'm using in my next version of ns2amx should work on either version, here's the stock I'm going to be using (I've not yet tested the newer method, however it should work):

Code:
stock get_class(id)
{
  new iuser3 = pev(id,pev_iuser3)
  if (pev(id,pev_deadflag) > 0)
    return CLASS_DEAD
  if (pev(id,pev_team) == 0)
    return CLASS_NOTEAM
  if (iuser3 == 1)
  {
    // Light armor marine..
    if (pev(id,pev_iuser4) & MASK_HEAVYARMOR)
      return CLASS_HEAVY
    if (pev(id,pev_iuser4) & MASK_JETPACK)
      return CLASS_JETPACK
    return CLASS_MARINE
  }
  if (iuser3 == 2)
    return CLASS_COMMANDER
  if (iuser3 == 3)
    return CLASS_SKULK
  if (iuser3 == 4)  
    return CLASS_GORGE
  if (iuser3 == 5)
    return CLASS_LERK
  if (iuser3 == 6)
    return CLASS_FADE
  if (iuser3 == 7)
    return CLASS_ONOS
  if (iuser3 == 8)
    return CLASS_GESTATE
  return CLASS_UNKNOWN
}
Note that, all that should be required to have this work on AMXX with engine (and without ns2amx) would be changing the pev() to however engine gets it's pev data (can't remember off hand...).
mahnsawce is offline
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-25-2004 , 18:40  
Reply With Quote #8

ye i just checked... here is my new ns_getclass(id)

*deleted confusing code*
__________________
My Plugins

Got ??
AssKicR is offline
QwertyAccess
Veteran Member
Join Date: Feb 2004
Location: Enjiru Layer
Old 04-25-2004 , 18:41  
Reply With Quote #9

coders at work
__________________
QwertyAccess is offline
mahnsawce
Senior Member
Join Date: Apr 2004
Location: internet
Old 04-25-2004 , 18:44  
Reply With Quote #10

That still won't work...

Player models are stored like normal models now (ie: models/player/soldier/soldier.mdl) not like the keyvalues were previously stored (ie: "alien1"). I highly suggest just using my iuser3 method, that way it would work cross-version, between 2.0 and 3.0.
mahnsawce is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:16.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode