Game Script Methods (BO2)
Player Methods
| Prototype | Description |
|---|---|
| void giveweapon( string weapon, int altModelIndex, int weaponOptions ) void giveweapon( string weapon, int altModelIndex ) void giveweapon( string weapon ) |
Summary: Gives a weapon to the specified client with an optional argument for camo and attachments. A full list containing all the weapon names can be found here http://pastebin.com/wEq07Yzw player giveweapon("mp7_mp", 255, 0);
|
| void updateweaponoptions( string weapon, int weaponOptions ) | Summary:
|
| void setblockweaponpickup( string weapon, int blockWeaponPickup ) | Summary:
|
| int calcweaponoptions( int camo, int lens, int reticle, int tag, int emblem ) int calcweaponoptions( int camo, int lens, int reticle, int tag ) int calcweaponoptions( int camo, int lens, int reticle ) int calcweaponoptions( int slotIndex, int weaponType ) |
Summary:
|
| int calcplayeroptions( int ) | Summary:
|
| void setplayerrenderoptions( int ) | Summary:
|
| void nextplayerrenderoption( string ) | Summary:
|
| void bbclasschoice( int, string, string ) | Summary:
|
| void sethighlighted() | Summary:
|
| void takeweapon( string ) | Summary: Removes the first occurrence of the specified weapon from a client. player takeweapon("mp7_mp");
|
| bool isthrowinggrenade() | Summary: Returns true if the specified client is throwing a grenade. if (player isthrowinggrenade()) |
| void forcegrenadethrow() | Summary: Forces the specified client to throw a grenade. player forcegrenadethrow(); |
| bool isfiring() | Summary: Returns true if the specified client is shooting. if (player isfiring()) |
| bool ismeleeing() | Summary: Returns true if the specified client is meleeing. if (player ismeleeing()) |
| bool isswitchingweapons() | Summary: Returns true if the specified client is switching weapons. if (player isswitchingweapons()) |
| bool isreloading() | Summary: Returns true if the specified client is reloading. if (player isreloading()) |
| void takeallweapons() | Summary: Removes all weapons from the specified client including the default melee knife. player takeallweapons(); |
| bool isinmovemode() | Summary:
|
| string getcurrentweapon() | Summary: Returns the specified clients currently held weapon. currentWeapon = player getcurrentweapon(); |
| float getcurrentweaponspinlerp() | Summary:
|
| void setcurrentweaponspinlerp( float ) | Summary:
|
| string getcurrentweaponaltweapon() | Summary:
|
| int isweaponoverheating( int ) | Summary: Returns 1 if the specified client's slot index is overheating. if (player isweaponoverheating(0)) |
| void setweaponoverheating( int, float ) | Summary: Sets the specified clients slot index overheat to a percentage. player setweaponoverheating(0, 99); |
| string getcurrentoffhand() | Summary: Returns the current lethal/tactical or equipment. offhandWeapon = player getcurrentoffhand(); |
| bool isusingoffhand() | Summary: Returns true if the specified client is using their offhand weapon. if (player isusingoffhand()) |
| void forceoffhandend() | Summary: Forces the specified client to use their offhand weapon. player forceoffhandend() |
| bool hasweapon( string ) | Summary: Returns true if the specified client has the specified weapon. if (player hasweapon("mp7_mp"))
|
| void switchtoweapon() | Summary: Forces the specified weapon to switch to the specified weapon. player switchtoweapon("mp7_mp");
|
| void switchtoweaponimmediate() | Summary:
|
| bool switchtooffhand( string ) | Summary: Switch the player's offhand weapon |
| void weaponplayejectbrass() | Summary:
|
| int getlockonradius() | Summary:
|
| int getlockonspeed() | Summary:
|
| void givestartammo( string ) | Summary: Sets the specified clients' specified weapon to the starting ammunition amount. player givestartammo("mp7_mp");
|
| void givemaxammo( string ) | Summary: Gives the specified clients' specified weapon maximum ammunition. player givemaxammo("mp7_mp");
|
| float getfractionstartammo( string ) | Summary: Returns a float of the specified weapons starting ammunition. fractionStartAmmo = player getfractionstartammo("mp7_mp");
|
| float getfractionmaxammo( string ) | Summary: Returns a float of the specified weapons maximum ammunition. fractionMaxAmmo = player getfractionmaxammo("mp7_mp");
|
| void setweaponheatpercent( string, float ) | Summary:
|
| void setorigin( vector ) | Summary: Teleports the player to a location defined by x, y and z coordinate values. player setorigin((900, -78, 2055.1)); |
| void setvelocity( vector ) | Summary: Set the player's velocity |
| void setplayerangles( vector ) | Summary: Changes the player's view direction via x and y coordinate values. player setplayerangles(anotherplayer.angles); |
| vector getplayerangles() | Summary: Get the player's angles |
| vector getgunangles() | Summary:
|
| vector getplayercamerapos() | Summary:
|
| void cameraactivate( int ) | Summary:
|
| void camerasetposition( vector, vector ) | Summary:
|
| void camerasetlookat( entity, vector ) | Summary:
|
| void gamepadusedlast() | Summary:
|
| int usebuttonpressed() | Summary: Returns 1 if the use button is pressed otherwise 0. if (player usebuttonpressed()) |
| int changeseatbuttonpressed() | Summary:
|
| int attackbuttonpressed() | Summary: Returns 1 if the shooting button is pressed otherwise 0. if (player attackbuttonpressed()) |
| int actionslotonebuttonpressed() | Summary:
|
| int actionslottwobuttonpressed() | Summary:
|
| int actionslotthreebuttonpressed() | Summary: 1 if the left inventory button is pressed otherwise 0. if (player actionslotthreebuttonpressed()) |
| int actionslotfourbuttonpressed() | Summary:
|
| int adsbuttonpressed() | Summary: Returns 1 if the aiming down the sights button is pressed otherwise 0. if (player adsbuttonpressed()) |
| int throwbuttonpressed() | Summary:
|
| int meleebuttonpressed() | Summary: Returns 1 if the melee button is pressed otherwise 0. if (player meleebuttonpressed()) |
| int jumpbuttonpressed() | Summary: Returns 1 if the jumping button is pressed otherwise 0. if (player jumpbuttonpressed()) |
| int stancebuttonpressed() | Summary:
|
| int fragbuttonpressed() | Summary: Returns 1 if the lethal grenade button is pressed otherwise 0. if (player fragbuttonpressed()) |
| int secondaryoffhandbuttonpressed() | Summary:
|
| int inventorybuttonpressed() | Summary:
|
| int sprintbuttonpressed() | Summary:
|
| void sprintuprequired() | Summary:
|
| float playerads() | Summary: Return the player's weapon position fraction. |
| void pingplayer() | Summary: Flashes a player on their teammate's compasses |
| void setviewmodel( string ) | Summary: Set the player's current view model. |
| conststring getviewmodel() | Summary: Get the viewmodel name for the given player |
| void setoffhandsecondaryclass( string ) | Summary: Set whether player can use smoke grenades or flashbangs. |
| conststring getoffhandsecondaryclass() | Summary: Gets the name (either "smoke" or "flash") that toggle is set to. |
| string setoffhandprimaryclass( string ) | Summary:
|
| void beginlocationselection() | Summary: Causes the player to begin selecting a location. A map HUD element should be visible for them to see where they're selecting. Works with endlocationselection(). When the user confirms or cancels, they will recieve a notify "confirm_location" or "cancel_location". The former notify contains the location they selected, as a vector. |
| void beginlocationairstrikeselection() | Summary:
|
| void beginlocationmortarselection() | Summary:
|
| void beginlocationartilleryselection() | Summary:
|
| void beginlocationcomlinkselection() | Summary:
|
| void beginlocationnapalmselection() | Summary:
|
| void endlocationselection() | Summary: Causes the player to leave location selection mode. Works with beginlocationselection(). |
| void clientsyssetstate( int, string ) | Summary:
|
| void weaponlockstart( entity ) | Summary: Begins player's weapon lockon sequence (hud effects, etc). Will clear any existing hard lock. Use WeaponLockFinalize() to complete lock. |
| void weaponlockfinalize( entity ) | Summary: Locks player's weapon onto an entity. Implies WeaponLockStart(), so this may be called to jump to a hard lock. |
| void weaponlockfree() | Summary: Clears player's weapon lock. |
| void weaponlocktargettooclose( int ) | Summary: When set true, the player will be unable to fire their lockon weapon, and will recieve a hint print telling them that they are too close. |
| void weaponlocknoclearance( int ) | Summary: When set true, the player will be unable to fire their lockon weapon, and will recieve a hint print telling them that there is an obstruction. |
| void buttonpressed() | Summary: Check if the host is pressing the button/key, "BUTTON_A", "BUTTON_B", "K |
| void giveweaponnextattachment() | Summary:
|
| void givenextbaseweapon() | Summary:
|
| void getnormalizedmovement() | Summary:
|
| void getnormalizedcameramovement() | Summary:
|
| void sayall() | Summary: Write a client chat message from this client to everybody |
| void sayteam() | Summary: Write a client chat message from this client to everybody on their team |
| void setspawnweapon( string ) | Summary: Set the weapon that this player will spawn with |
| void initialweaponraise( string ) | Summary:
|
| void seteverhadweaponall( int ) | Summary:
|
| void dropitem( string, constlowercasestring ) | Summary: Drop an item with the given item name |
| void dropscavengeritem( string ) | Summary:
|
| int hasagrenadepulledback() | Summary:
|
| bool finishplayerdamage( entity, entity, int, string, vector, vector, conststring, int, int ) | Summary: Does damage to a player - usually as part of the damage callback |
| void finishmeleehit( entity, string, vector, vector, int, int, int ) | Summary:
|
| void reviveplayer() | Summary:
|
| void undolaststand() | Summary:
|
| void suicide() | Summary: Kills the specified player. player suicide(); |
| void turnedhuman() | Summary:
|
| bool isinvehicle() | Summary:
|
| bool isremotecontrolling() | Summary:
|
| bool isweaponviewonlylinked() | Summary:
|
| int allowstand( int ) | Summary: Sets whether the player can stand up |
| int allowcrouch( int ) | Summary: Sets whether the player can crouch |
| int allowprone( int ) | Summary: Sets whether the player can go prone |
| int allowlean( int ) | Summary: Sets whether the player can lean |
| entity getvehicleoccupied() | Summary:
|
| array getfriendlies( int ) | Summary:
|
| array getenemies( int ) | Summary:
|
| int openmenu( string ) | Summary: Open a menu for this player |
| int openmenunomouse( string ) | Summary: Open a menu for this player, with no mouse control. |
| void closemenu() | Summary: Close the current player menu |
| void closeingamemenu() | Summary: close the in game menu for this client. |
| void freezecontrols( int ) | Summary: Freezes/unfreezes the controls of the specified player player freezecontrols(1); |
| void freezecontrolsallowlook( int ) | Summary:
|
| int arecontrolsfrozen() | Summary:
|
| void disableusability() | Summary:
|
| void enableusability() | Summary:
|
| void disableweapons() | Summary: Disable the player's weapon |
| void enableweapons() | Summary: Enable the player's weapons |
| void disabledeathstreak() | Summary:
|
| void enabledeathstreak() | Summary:
|
| int deathstreakactive() | Summary:
|
| void disableoffhandweapons() | Summary:
|
| void enableoffhandweapons() | Summary:
|
| void disableweaponcycling() | Summary:
|
| void enableweaponcycling() | Summary:
|
| void revive() | Summary:
|
| void setlaststandprevweap( string ) | Summary:
|
| void setreverb() | Summary: Set the sound reverberation for the player |
| void deactivatereverb() | Summary: deactivate the sound reverberation for the player on the given priority level |
| void setchannelvolumes() | Summary: Set the channel volumes for the player (a way of fading volumes by type) |
| void deactivatechannelvolumes() | Summary: deactivate the channel volumes for the player on the given priority level |
| int setweaponammoclip( string, int ) | Summary: Set the weapon clip ammunition for the given weapon. |
| void setweaponammostock( string, int ) | Summary: Set the ammunition stockpile for the given weapon. |
| int getweaponammoclip( string ) | Summary: Gets the amount of ammo left in the player's current weapon clip. |
| int getweaponammostock( string ) | Summary: Gets the ammunition stockpile for the given weapon. |
| int anyammoforweaponmodes( string ) | Summary: Returns true if the player has any ammo available for the weapon or any of it's alt-modes (grenade launcher, etc). |
| void iprintln() | Summary: Prints text for the specified player only in the killfeed. player iprintln("Hello, World!");
|
| void iprintlnbold() | Summary: Prints text for the specified player only in the middle of the screen. If the player entity is omitted, the text will be printed for every player in the lobby. player iprintlnBold("Hello, World!");
|
| void spawn( vector, vector ) | Summary: Spawns a new entity and returns a reference to the entity. ufo = spawn("script_model", self.origin);
|
| void setentertime( int ) | Summary:
|
| void cloneplayer( int ) | Summary: Creates a clone of the specified player at current position. player cloneplayer(); |
| void setclientfov( float ) | Summary: Sets the field of view for a player. player setclientfov("90");
|
| void setclientthirdperson( int ) | Summary: Enables/disables 3rd person view for the specified player player setclientthirdperson(1); |
| void setclientthirdpersonangle() | Summary:
|
| void setclientcompass() | Summary:
|
| void setclientscriptmainmenu() | Summary:
|
| void setclientcgobjectivetext() | Summary:
|
| void setclientplayersprinttime() | Summary:
|
| void setclientnumlives() | Summary:
|
| void setclientdrawtalk() | Summary:
|
| void setclientammocounterhide() | Summary:
|
| void setclientminiscoreboardhide() | Summary:
|
| void setclienthudhardcore() | Summary:
|
| void setclientplayerpushamount() | Summary:
|
| void setclientaimlockonpitchstrength() | Summary:
|
| void setclientuivisibilityflag( string, int ) | Summary:
|
| void setclientprofilevar( string, string ) | Summary:
|
| void playclientairstrike( vector, int, string, string, int, string, int ) | Summary:
|
| void playclientnapalm( vector, int, string, string, int, string, int ) | Summary:
|
| void setcurrentspectatorclient( entity ) | Summary:
|
| void relinktoturret( entity ) | Summary:
|
| void carryturret( entity, vector, vector ) | Summary:
|
| void stopcarryturret( entity, vector, vector ) | Summary:
|
| bool iscarryingturret() | Summary:
|
| array canplayerplaceturret( entity ) | Summary:
|
| void setplacementhint( int ) | Summary:
|
| void linkguidedmissilecamera() | Summary:
|
| void unlinkguidedmissilecamera() | Summary:
|
| void gpsjammeractive() | Summary:
|
| void gpsjammerinactive() | Summary:
|
| void spawnprotectionactive() | Summary:
|
| void spawnprotectioninactive() | Summary:
|
| void dualgrenadesactive() | Summary:
|
| void dualgrenadesinactive() | Summary:
|
| void linktomissile( entity, int ) | Summary:
|
| void unlinkfrommissile() | Summary:
|
| array canplaceriotshield( conststring ) | Summary:
|
| void setheldweaponmodel( int ) | Summary:
|
| void setriotshieldfailhint() | Summary:
|
| array canplayerplacevehicle( float, float, float, float, float, float ) | Summary:
|
| void remotecontrolturret( entity ) | Summary:
|
| void remotecontrolturretoff( entity ) | Summary:
|
| void recordkillstreakevent( int ) | Summary:
|
| void recordkillstreakendevent( int ) | Summary:
|
| void recordgameevent( string ) | Summary:
|
| void recordkillmodifier( string ) | Summary:
|
| void recordmedal( string ) | Summary:
|
| void recordloadoutandperks() | Summary:
|
| void recordloadoutperksandkillstreaks( string, string, string, string, int, int, int ) | Summary:
|
| void recordmultikill( int ) | Summary:
|
| void incrementlifestat() | Summary:
|
| void incrementplayerstat( string, int ) | Summary:
|
| void recordplayerdeathzombies() | Summary:
|
| void recordplayerdownzombies( string ) | Summary:
|
| void recordplayerrevivezombies( entity ) | Summary:
|
| void recordzombiezone( string, string ) | Summary:
|
| int islookingat( entity ) | Summary: Returns true if the entity is the same as the player's lookat entity. |
| void playlocalsound( string ) | Summary: Plays a sound locally to the player |
| void stoplocalsound( string ) | Summary: Stops all instances of a local soundalias running on a player. |
| int istalking() | Summary: Returns true if the player is talking via voice chat |
| void allowspectateteam( team, int ) | Summary: Set whether the player can spectate the given team. |
| int getguid() | Summary:
|
| string getxuid() | Summary:
|
| int ishost() | Summary: Returns 1 if the specified player is host, otherwise 0. if (player isHost()) |
| int islocaltohost() | Summary:
|
| int allowads( int ) | Summary: Sets whether the player can switch to ADS |
| int allowjump( int ) | Summary: Sets whether the player can jump |
| int allowsprint( int ) | Summary: Sets whether the player can sprint |
| int allowmelee( int ) | Summary: Sets whether the player can melee |
| int forceslick( int ) | Summary:
|
| void setsprintduration( float ) | Summary:
|
| void setsprintcooldown( float ) | Summary:
|
| void setspreadoverride( int ) | Summary: Sets the player fixed spread value |
| void resetspreadoverride() | Summary: Resets the player spread value to the ones of the weapon in use. |
| void setactionslot( int, string, string ) | Summary: Sets the option to perform when the player executes (for example) "+actionslot 1". |
| string getinventoryweapon() | Summary:
|
| void setinventoryweapon( string ) | Summary:
|
| array getweaponslist( int ) | Summary: Gets an array of all weapons that the player has. Includes any alt-mode weapons (ex: m203_m4) |
| array getweaponslistprimaries() | Summary: Gets an array of all primary weapons that the player has. |
| void startrevive() | Summary:
|
| void stoprevive() | Summary:
|
| void applyknockback( int, vector ) | Summary:
|
| void setperk( string ) | Summary: Gives the player the specified perk player setperk("specialty_fastladderclimb");
|
| bool hasperk( string ) | Summary: Returns true if the player has the specified perk otherwise false if (player hasperk("specialty_fastladderclimb")) |
| array getperks() | Summary:
|
| void clearperks() | Summary: Removes all perks from the player player clearperks(); |
| void unsetperk( string ) | Summary: Removes a specific perk from the player player unsetperk("specialty_fastladderclimb");
|
| void setrank( int, int ) | Summary: Sets the player's rank and prestige level player setRank(level.maxRank, level.maxPrestige); |
| void enableinvulnerability() | Summary: Enables god mode/invincibility for the specific player player enableinvulnerability(); |
| void disableinvulnerability() | Summary: Disables god mode/invincibility for the specific player player disableinvulnerability(); |
| void enableafterlife() | Summary:
|
| void disableafterlife() | Summary:
|
| bool addgoal( vector, float, int, conststring, conststring ) | Summary:
|
| void cancelgoal( conststring ) | Summary:
|
| bool atgoal( conststring ) | Summary:
|
| bool hasgoal( conststring ) | Summary:
|
| vector getgoal( conststring ) | Summary:
|
| void pressusebutton( float ) | Summary:
|
| void pressattackbutton( int ) | Summary:
|
| void pressdtpbutton() | Summary:
|
| bool throwgrenade( string, vector ) | Summary: Throw a grenade. CheckGrenadeThrowPos() or CheckGrenadeThrow() must be called first. |
| float getlookaheaddist() | Summary:
|
| vector getlookaheaddir() | Summary:
|
| void lookat( vector ) | Summary:
|
| void clearlookat() | Summary:
|
| void allowattack( int ) | Summary:
|
| void pressads( int ) | Summary:
|
| void pressmelee() | Summary:
|
| array getthreats( float ) | Summary:
|
| vector predictposition( entity, int ) | Summary:
|
| bool botsighttracepassed( entity, vector ) | Summary:
|
| void botsetfailsa( pathnode ) | Summary:
|
| void botsetdefaultclass( int, string ) | Summary:
|
| void botclassadditem( int, string ) | Summary:
|
| void botclasssetweaponoption( int, int, string, int ) | Summary:
|
| void botclassaddattachment( int, string, string, string ) | Summary:
|
| void botleavegame() | Summary:
|
| int issplitscreen() | Summary: Returns true if the game is a splitscreen game |
| int isplayeronsamemachine( entity ) | Summary:
|
| void playerknockback( int ) | Summary:
|
| float getplayerviewheight() | Summary: Get the player's view height |
| void ishostforbots() | Summary:
|
| void murderline( vector, vector, string ) | Summary:
|
| void setoffhandvisible( int ) | Summary:
|
| void fakedamagefrom( vector ) | Summary:
|
| int getsnapshotackindex() | Summary:
|
| string getleagueteamid() | Summary:
|
Script Entity Methods
| Prototype | Description |
|---|---|
| void moveto( vector ) | Summary: Move this entity to the given point. |
| void movex( float ) | Summary: Move this entity to the given world x value |
| void movey( float ) | Summary: move this entity to the given world y value |
| void movez( float ) | Summary: Move this entity to the given world z value |
| void movegravity( vector, float ) | Summary: Fling this entity. |
| void moveslide( vector, float, vector ) | Summary:
|
| void stopmoveslide() | Summary:
|
| void rotateto( vector ) | Summary: Rotate this entity to the given world rotation value |
| void rotatepitch( float ) | Summary: Rotate this entity to the given pitch |
| void rotateyaw( float ) | Summary: Rotate this entity to the given yaw |
| void rotateroll( float ) | Summary: Rotate this entity to the given roll angle |
| void devaddpitch( float ) | Summary: Add pitch in local space. This is just for development purposes and doesn't interpolate |
| void devaddyaw( float ) | Summary: Add yaw in local space. This is just for development purposes and doesn't interpolate |
| void devaddroll( float ) | Summary: Add yaw in local space. This is just for development purposes and doesn't interpolate |
| void vibrate( vector, float, float, float ) | Summary: Causes a script entity to vibrate, rotating around its origin, along a given vector dir |
| void rotatevelocity( vector ) | Summary: Rotate this entity at a particular velocity for a given time |
| void solid() | Summary: Set the solid flag, so that this object is collidable. |
| void notsolid() | Summary: Unsets the solid flag, so that this object is no longer collidable. |
| void setcandamage( int ) | Summary: Set the candamage flag for this entity - this means that it can respond to notifies from bullets and grenade hits |
| void physicslaunch( vector, vector ) | Summary: Permanently turn this entity into a physics object with an intial force vector at the specified point. |
| void setcheapflag( int ) | Summary:
|
| void ignorecheapentityflag( int ) | Summary:
|
Script Vehicle Methods
| Prototype | Description |
|---|---|
| void attachpath( entityref ) | Summary: Attaches this vehicle to the given path. |
| string vehgetmodel() | Summary:
|
| array getattachpos( entityref ) | Summary: Returns the origin and angles if the vehicle were to be attached to the path. The origin and angles are returned as a vector array of size 2. Origin is 1st and angles is 2nd. |
| void startpath() | Summary: Starts the vehicle following this path. |
| entitynum drivepath( int ) | Summary:
|
| void pathmove( vector, vector, vector ) | Summary:
|
| void pathmoveclear() | Summary:
|
| void pathfixedoffset( vector ) | Summary:
|
| void pathfixedoffsetclear() | Summary:
|
| void pathvariableoffset( vector, float ) | Summary:
|
| void pathvariableoffsetclear() | Summary:
|
| vector getpathfixedoffset() | Summary:
|
| vector getpathvariableoffset() | Summary:
|
| void setdrivepathphysicsscale( float ) | Summary:
|
| void setswitchnode( entityref, entityref ) | Summary: Sets a switch node for this vehicle. |
| void setspeed( float, float, float ) | Summary: Sets the speed and acceleration for this vehicle. |
| void setspeedimmediate( float, float, float ) | Summary: Sets the speed and acceleration for this vehicle instantaneously. Direction will be toward the goal direction if there is a goal, otherwise the current direction. |
| float getspeed() | Summary: Gets the current speed in inches per second. |
| float getspeedmph() | Summary:
|
| float getgoalspeedmph() | Summary: Gets the goal speed in miles per hour. |
| void setbrake( float ) | Summary:
|
| float getbrake() | Summary:
|
| float gethandbrake() | Summary:
|
| float getscriptbrake() | Summary:
|
| void setacceleration( float ) | Summary: Sets the acceleration for this vehicle. |
| void setdeceleration( float ) | Summary: Sets the deceleration for this vehicle. |
| void resumespeed( float ) | Summary: Sets the vehicle to resume its path speed. |
| void setyawspeed( float, float, float, float ) | Summary: Sets the yaw speed for this vehicle. |
| void setmaxpitchroll( float, float ) | Summary: Sets max pitch and roll angle for this vehicle. |
| void setturningability( float ) | Summary: If this is higher, helicopters can make sharper turns to match goal positions better. |
| void setjitterparams( vector, float, float ) | Summary: Set the jitter parameters. Set everything to 0 to stop jittering. Vehicle ignores jitter parameters when on ground |
| void setairresistance( float ) | Summary: Sets the speed at which air resistance maxes out. |
| float getsteering() | Summary:
|
| float getthrottle() | Summary:
|
| void setphysangles( vector ) | Summary:
|
| void sethoverparams( float, float, float ) | Summary: Set the hovering parameters. |
| void joltbody( vector, float, float, float ) | Summary: Jolts the vehicle. |
| void freevehicle() | Summary: Frees this vehicle instance. |
| string getwheelsurface( conststring ) | Summary: Returns the surface type of the given wheel as a string. |
| entity getvehicleowner() | Summary: Returns the owner of this particular vehicle. |
| int isvehicleusable() | Summary:
|
| void makevehicleusable() | Summary: Sets this vehicle to be usable by the player |
| void makevehicleunusable() | Summary: Sets this vehicle to be not usable by the player |
| void usevehicle( entity, int, int ) | Summary:
|
| void setviewclamp( entity, float, float, float, float ) | Summary:
|
| void resetviewclamp( entity, entity ) | Summary:
|
| void setvehiclelookattext( conststring, constistring ) | Summary: Set look at text for vehicle. |
| void setneargoalnotifydist( float ) | Summary: Set distance near goal at which near_goal notification should be sent once. |
| bool setvehgoalpos( vector, int, int, int ) | Summary: Set the target position for this vehicle. |
| void clearvehgoalpos() | Summary:
|
| void setplanegoalpos( float, vector ) | Summary:
|
| void setplanebarrelroll( int, float ) | Summary:
|
| void setgoalyaw( float ) | Summary: Set the goal yaw direction for this vehicle. Goal yaw is ignored if vehicle doesn't stop at goal. Lookat entity has priority over goal yaw |
| void cleargoalyaw() | Summary: Clear the goal yaw direction for this vehicle. |
| void settargetyaw( float ) | Summary: Set the target yaw direction for this vehicle. Goal yaw has priority over target yaw. |
| void cleartargetyaw() | Summary: Clear the target yaw direction for this vehicle. |
| void setlookatent( entity ) | Summary: Set the entity this vehicle will orient towards. |
| void clearlookatent() | Summary: Clear the entity the vehicle is orienting towards. |
| void takeplayercontrol() | Summary:
|
| void returnplayercontrol() | Summary: After controlling a vehicle from script using something like setvehgoalpos(), if the vehicle is being driven by a player, you call this function to return control of the vehicle to the player. |
| void setturrettargetvec( vector ) | Summary: Set the target position for this vehicle turret. |
| void setturrettargetent( entity, vector ) | Summary: Set the target entity for this vehicle turret. |
| void clearturrettarget() | Summary: Clear the target for the vehicle turret. |
| void setgunnertargetvec( vector, int ) | Summary:
|
| vector getgunnertargetvec( int ) | Summary:
|
| void setgunnertargetent( entity, vector, int ) | Summary:
|
| void cleargunnertarget( int ) | Summary:
|
| void setgunnerturretontargetrange( int, float ) | Summary:
|
| entity getgunnertargetent( int ) | Summary:
|
| float getgunneranimpitch( int ) | Summary:
|
| float getgunneranimyaw( int ) | Summary:
|
| void setvehweapon( string ) | Summary: Set the vehicle's weapon |
| entity fireweapon( entity, vector ) | Summary: Fire the vehicle's weapon |
| entity firegunnerweapon( int, entity ) | Summary:
|
| void stopfireweapon() | Summary:
|
| int isturretready() | Summary: Query whether this vehicle's turret is ready for firing |
| void setvehmaxspeed( float ) | Summary:
|
| array getvehoccupants() | Summary:
|
| entity getseatoccupant( int ) | Summary:
|
| int getoccupantseat( entity ) | Summary:
|
| void setseatoccupied( int, int ) | Summary:
|
| string seatgetweapon( int ) | Summary:
|
| vector getseatfiringorigin( int ) | Summary:
|
| vector getseatfiringangles( int ) | Summary:
|
| bool isgunnerfiring( int ) | Summary:
|
| void disablegunnerfiring( int, int ) | Summary:
|
| entity finishvehicledamage( entity, entity, int, string, vector, vector, conststring, int, int, int, conststring, int ) | Summary:
|
| void finishvehicleradiusdamage( entity, entity, float, float, int, string, vector, float, float, vector, int ) | Summary:
|
| bool isvehicleimmunetodamage( int, string, string ) | Summary:
|
| void setdefaultpitch( float ) | Summary:
|
| void cleardefaultpitch() | Summary:
|
| vector getangularvelocity() | Summary:
|
| void setangularvelocity( vector ) | Summary:
|
| void setvehvelocity( vector ) | Summary:
|
| void cancelaimove() | Summary:
|
| void setvehicletype( string ) | Summary:
|
| vector getphysacceleration() | Summary:
|
| void setphysacceleration( vector ) | Summary:
|
| void drawtrajectory() | Summary:
|
| void setrotorspeed( float ) | Summary:
|
| float getmaxspeed( int ) | Summary:
|
| void setmantleena( int ) | Summary:
|
| void setvehicleavoidance( int, float, int ) | Summary:
|
| int getvehicleavoidance() | Summary:
|
| bool vehcansee( entity, int ) | Summary:
|
| bool vehseenrecently( entity, float ) | Summary:
|
| void vehclearenemy() | Summary:
|
| void vehs( entity, float ) | Summary:
|
| void vehclearentitytarget() | Summary:
|
| float getturretheatvalue( int ) | Summary:
|
| bool isvehicleturretoverheating( int ) | Summary:
|
| void setpathtransitiontime( float ) | Summary:
|
| array getvehicleavoidancenodes( float ) | Summary:
|
| void makesentient() | Summary:
|
Hud Element Methods
| Prototype | Description |
|---|---|
| void settext( string text ) | Summary: Set HUD text for this element. hudelem settext( "Hello, World!" ); |
| void clearalltextafterhudelem() | Summary: Clear the config strings for the unique text set after this string. This is intended for development use only. hudelem clearalltextafterhudelem(); |
| void setshader( string shader, int width, int height ) | Summary: Set the material for this Hud Element hudelem setshader( "material", 15, 15 ); |
| void settargetent( entity, entity ) | Summary: Set the entity that this waypoint should target. In MP, entity should already be a broadcasting entity, as with Objective_OnEntity(). |
| void cleartargetent() | Summary: Clear this waypoint from targetting an entity. hudelem cleartargetent(); |
| void settimer( float time ) | Summary: Set a timer HUD element to count down hudelem settimer( level.counter ); |
| void settimerup( float time ) | Summary: Set a timer HUD element to count up hudelem settimerup( level.counter ); |
| void settenthstimer( float time ) | Summary: Set a timer HUD element to count down in tenths of a second hudelem settenthstimer( camtime ); |
| void settenthstimerup( float ) | Summary: Set a timer HUD element to count up in tenths of a second hudelem settenthstimerup( .1 ); |
| void setclock() | Summary: Set a clock HUD element to count down over a time period. |
| void setclockup() | Summary: Set a clock HUD element to count up over a time period. |
| void setvalue( float ) | Summary: Set a value HUD element to a given value. |
| void setwaypoint( int, string, int, int ) | Summary: Sets a hud element to be a waypoint. |
| void fadeovertime( float ) | Summary: Set a hud element to transition in color (or alpha) over time. Normally setting the color (or alpha) of an element causes an immediate visual change. However, if the color (or alpha) gets set within <time> after calling fadeOverTime, then the hud element will transition to the new color over the remaining <time>. |
| void scaleovertime( float, int, int ) | Summary: Set a hud element to scale over time. |
| void moveovertime( float ) | Summary: Set a hud element to move over time. |
| void reset() | Summary: Reset a HUD element to its default state. |
| void destroy() | Summary: Remove this Hud element altogether. |
| void setpulsefx( int, int, int ) | Summary: Set the hudelem string to display with a "Pulse" effect. |
| void setcod7decodefx( int, int, int ) | Summary:
|
| void setredactfx( int, int, int, int ) | Summary:
|
| void settypewriterfx( int, int, int ) | Summary:
|
| int gettextwidth() | Summary:
|
| void setperks( entity, entity ) | Summary:
|
| void setplayernamestring( entity, entity ) | Summary: Set the player name string for a HUD element |
| void setmapnamestring( string ) | Summary: Set the map name string |
| void setgametypestring( string ) | Summary: Set the game type string for the game |
| void setwargamedata() | Summary:
|
| void changefontscaleovertime( float time ) | Summary: Set a hud element to transition in fontScale over time. Normally setting the fontScale of an element causes an immediate visual change. However, if the fontScale gets set within <time> after calling ChangeFontScaleOverTime, then the hud element will transition to the new fontScale over the remaining <time>. |
Helicopter Methods
| Prototype | Description |
|---|---|
| void freehelicopter() | Summary:
|
| void setspeed() | Summary: Sets the speed and acceleration for this vehicle. |
| float getspeed() | Summary: Gets the current speed in inches per second. |
| float getspeedmph() | Summary:
|
| void resumespeed( float ) | Summary: Sets the vehicle to resume its path speed. |
| void setyawspeed( float, float, float, float ) | Summary: Sets the yaw speed for this vehicle. |
| void setmaxpitchroll( float, float ) | Summary: Sets max pitch and roll angle for this vehicle. |
| void setturningability( float ) | Summary: If this is higher, helicopters can make sharper turns to match goal positions better. |
| void setairresistance( float ) | Summary: Sets the speed at which air resistance maxes out. |
| void sethoverparams( float, float, float ) | Summary: Set the hovering parameters. |
| void setneargoalnotifydist( float ) | Summary: Set distance near goal at which near_goal notification should be sent once. |
| bool setvehgoalpos( vector, int, int, int ) | Summary: Set the target position for this vehicle. |
| void setgoalyaw( float ) | Summary: Set the goal yaw direction for this vehicle. Goal yaw is ignored if vehicle doesn't stop at goal. Lookat entity has priority over goal yaw |
| void cleargoalyaw() | Summary: Clear the goal yaw direction for this vehicle. |
| void settargetyaw( float ) | Summary: Set the target yaw direction for this vehicle. Goal yaw has priority over target yaw. |
| void cleartargetyaw() | Summary: Clear the target yaw direction for this vehicle. |
| void setlookatent( entity ) | Summary: Set the entity this vehicle will orient towards. |
| void clearlookatent() | Summary: Clear the entity the vehicle is orienting towards. |
| void setvehweapon( string ) | Summary: Set the vehicle's weapon |
| entity fireweapon( entity, vector ) | Summary: Fire the vehicle's weapon |
| void stopfireweapon() | Summary:
|
| void setturrettargetvec( vector ) | Summary: Set the target position for this vehicle turret. |
| void setturrettargetent( entity, vector ) | Summary: Set the target entity for this vehicle turret. |
| void clearturrettarget() | Summary: Clear the target for the vehicle turret. |
| void setdamagestage( int ) | Summary:
|
| void setheliheightlock( int ) | Summary:
|
| float getheliheightlockheight( vector ) | Summary:
|
| int isinsideheliheightlock() | Summary:
|
| void setheightlockoffset() | Summary:
|
Actor Methods
| Prototype | Description |
|---|---|
| void startcoverarrival() | Summary: Runs cover arrival animscript on an actor. |
| void starttraversearrival() | Summary: Runs traverse arrival animscript on an actor. |
| entity melee( vector ) | Summary: Makes this actor melee attack. Returns the entity hit, if any. |
| bool reacquirestep( float ) | Summary: Do side step move to safe place left or right while facing enemy. |
| void findreacquirenode() | Summary: Finds a reacquire node when exposed. |
| pathnode getreacquirenode() | Summary: Gets the reacquire node of this actor. |
| bool usereacquirenode( pathnode ) | Summary: Use the given reacquire node. |
| void findreacquiredirectpath( int ) | Summary: Finds a path directly to the enemy. Call ReacquireMove to use the path. |
| bool trimpathtoattack() | Summary: Trims the path to attack. |
| bool reacquiremove() | Summary: Start the reaquire move |
| void findreacquireproximatepath( int ) | Summary: Finds a path to a point that can see the enemy without leaving goal. Call ReacquireMove to use the path. |
| void flagenemyunattackable() | Summary: Set this actor not to attack its current enemy. |
| void clearpitchorient() | Summary: Clear pitch orientation |
| void setpitchorient() | Summary:
|
| void setlookatanimnodes( anim, anim, anim ) | Summary: Set the animation nodes for this actor for looking at things to the left and right. |
| void setlookat( vector, float ) | Summary: Set the actor to exit the prone position. |
| void setlookatyawlimits( float, float, float ) | Summary: Set the limits of what this actor can look at. |
| void stoplookat( float ) | Summary: Make this actor stop looking at its current look at target. |
| bool cansee( entity, int ) | Summary: Check to see if the actor can see the given entity. |
| bool seerecently( entity, float ) | Summary:
|
| int lastknowntime( entity ) | Summary:
|
| vector lastknownpos( entity ) | Summary:
|
| int maymovetopoint( vector, int ) | Summary: Check whether the actor can move to a given point. |
| int maymovefrompointtopoint( vector, vector, int ) | Summary: Check whether the actor can move from a given point to a given point. Does not check friendly fire and in goal radius unlike maymovetopoint |
| int teleport( vector, vector ) | Summary: Teleport the actor to a new position with the given origin and angles. |
| float withinapproxpathdist( float ) | Summary: Check whether the actor is within an approximate distance to his path |
| int ispathdirect() | Summary: Check whether the actor's current path is direct |
| void allowedstances( conststring, conststring, conststring ) | Summary: Sets the list of the actor's allowed stances. |
| int isstanceallowed( conststring ) | Summary: Checks whether this actor can go to the given stance. |
| void traversemode( conststring ) | Summary: Set the traverse mode of this actor. |
| void animmode( conststring, int ) | Summary: Set the way that animation deltas are interpreted by the game engine |
| void orientmode( conststring, vector, int ) | Summary: Set the orient mode of this actor. |
| conststring getorientmode( string ) | Summary:
|
| float getmotionangle() | Summary: Get the motion angle in degrees for this actor. |
| bool shouldfacemotion() | Summary:
|
| void clearmovehistory() | Summary:
|
| vector getmovehistoryaverage() | Summary:
|
| vector getanglestolikelyenemypath() | Summary: Get the angles towards the direction an enemy is most likely to appear. Returns undefined if a good guess can't be made. |
| void lerpposition( vector, vector ) | Summary: Interpolate an actor's position, and angles. |
| void predictoriginandangles() | Summary: Use physics to predict the actor's origin and angles |
| void predictanim() | Summary:
|
| void gethitenttype() | Summary: Get the type of entity that the actor has hit. Can be 'hit', 'obstacle' or 'world'. |
| float gethityaw() | Summary: Get the direction in degrees that the player has hit an obstacle at. Returns an error if nothing was hit. |
| void getgroundenttype() | Summary: Get the entity type of the 'ground' that the actor is on. |
| int isdeflected() | Summary: Check if the actor has been deflected. |
| void animcustom( func, func ) | Summary: Sets the anim script for this actor. |
| int canattackenemynode() | Summary: Checks if this actor can attack its enemies node. |
| int getpathlength() | Summary:
|
| int calcpathlength( vector ) | Summary:
|
| pathnode getnegotiationstartnode() | Summary: Gets the next negotiation node for this actor |
| pathnode getnegotiationendnode() | Summary: Gets the end negotiation node for this actor |
| int canseepathgoal() | Summary:
|
| bool checkprone( vector, float, int ) | Summary: Returns true when a character can go prone at the specified position. Specifically setup for use by AI characters. |
| void pushplayer( int ) | Summary: Set whether this character can push the player |
| void setgoalnode( pathnode ) | Summary: Set this actor's goal node. |
| void setgoalpos( vector, vector ) | Summary: Set this actor's goal position. |
| void setgoalentity( entity ) | Summary:
|
| void setgoalvolume( entity ) | Summary: Set this actor's goal volume. This cannot be set if a goal entity is set. |
| void setgoalvolumeauto( entity ) | Summary:
|
| entity getgoalvolume() | Summary: Get this actor's goal volume. |
| void cleargoalvolume() | Summary: Clears this actor's goal volume. |
| void setfixednodesafevolume( entity ) | Summary: Set this actor's fixed node safe volume. |
| entity getfixednodesafevolume() | Summary: Get this actor's fixed node safe volume. |
| void clearfixednodesafevolume() | Summary: Clears this actor's fixed node safe volume. |
| bool isingoal( vector ) | Summary: Determine whether a given point is in the actor's current goal area |
| void setruntopos( vector ) | Summary: Override where the actor should run to. This overrides the goal pos and the claimed node. |
| void clearruntopos() | Summary:
|
| bool nearnode( pathnode ) | Summary: Determine whether this actor is near to a given path node. |
| bool nearclaimnode() | Summary:
|
| bool nearclaimnodeandangle() | Summary:
|
| bool atdangerousnode() | Summary:
|
| void getenemyinfo( entity ) | Summary:
|
| void clearenemy() | Summary: Clear the actor's current enemy entity. |
| void setentitytarget( entity, float ) | Summary: Set an entity as the AI's target. This is for special cases only. Do not set AI or player targets with this. |
| void clearentitytarget() | Summary: Clears an AI's entity target. |
| void setpotentialthreat( float ) | Summary: In non-combat situations. This is mostly useful for friendlies. |
| void clearpotentialthreat() | Summary: Clear the potential threat direction. See SetPotentialThreat for more info on potential threats |
| void getperfectinfo( entity ) | Summary:
|
| void setflashbangimmunity( int ) | Summary: Sets whether an actor is succeptable to flashbangs. |
| void setflashbanged( int ) | Summary: Sets whether an actor is under a flashbang effect. |
| float getflashbangedstrength() | Summary: Retrieves how strongly the actor was initially hit by a flashbang. 1.0 is full strength, 0.0 is none at all. |
| int isknownenemyinradius( vector, float ) | Summary: Checks if there is a known enemy in a radius for an AI. |
| int isknownenemyinvolume( entity ) | Summary: Checks if there is a known enemy in a volume for an AI. |
| void settalktospecies( conststring ) | Summary: Sets the species this AI can share enemy information with. |
| void allowpitchangle( int ) | Summary:
|
| void knockback( int ) | Summary:
|
| float getdeltaturnyaw() | Summary:
|
| entity finishactordamage( entity, entity, int, string, vector, vector, conststring, int, int ) | Summary:
|
| array calclookaheadpos( vector, int ) | Summary:
|
| void setengagementmindist() | Summary: Sets the min engagement distances used when selecting cover nodes. |
| void setengagementmaxdist() | Summary: Sets the max engagement distances used when selecting cover nodes. |
| bool isinscriptedstate() | Summary:
|
| entity meleewithoffset( vector ) | Summary:
|
| int forceteleport( vector, vector ) | Summary:
|
| void setentityowner( entity ) | Summary:
|
| void clearentityowner() | Summary:
|
| void setanimstate( conststring, int ) | Summary:
|
| void setaimanimweights( float, float ) | Summary:
|
| void startscriptedanim() | Summary: Runs an animscript on an actor. |
| void popaistate() | Summary:
|
| int setanimstatefromasd( conststring, conststring, int ) | Summary:
|
| bool hasanimstatefromasd( conststring ) | Summary:
|
| conststring getanimstatefromasd() | Summary:
|
| int getanimsubstatefromasd( conststring, conststring ) | Summary:
|
| int getanimsubstatecountfromasd( conststring ) | Summary:
|
| anim getanimfromasd( conststring, animsindex, animsindex, int ) | Summary:
|
| float getanimlengthfromasd( conststring, int ) | Summary:
|
| bool getanimhasnotetrackfromasd( conststring, int, conststring ) | Summary:
|
| void setfreecameralockonallowed( int ) | Summary:
|
Builtin Common Methods
| Prototype | Description |
|---|---|
| void forceyellowdot( int ) | Summary:
|
| void disableyellowdot( int ) | Summary:
|
| void allowcamerarotation( int ) | Summary:
|
| bool reloadonnunchuk() | Summary:
|
| bool reloadonwiiumote() | Summary:
|
| void attach( string, constlowercasestring, int ) | Summary: Attach a model to an entity. |
| void detach( string, constlowercasestring ) | Summary: Detaches an attached model from an entity. |
| void detachall() | Summary: detaches all attached models from an entity |
| int getattachsize() | Summary: Returns the number of attached models for this entity. |
| conststring getattachmodelname( int ) | Summary: Returns the name of the attached model at the given attachment slot |
| conststring getattachtagname( int ) | Summary: Returns the tagname of the attached model at the given attachment slot |
| bool getattachignorecollision( int ) | Summary: Returns the ignore collision flag of the attached model at the given attachment slot |
| void hidepart( constlowercasestring, string ) | Summary: Hide part of an entity. |
| void runscriptonent() | Summary:
|
| void sendaiscriptvals( string, string ) | Summary:
|
| void showpart( constlowercasestring, string ) | Summary: Show part of an entity. |
| void showallparts() | Summary: Show all parts of an entity. |
| void playsoundtoplayer( string ) | Summary: Play the sound alias as if coming from the entity, so that only one player can hear it |
| vector getlightcolor() | Summary: Gets the current color of the light, as an RGB vector. |
| void setlightcolor( vector ) | Summary: Sets the current color of the light, as an RGB vector. |
| float getlightintensity() | Summary: Gets the current intensity of the light. |
| void setlightintensity( float ) | Summary: Sets the current intensity of the light. |
| float getlightradius() | Summary: Gets the current radius of the light. |
| void setlightradius( float ) | Summary: Sets the current radius of the light. |
| float getlightfovinner() | Summary: Gets the current inner fov of a spot light. |
| float getlightfovouter() | Summary: Gets the current outer fov of a spot light. |
| void setlightfovrange( float, float ) | Summary: Sets the current radius of the light. |
| int getlightexponent() | Summary: Gets the current exponent of the light. |
| void setlightexponent( int ) | Summary: Sets the current exponent of the light. |
| bool areallmissionsatscore( int ) | Summary:
|
| void isstartingclassdefault() | Summary:
|
| void isstartingclasseraappropriate() | Summary:
|
| int getnumchallengescomplete( string ) | Summary:
|
| bool hascompletedallgamechallenges() | Summary:
|
| void hasallintel() | Summary:
|
| string getdstat() | Summary:
|
| int getdstatarraycount() | Summary:
|
| void setdstat( string, string, int, int, float, float ) | Summary:
|
| void adddstat() | Summary:
|
| void addweaponstat( string, string, int ) | Summary: Adds to a weapon's statistic. The first parameter is the weapon name, the second one the challenge category and the last one the increment. player addWeaponStat("flash_grenade_mp", "used", 1);
|
| void addbonuscardstat( int, string, int ) | Summary:
|
| void getsessstat() | Summary:
|
| void getsessstatarraycount() | Summary:
|
| void setsessstat() | Summary:
|
| void addsessstat() | Summary:
|
| void addplayerstat( string ) | Summary:
|
| void addplayerstatwithgametype() | Summary:
|
| void addgametypestat() | Summary:
|
| void trackweaponfirenative( string, int, int, int ) | Summary:
|
| void updatestatratio( string, string, string ) | Summary:
|
| int addrankxp( string, int ) | Summary:
|
| void addrankxpvalue(string, int) | Summary: Gives the player rank experience. The first parameter is the event type and the second one the experience reward. player addRankXPValue("contract", 60000);
|
| bool hasseasonpass() | Summary:
|
| void setempjammed( int ) | Summary:
|
| bool isempjammed() | Summary:
|
| void setspawnerteam( team ) | Summary: Set the team for this spawner |
| void luinotifyevent() | Summary:
|
| void launch( vector, vector ) | Summary: Launch an object that interacts with the world, using an initial velocity. From this point on this object will no longer block either missiles or bullets. |
| void setmovingplatformenabled( int ) | Summary:
|
| bool ismovingplatform() | Summary:
|
| void setviewmodelrenderflag( int ) | Summary:
|
| void setdrawinfrared( int ) | Summary:
|
| void setgpr() | Summary:
|
| void gamehistorystartmatch( int ) | Summary:
|
| void gamehistoryfinishmatch( int, int, int, int, int, float ) | Summary:
|
| void unlink() | Summary: Unlinks a linked entity from another entity |
| void linkto() | Summary: Attaches one entity to another |
| void linktoblendtotag() | Summary:
|
| void enablelinkto() | Summary: enables linkto for an entity |
| void linktoupdateoffset( vector, vector ) | Summary:
|
| void playerlinkto() | Summary: Attaches the player to an entity. Any entity rotation is added to the player's view, allow the player to look around. Rotating the parent entity/tag will not move the player's eye position, but only the player's view angles. Thus, the player's eye position is locked in place, always directly above the parent tag. |
| void playerlinktoblend( entity, constlowercasestring, float, float, float, float, float, float ) | Summary:
|
| void playerlinktodelta() | Summary: Attaches the player to an entity. Any entity rotation is added to the player's view, allow the player to look around. The player's eye position will remain fixed relative to the parent entity/tag. Thus, pitching and rolling will cause the player's eye position to move. (But the player entity always remains vertical) |
| void playerlinkweaponviewtodelta() | Summary:
|
| void playerlinktoabsolute( entity, constlowercasestring ) | Summary: Attaches the player to an entity. No view movement is allowed. The player's eye position will remain fixed relative to the parent entity/tag. Thus, pitching and rolling will cause the player's eye position to move. (But the player entity always remains vertical) |
| void playercamlinkto( entity, string ) | Summary:
|
| void playercamunlink() | Summary:
|
| void lerpviewangleclamp( float, float, float, float, float, float, float ) | Summary:
|
| void setviewangleresistance() | Summary:
|
| void playerlinkedoffsetenable() | Summary:
|
| void playerlinkedoffsetdisable() | Summary:
|
| void playerlinkedsetusebaseangleforviewclamp( int ) | Summary:
|
| void dontinterpolate() | Summary: pop the entity's position instantaneously to where it moves this time step, rather than smoothly moving there from the previous position |
| entity magicgrenadetype( string, vector, vector, float ) | Summary:
|
| void startfadingblur( float, float ) | Summary:
|
| vector localtoworldcoords( vector ) | Summary: Transform the given local coordinate point to a world coordinate point |
| vector worldtolocalcoords( vector ) | Summary:
|
| void setturretspinning( int ) | Summary:
|
| void attachshieldmodel() | Summary:
|
| void detachshieldmodel() | Summary:
|
| void setscriptmoverflag( int ) | Summary:
|
| void refreshshieldattachment() | Summary:
|
| void setcharacterindex( int ) | Summary:
|
| void useplayerfootsteptable() | Summary:
|
| void setvisionsetforplayer( string, float ) | Summary:
|
| void useservervisionset( int ) | Summary:
|
| void setinfraredvision( int ) | Summary:
|
| string getcontrollertype() | Summary:
|
| void setactorweapon( string, int ) | Summary:
|
| void resetfov() | Summary:
|
Builtin Methods
| Prototype | Description |
|---|---|
| void setstowedweapon( string ) | Summary:
|
| string getstowedweapon() | Summary:
|
| void clearstowedweapon() | Summary:
|
| int getammocount( string ) | Summary: Get the remaining ammo |
| void setvisibletoplayer( entity ) | Summary:
|
| void setinvisibletoplayer( entity, int ) | Summary:
|
| void setvisibletoall() | Summary:
|
| void setinvisibletoall() | Summary:
|
| void setvisibletoteam( team ) | Summary:
|
| void setvisibletoallexceptteam( team ) | Summary:
|
| void setforcenocull() | Summary:
|
| void removeforcenocull() | Summary:
|
| int islinkedto( entity ) | Summary:
|
| void allowtacticalinsertion( int ) | Summary:
|
| void allowbottargetting( int ) | Summary:
|
| entity getlinkedent() | Summary:
|
| vector getorigin() | Summary: Gets the origin of an entity |
| vector getangles() | Summary:
|
| vector getmins() | Summary:
|
| vector getmaxs() | Summary:
|
| vector getabsmins() | Summary:
|
| vector getabsmaxs() | Summary:
|
| vector getpointinbounds( float, float, float ) | Summary:
|
| vector geteye() | Summary: Gets the position of the eye for an AI or Player |
| vector geteyeapprox() | Summary:
|
| entity useby( entity ) | Summary: Uses the entity with the passed in entity as the activator |
| void setstablemissile( int ) | Summary: This entity will shoot missiles that do not destabilize. Only applicable to vehicles, players and AI |
| int istouching( entity, vector ) | Summary:
|
| int istouchingswept( entity, float, float ) | Summary:
|
| int istouchingvolume( vector, vector, vector ) | Summary:
|
| void playsound( string ) | Summary: Play's the specified sound which can be heard by other nearby players as well player playsound("zmb_cha_ching");
|
| void playsoundwithnotify( string, conststring ) | Summary:
|
| void playsoundontag( string, string ) | Summary:
|
| void playsoundasmaster( string ) | Summary: Play the sound alias as if coming from the entity, as a master sound |
| void playsoundtoteam( string, entity ) | Summary: Play the sound alias as if coming from the entity, so that only one team can hear it |
| void playbattlechattertoteam( string, string, team, entity ) | Summary:
|
| void playsoundtoplayer( string ) | Summary: Play the sound alias as if coming from the entity, so that only one player can hear it |
| void playloopsound( string, float ) | Summary: Play a sound as a loop |
| void stoploopsound( float ) | Summary: Stop a looping sound |
| void stopsounds() | Summary: Stop all sounds on an entity. *WARNING*, You must have a wait between StopSounds() and delete() or the sound will not stop. |
| void playrumbleonentity() | Summary: Plays a rumble on the given entity. |
| void playrumblelooponentity() | Summary: Plays a looping controller rumble on the given player. |
| void stoprumble( string ) | Summary: Quits the playing of a particular rumble on a player. |
| void delete() | Summary: Removes an entity from the game in the same manner as a trigger_kill" |
| void setmodel( string ) | Summary: Changes an entity's appearance player setmodel("german_shepherd_vest");
|
| void setzombieshrink( int ) | Summary:
|
| void setenemymodel( string ) | Summary:
|
| void dodamage( float, vector, entity, entity ) | Summary: Does damage to this entity |
| float getnormalhealth() | Summary: Gets the normal health of this entity |
| void setnormalhealth( float ) | Summary: Sets the normal health of this entity |
| void setmaxhealth( int ) | Summary:
|
| void show() | Summary: Turns the player visible (default) player show(); |
| void hide() | Summary: Turns the player invisible player hide(); |
| void ghost() | Summary:
|
| void ghostindemo() | Summary:
|
| void showindemo() | Summary:
|
| void laseron() | Summary: Turns on entity's laser sight. |
| void laseroff() | Summary: Turns off entity's laser sight. |
| void showtoplayer( entity ) | Summary: Show the entity to a given client |
| int setcontents( int ) | Summary: Sets the contents of an entity. Returns the old contents. |
| void startfiring() | Summary: Starts a turret firing |
| void stopfiring() | Summary: Stops a turret firing |
| void shootturret() | Summary: Shoots a turret |
| void stopshootturret() | Summary:
|
| void setmode( conststring ) | Summary: Set the mode of a turret. |
| entity getturretowner() | Summary: Gets the "owner" of this turret |
| void settargetentity( entity ) | Summary: Sets the target of this turret |
| array getturretarclimits() | Summary:
|
| void setplayerspread( float ) | Summary: Sets the spread of this turret when used by the player |
| void setaispread( float ) | Summary: Sets the spread of this turret when used by an AI |
| void setconvergencetime( float ) | Summary: Sets the time that a turret takes to converge to its target, on either the pitch or yay planes. |
| void setsuppressiontime( float ) | Summary: Sets the time that a turret uses supressing fire after losing sight of an enemy |
| void cleartargetentity() | Summary: Clears the current target for this turret. |
| void setturretteam( team ) | Summary: Sets the team of a turret |
| void maketurretusable() | Summary: Sets a turret able to be used |
| void maketurretunusable() | Summary: Sets a turret to be unable to be used |
| void setturretaccuracy() | Summary:
|
| void setturretignoregoals( int ) | Summary: Sets the ignoreGoals flag for the turret. |
| entity getturrettarget() | Summary: Gets the current target of this turret |
| void disconnectpaths() | Summary: Disconnects the paths that intersect with the entity. If the entity is a script_brushmodel then it must have DYNAMICPATH set to disconnect paths. |
| void connectpaths() | Summary: Connects the paths that intersect with the entity. If the entity is a script_brushmodel then it must have DYNAMICPATH set to connect paths. |
| conststring getstance() | Summary: Returns the current stance by the player. The returned value is either prone, stand or crouch currentstance = player getstance(); |
| void setstance( conststring ) | Summary: Changes the stance for a specific player. Possible values are prone, stand and crouch player setstance("prone");
|
| void setcursorhint( string, entity ) | Summary: Sets a visible cursor near to an objective |
| void setrevivehintstring( string, team ) | Summary:
|
| void sethintstringforperk( string, string ) | Summary:
|
| void sethintstring( string ) | Summary: Sets the hint string for a usable entity |
| void setfovforkillcam( int ) | Summary:
|
| void sethintlowpriority( int ) | Summary:
|
| void usetriggerrequirelookat() | Summary: Modifies the use trigger so that it requires the user to be looking at it |
| void triggerignoreteam() | Summary:
|
| void shellshock( string, float, int ) | Summary: Start a shell shock sequence for the player. The shell shock must be precached, otherwise calling this script will cause a script error. |
| vector getweaponforwarddir() | Summary:
|
| vector getweaponmuzzlepoint() | Summary:
|
| vector gettagorigin( constlowercasestring ) | Summary: Gets the origin of a particular tag on this model |
| vector gettagangles( constlowercasestring ) | Summary: Gets the angles of a particular tag on this model |
| void getentnum() | Summary: Get the entity number for this entity |
| void stopshellshock() | Summary: Stop a shell shock sequence for the player |
| void setdepthoffield( float, float, float, float, float, float ) | Summary: Set the depth of field values for a player. If start >= end for near or far, depth of field is disabled for that region. |
| void setburn( float ) | Summary:
|
| void setelectrified( float ) | Summary:
|
| void spawnnapalmgroundflame( vector, string, vector, int ) | Summary:
|
| void needsrevive( int ) | Summary:
|
| bool isinsecondchance() | Summary:
|
| float depthinwater() | Summary:
|
| void shootup( float ) | Summary:
|
| int depthofplayerinwater() | Summary:
|
| void useweaponhidetags( string ) | Summary:
|
| void useweaponmodel( string, string, int ) | Summary:
|
| void starttanning() | Summary:
|
| void stopburning() | Summary:
|
| void setwaterdrops( int ) | Summary:
|
| void restoredefaultdroppitch() | Summary: Use this if you move a turret and need to reconfigure. |
| bool isfiringturret() | Summary: Checks whether this turret is firing. The entity must be a turret |
| bool isturretlockedon() | Summary:
|
| void setviewmodeldepthoffield( float, float ) | Summary: Set the depth of field values for the player's viewmodel when at hip. If start >= end, depth of field is disabled. |
| void viewkick( float, vector ) | Summary: Damage the player, and throw the screen around |
| vector localtoworldcoords( vector ) | Summary: Transform the given local coordinate point to a world coordinate point |
| void setrightarc( float ) | Summary: Set the amount that the turret can move to the right |
| void setleftarc( float ) | Summary: Set the amount that the turret can move to the left |
| void settoparc( float ) | Summary: Set the amount that the turret can pivot up |
| void setbottomarc( float ) | Summary: Set the amount that the turret can pivot down |
| void radiusdamage() | Summary: Does damage to all damageable objects within a given radius. The amount of damage is linear according to how close the object is to the radius. See also Entity/radiusdamage to specify an entity the damage is coming from. |
| void detonate( entity ) | Summary: Causes a grenade to explode. Must be called on a grenade. |
| void damageconetrace() | Summary: Determines how much the entity can be damaged from the given position, using the same check that is used by grenades. Performs multiple damage traces and returns an approximation to how much of the entity is damageable from the given point (between 0 and 1). In SinglePlayer this will always be 1 if the entity is partially damageable. |
| void sightconetrace() | Summary: Determines how much the entity can be seen from the given position, using the same check that is used by grenades. Performs multiple sight traces and returns an approximation to how much of the entity is visible from the given point (between 0 and 1). In SinglePlayer this will always be 1 if the entity is partially visible. |
| int heliturretsighttrace( vector, entity, int ) | Summary:
|
| int heliturretdogtrace( vector, entity, int ) | Summary:
|
| int playersighttrace( vector, int, int ) | Summary:
|
| void visionsetlerpratio( float ) | Summary:
|
| float docowardswayanims() | Summary:
|
| void startpoisoning() | Summary:
|
| void stoppoisoning() | Summary:
|
| void startbinocs() | Summary:
|
| void stopbinocs() | Summary:
|
| bool isflared() | Summary:
|
| bool ispoisoned() | Summary:
|
| void setcameraspikeactive( int ) | Summary:
|
| int isinsideheightlock() | Summary:
|
| int ismissileinsideheightlock() | Summary:
|
| int isonground( int ) | Summary: Returns true if the player is on the ground. |
| entity getgroundent() | Summary:
|
| entity getmoverent() | Summary:
|
| int issprinting() | Summary:
|
| void setanim() | Summary: "Restart": These functions cause the animation to restart. If they had been previously playing, without this they would continue from their current time. |
| void useanimtree( animtree ) | Summary: Set the animation tree of an entity |
| void animscripted() | Summary: Runs an animscript on an entity. |
| void animscriptedskiprestart() | Summary:
|
| void animrelative() | Summary: Runs an animscript on an entity. |
| void stopanimscripted() | Summary: Halts animscript on this entity. |
| void clearanim( anim, float ) | Summary: Sets an animation's goal weight (and the goal weights of all of its descendents) to zero over the specified time. |
| void setentityanimrate( float ) | Summary:
|
| float getentityanimrate() | Summary:
|
| vector getcentroid() | Summary: Gets the centroid of an entity |
| bool ismartyrdomgrenade() | Summary:
|
| int getentitynumber() | Summary: Get the entity number of this entity |
| int getentitytype() | Summary:
|
| void enablegrenadetouchdamage() | Summary: enable grenade damage for damage triggers |
| void disablegrenadetouchdamage() | Summary: Disable grenade damage for damage triggers |
| void enableaimassist() | Summary: Enables aim assist on an entity. The entity must have a brush model |
| void disableaimassist() | Summary: Disables aim assist on an entity. The entity must have a brush model |
| void placespawnpoint() | Summary: Raises the spawn point up to make sure it's not in the ground, then drops it back down into the ground. |
| void setspawnclientflag( string ) | Summary:
|
| void directionalhitindicator( int, int ) | Summary:
|
| void sendkillstreakdamageevent( int ) | Summary:
|
| void setplayergravity( int ) | Summary:
|
| void clearplayergravity() | Summary:
|
| void sendfaceevent( conststring ) | Summary:
|
| void setteamfortrigger( team ) | Summary: Set the team that this trigger will react to |
| void setexcludeteamfortrigger( team ) | Summary:
|
| void setperkfortrigger( string ) | Summary:
|
| void setignoreentfortrigger( entity ) | Summary:
|
| void clientclaimtrigger( entity ) | Summary: Claim a single user trigger. |
| void clientreleasetrigger( entity ) | Summary: Release a single user trigger. |
| void releaseclaimedtrigger() | Summary: Release a currently claimed trigger |
| int isitemlocked( int ) | Summary:
|
| int isitempurchased( int ) | Summary:
|
| void uploadleaderboards() | Summary:
|
| void setnemesisxuid( string ) | Summary:
|
| int getloadoutitem() | Summary:
|
| int isbonuscardactive( int, int ) | Summary:
|
| string getloadoutitemref() | Summary:
|
| string getloadoutweapon( int, string ) | Summary:
|
| array getloadoutperks( int ) | Summary:
|
| int getloadoutallocation( int ) | Summary:
|
| void setmovespeedscale( float ) | Summary: Sets the multiplier for the player's movement speed player setmovespeedscale(2); |
| float getmovespeedscale() | Summary:
|
| void logstring() | Summary:
|
| void missile_settarget( entity, vector ) | Summary: Sets the target entity for a guided missile |
| void missile_dronesetvisible( int ) | Summary:
|
| bool isonladder() | Summary: Return true if the player is on a ladder, false otherwise. |
| bool ismantling() | Summary: Return true if the player is mantling, false otherwise. |
| bool isonslide() | Summary:
|
| void startdoorbreach() | Summary:
|
| void stopdoorbreach() | Summary:
|
| void startragdoll( int ) | Summary: Begin ragdoll physics for this entity. Does nothing if the entity is already a ragdoll. |
| int isragdoll() | Summary: Return true if the entity is a ragdoll body, false otherwise. |
| void launchragdoll( vector, constlowercasestring ) | Summary:
|
| void launchvehicle( vector, vector ) | Summary:
|
| void setblur( float, float ) | Summary: Blur the screen over a period of time. |
| void resetmissiledetonationtime( float ) | Summary:
|
| void giveachievement() | Summary:
|
| void setzombiename( string ) | Summary:
|
| void setentgravitytrajectory( int ) | Summary:
|
| void setvehicleteam( team ) | Summary: Set which team a vehicle is on. |
| void setteam( team ) | Summary:
|
| team getteam() | Summary:
|
| void setowner( entity ) | Summary:
|
| void setmissileowner( entity ) | Summary:
|
| void setentityweapon( string ) | Summary:
|
| void setturretowner( entity ) | Summary:
|
| void setturrettype( string ) | Summary:
|
| anim getcorpseanim( animsindex ) | Summary:
|
| void itemweaponsetammo( int, int, int ) | Summary: Sets the ammo ammount for a weapon item entity (lying on the ground) |
| void setturretcarried( int ) | Summary:
|
| void setturretminimapvisible( int ) | Summary:
|
| void setmissilecoasting( int ) | Summary:
|
| void setweapon( string ) | Summary:
|
| void gib( conststring, object ) | Summary:
|
| void setphysparams( float, float, float ) | Summary:
|
| void setplayercollision( int ) | Summary:
|
| void reportuser( string ) | Summary:
|
| void setplayercurrentobjective() | Summary:
|
| void setplayercurrentstreak( int ) | Summary:
|
| vector getvelocity() | Summary: Gets the player's velocity |
| entity spawnactor( int, conststring ) | Summary:
|
| vector getshootatpos() | Summary: Gets the position an attacker would shoot at to hit this entity.For AI or player this is the eye position.For other entities it's the tag_eye if there is one else the center of the entity bounding box. |
| void predictspawnpoint( vector, vector ) | Summary:
|
| void setdefaultdroppitch( float ) | Summary: Set the default drop pitch that the turret attempts to return to when it is not in use. |
| void setscanningpitch( float ) | Summary:
|
| entity launchbomb( string, vector, vector ) | Summary:
|
| entity magicgrenade( string, vector, vector ) | Summary: Creates a "Magic" grenade from an actor. |
| void makegrenadedud() | Summary:
|
| void setclientflag( int ) | Summary:
|
| int getclientflag( int ) | Summary:
|
| void clearclientflag( int ) | Summary:
|
| void setscriptmoverflag( int ) | Summary:
|
| void setmovingplatformenabled() | Summary:
|
| void fakefire( entity, vector, string, int ) | Summary:
|
| void makeusable( team ) | Summary:
|
| void makeunusable() | Summary:
|
| vector predictgrenade() | Summary:
|
| void setdangerous( team, int ) | Summary:
|
| bool isdangerous( team ) | Summary:
|
| void getindexforactivecontract() | Summary:
|
| void getactivecontractprogress() | Summary:
|
| void incrementactivecontractprogress() | Summary:
|
| void incrementactivecontracttime() | Summary:
|
| void isactivecontractcomplete() | Summary:
|
| void hasactivecontractexpired() | Summary:
|
| void getactivecontracttimepassed() | Summary:
|
| void resetactivecontractprogress() | Summary:
|
| void getpregameclass() | Summary:
|
| void getpregameteam() | Summary:
|
| void setpregameclass() | Summary:
|
| void setpregameteam() | Summary:
|
| void recordleaguepreloser() | Summary:
|
| void luinotifyeventtospectators() | Summary:
|
| bool istestclient() | Summary:
|
| void setworldfogactivebank( int ) | Summary:
|
| bool iszbarrier() | Summary:
|
| int getnumzbarrierpieces() | Summary:
|
| conststring getzbarrierpiecestate( int ) | Summary:
|
| void setzbarrierpiecestate( int, constlowercasestring, float ) | Summary:
|
| bool iszbarrieropen() | Summary:
|
| bool iszbarrierclosed() | Summary:
|
| void hidezbarrierpiece( int ) | Summary:
|
| void showzbarrierpiece( int ) | Summary:
|
| void zbarrierpieceusedefaultmodel( int ) | Summary:
|
| void zbarrierpieceusealternatemodel( int ) | Summary:
|
| void zbarrierpieceuseupgradedmodel( int ) | Summary:
|
| void zbarrierpieceuseboxriselogic( int ) | Summary:
|
| int getupgradedpiecenumlives( int ) | Summary:
|
| array getzbarrierpieceindicesinstate( constlowercasestring ) | Summary:
|
| float getzbarrierpieceanimlengthforstate( int, constlowercasestring, float ) | Summary:
|
| conststring getzbarrierpieceanimstate( int ) | Summary:
|
| conststring getzbarrierpieceanimsubstate( int ) | Summary:
|
| int zbarriersupportszombietaunts() | Summary:
|
| int zbarriersupportszombiereachthroughattacks() | Summary:
|
| conststring getzbarriertauntanimstate() | Summary:
|
| conststring getzbarrierreachthroughattackanimstate() | Summary:
|
| int getzbarriernumattackslots() | Summary:
|
| float getzbarrierattackslothorzoffset() | Summary:
|
| void setzbarriercolmodel( string ) | Summary:
|
| string getweaponoptic( string ) | Summary:
|
| void setaltusetrigger() | Summary:
|
| bool isaltusetrigger() | Summary:
|