EventScripts Forums
Mattie's EventScripts and Source Forums
Script Categories
16000 (15) abilities (15) addon (72) addons (17) admin (354) admins (23) advert (30) adverts (28) afk (18) alerts (12) ammo (25) anti (21) armor (11) auth (16) automatic (15) awp (29) ban (24) bank (11) ba_jail (35) bhop (46) block (27) bomb (48) bonus (25) boost (22) bot (36) bot-management (20) bots (24) bullet (13) bunnyhop (19) Buy (27) buymenu (13) c4 (12) cash (77) Change (14) chat (77) cheat (15) clan (17) classes (24) color (30) colors (20) command (23) commands (21) config (28) configurable (11) connect (58) counter (12) Counter-Strike-Source (20) CS:S (20) css (3386) custom (13) Damage (49) database (14) dead (19) Deagle (11) death (20) deathmatch (79) deathrun (17) deutsch (15) dice (12) disconnect (26) Dissolve (12) dm (24) dod:s (11) dods (501) download (13) easy (26) effect (14) effects (126) English (16) entity (24) est (12) es_tools (14) Eventscript (12) exploit (11) flashbang (27) français (104) french (36) fun (312) funny (18) Gabeee (11) game (12) gamemode (12) gameplay (175) German (11) give (22) gravity (16) grenade (28) grenades (32) gun (16) GunGame (31) GunGame5 (11) guns (20) Hack (16) headshot (37) health (72) hegrenade (15) help (11) hit (13) hl2dm (442) HP (26) hudhint (13) hun (17) hungarian (26) info (53) information (19) invisible (11) IP (13) jail (81) jailbreak (14) join (47) jump (19) kick (25) kill (51) kills (24) knife (66) leveling (38) LnD (14) lol (11) magyar (48) management (14) manager (11) mani (16) map (32) map-management (26) maps (17) match (22) Memphis-84 (13) menu (144) message (34) messaging (52) minecraft (12) mod (121) model (18) models (33) modye (16) money (50) motd (13) music (32) mute (20) nades (20) name (15) new (13) noblock (54) orangebox (23) player (49) player-management (31) player-tracking (28) popup (72) prop (13) propmenu (14) props (34) protect (12) protection (32) punish (11) punishment (51) python (80) quake (32) QuakeSounds (12) race (13) races (20) radio (30) random (47) rank (42) rates (15) rcon (12) realism (22) Regeln (23) respawn (69) restrict (41) round (26) rpg (32) rules (63) say (17) score (16) scout (29) Script (25) script-helper (25) scriptpack (33) sdk (171) server (61) server-tools (42) shop (12) showdamage (20) silly (31) simple (33) skin (17) skins (34) slay (13) soccer (14) sound (67) sounds (107) source (14) spanish (18) spawn (82) speed (26) statistics (14) stats (57) status (15) Steam (11) STEAMID (30) Superhero (15) surf (41) Team (30) team-balance (14) teleport (17) text (19) TF2 (142) time (23) timer (15) tools (15) tracers (19) triggers (11) uedi (17) uses_auth (18) vip (24) vote (39) voting (22) war (25) Warcraft (12) warcraft-source (20) wc3 (14) wcs (47) wcs:Python (32) weapon (88) weapons (120) web (16) welcome (14) wuerfeln (11) zm (26) zombie (100) zombiemod (55) zombies (12)
Script Authors
*XYZ*SaYnt (12) .:MiB:. (20) .:modye:. (14) .eMko* (6) 101satoon101 (12) 3R10N (24) 4u571n91 (5) 7355608 (9) Absolute (9) Ace Rimmer (40) adminc (5) adyshor37 (5) Adz (8) AgathaKnuppelkuh (8) aidden (8) ajax (5) ak_47 (6) Al3c Tr3v3lyan (6) allstareng (5) ashbash1987 (9) ATAMAH (7) Ayuto (5) aznone (5) B00M (5) BackRaw (41) BFH_RedBull (8) bigfabi (8) Bioko (10) blackshoxx (9) Blade (10) bladesback (13) bobdole (11) bodzsar1 (8) bonbon (36) Brainsucker (32) cagemonkey (8) capo azzlack (7) captain master (6) carbon-14 (10) CaskioUTF (5) cbirou (15) CbRRR (16) ChaCaLz2psy4 (5) CharlesT (5) Chris1888 (5) Chrisber (5) chrismrulz (10) Chun (6) cladiron (10) clipz934 (8) Colster (21) Cookieman8 (7) CrAzD (6) craziest (11) dani12356 (12) DanielB (19) Darkness123 (8) Dave (9) dbozan99 (7) dead man walker (12) deathx9 (5) Deathyy (16) dhack (17) Di[M]aN (12) DJ Fire-Black prod (8) DoCky (31) Don (15) dordtcore (9) DragonFreddo (8) Drassil (5) dretax14 (11) Einlanzers (47) EmbouT (10) emilplov (7) Errant (10) Eun (6) Fantole (10) FMIS (5) Franc1sco (17) freddukes (18) Frequency (6) Fridge (5) Fugi91 (6) Fulmine (5) G4ME (5) GAMEREN2 (8) german9114 (13) GODJonez (40) GoodfellaDeal (5) Hansi (6) Hisoka (6) HitThePipe (7) HOLLDIDAY (24) Icetouch (6) ichthys (25) Im the new guy (14) iNexus (13) infamous1 (9) isivisi (13) ispaine (7) Jackmaster (9) Jeff91 (45) JoeyT2006 (30) Juba_PornBorn (12) jxl180 (11) KDBFame (6) L'In20Cible (11) L.P.H (8) Largo Usagi (10) LnD (14) Lobe (11) loKkdoKk (8) lolo-le-haricot (7) LosNir (5) Lumpi@Work (9) M4rc3L-XCN (7) macshot (7) magyar-oneill (9) Matth (7) Mattie (21) mave1993 (5) MBchrono (15) McFly (20) Medda (5) Memphis-84 (15) Messiah93 (20) Mickyy (5) micmacx (6) minimal42O (5) Mitchell (5) Mixer57 (5) modye (6) Monster_Bitch1 (9) Mordavolt (7) motomoto (21) MrScriptaz (6) mryoung (6) MyTechZone.de (9) Nicolous (23) ojii (31) oliVier (10) Omega68 (6) Omega_K2 (11) Owned|Myself (8) P3N (7) pand3mic (6) parsimba (5) Pascal257 (9) PatPeter (7) PDrop (10) Phaedrus (18) PhantOm Fury (7) phoenix131 (9) pinkyyy -.- (5) pitbull0993 (7) PixelGamer (7) qwern (5) randomknifer (9) Raptor150 (31) Ratzee (6) ReaCtioN2oo9 (6) RedCliff (5) Rennnyyy (17) revolutionfighters (8) RideGuy (12) Rio (9) Roeliekt (6) roof (16) runamagic (13) Ryezin (5) sandking220 (6) Sarcasm_Poisoning (10) saRs| Johnny-5 (13) Schubaal (10) sea212 (5) sega74rus (15) sgt.angel (6) Shad0w (11) ShoTaXx# (7) sicilia (7) sicman_adrian (22) skillz92 (7) sn4k3 (18) Snake12 (7) snake38 (10) sonicsight (7) SpeedFreak (9) spoonman184 (12) stabby (22) stas (27) Stirni (6) stonedegg (8) Strontium Dog (30) SumGuy14 (25) SuperDave (49) surfteam (5) TaCo (5) TanaToS (17) Tealk (6) teowow (16) TheCheeTaH (27) TheDonFather (5) theresthatguy (6) Tiny Tod (7) tooshkan4uk (8) Totyahun (9) uedi (38) ultimatebuster (6) Undead (25) usernamesaretaken (15) wanted241 (9) Warren (13) westham (6) WhiteAvenger (7) Wonder (14) Wundermaxe (5) X-Mania (5) XE_ManUp (14) xfalcon61 (5) zSweetXz (5) ZZMatty (6) [Cs]Lord_Inferno2 (11) [DAP]Kickbutt (5) [NATO]Hunter (28) ||Wolf|| (10)
Search

Post new topic This topic is locked, you cannot edit posts or make further replies.
Go to page 1, 2, 3  Next
Author Message
User avatar
Site Administrator
Site Administrator
Profile

Posts: 7640
Location:
At Work
 
New postPosted: 2006-04-30, 4:19 pm 
   Post subject: (Older Release) EventScripts v1.0 for Windows and Linux

Mattie's EventScripts
Updated on: 2006-05-14
Current Version: v1.0.0.018
Download: :arrow: All Platforms
Platforms: Windows and Linux
Beta Test Server: 205.234.191.34:27015.

Description:
    EventScripts v1.0 still supports all existing script packs with zero script changes. Please test your existing script packs to be sure everything is working great.

    The new EventScripts supports a lot of new commands and a new "addon" model for scripts with lots of new functionality. In addition, very handy in-game commands are now provided to give you far more power than scripters had before.

    Major new features:
    • Script Addons (es_load)
      • New script model for advanced scripters
      • Contained in a single script file instead of dozens of .cfg files
      • These new scripts live in addons/eventscripts/ instead of cfg/events .
      • Script addons support nested "if" blocks and "else" blocks (through "if ... do" and "else do").
      • Example script addons included with EventScripts: MugMod and Attract
    • Internal game properties (es_getplayerprop)
      • You can now query and tweak many internal values for players and entities.
      • (Special thanks to c0ldfyr who provided the example I've greatly extended for these ServerClass properties.)
      • See this thread for examples
    • Entity creation and manipulation (es_give and es_fire)
    Skip to the Detailed Description section below to see live examples of these.
Installation:
  • Existing script packs still work 100%. Leave them where they are. Only the new "script addons" use a different location.
  • Download: :arrow: All Platforms - The .zip file contains the folder structure you need-- upgrade by overwriting the EventScripts v0.9.5.1 files with those listed below.
  • Copy these files into the appropriate directory on your server. (If you extract the .zip from the game directory, e.g. cstrike, then it should all go into the right place.)
    Code:
    addons/mattie_eventscripts.dll
    addons/mattie_eventscripts.res
    addons/mattie_eventscripts.vdf
    addons/mattie_eventscripts_i486.so

    addons/eventscripts/diag/es_diag.txt
    addons/eventscripts/corelib/es_corelib.txt
    addons/eventscripts/mugmod/es_mugmod.txt
    addons/eventscripts/attract/es_attract.txt
    addons/eventscripts/unittest/es_unittest.txt
    addons/eventscripts/syphon/es_syphon.txt
    addons/eventscripts/slingshot/es_slingshot.txt
  • If you wish to activate any of the script addon examples, use es_load. For example:
    cfg/autoexec.cfg
    Code:
    mattie_eventscripts 1
    // Note: be sure the old mugmod plugin is uninstalled
    es_load mugmod
    :arrow: Note: If you have the old version of MugMod installed (mattie_mugmod.dll or mattie_mugmod_i486.so), you need to remove it if you plan to use the new script version of Mugmod.
  • Restart your server.
Bug Fixes:
  • eventscripts_ver public variable has been reduced in size to reduce issues with HLSW
  • es_getuserid now properly looksup userids if you give it a STEAMID
  • es_rand now works when expanding variables
  • server_var() expansion will send "(protected)" instead of the contents of any FCVAR_PROTECTED server variable.
  • Fixed old crash in es_getplayerlocation if you didn't provide a variable
  • General performance improvements
  • All EventScripts console output will now be written to the server log if you turn on "eventscripts_debuglog 1", previously it was only debug messages.
  • Changed the way eventscripts_debug behaves such that eventscripts_debug 1 is light debugging, eventscripts_debug 2 is higher, etc, all the way to 5.
New packaging:
  • Linux and Windows in the same archive (zip)
  • Includes example script addons in the archive:
    • mugmod
    • attract
    • unittest
  • Includes diagnostic script, use "es_load diag" to run. Saves a bunch of EventScripts variables to es_diagnostics_db.txt (see es_diag.txt for more info).
New Server Variables:
  • eventscripts_protectrcon 1
    Causes EventScripts to add the FCVAR_PROTECTED flag to rcon_password. This makes it harder for anyone to ever accidentally output rcon_password via EventScripts.
New Events:
  • es_player_chat
    Fires whenever a player says something (either say or say_team).
    Code:
       "es_player_chat"            // a public player chat
       {
          "teamonly"      "bool"          // true if team only chat
          "userid"        "short"         // chatting player
          "text"          "string"        // chat text
       }
New Event Variables:
  • es_event - contains the name of the event
    Code:
    if (event_var(es_event) equalto "player_say") then es_msg In player_say!
  • es_userindex - the memory index of the user if userid is part of the event
  • es_attackerindex - the memory index of the attacker if attacker is part of the event
Enhanced Commands:
  • if
    • Supports new operators:
      • notgreaterthan - less than or equal to
      • notlessthan - greater than or equal to
      • in - returns true if x is found inside y (strings)
      • = (also ==) - equalto alternative
      • != - notequalto alternative
      • < - lessthan alternative
      • > - greaterthan alternative
      • => - notlessthan alternative
      • =< - notgreaterthan alternative
    • if (x op y) do support for blocks (doesn't work in cfg files, script addons only)
    • else do support for blocks (doesn't work in cfg files, script addons only)
    • else <command>
      NOT RECOMMENDED. Executes when the previous "if" statement was false.
  • es_msg #multi <message>
    Allows you to use multiple colors throughout your msg text (#default, #green and #lightgreen)
    Code:
    // outputs a multi-colored message
    es_msg #multi Change to#green green then change to#default default, then change to#lightgreen light green.
  • es_tell <userid> #multi <message>
    Allows you to use multiple colors throughout your msg text (#default, #green and #lightgreen)
    Code:
    // outputs a multi-colored message
    es_tell event_var(userid) #multi Change to#green green then change to#default default, then change to#lightgreen light green.
  • es_math var sin
    Sine of the value in var and stores it in var
  • es_math var cos
    Cosine on the value in var and stores it in var
  • es_math var tan
    Tangent on the value in var and stores it in var
  • es_math var power <exponent>
    Raises the value in var to the exponent and stores it in var
  • es_math var root <n>
    Takes the nth root of the value in var and stores it in var
  • es_math var abs
    Absolute value of value in var and stores it in var
  • es_string var replace <string> [withtext]
    Replace string with withtext. If withtext is excluded, it removes the string wherever found.
  • es_keygroupload <keygroup> [|][name]
    Add support for a special | prefix for the path which means that the keygroup should be loaded from: addons/eventscripts/name/es_keygroup_db.txt
    Code:
    // for CS:S loads from
    // cstrike/addons/eventscripts/mugmod/es_mykeygroup_db.txt
    es_keygroupload mykeygroup |mugmod
  • es_keygroupsave <keygroup> [|][name]
    Add support for a special | prefix for the path which means that the keygroup should be saved to: addons/eventscripts/name/es_keygroup_db.txt
    Code:
    // for CS:S saves to
    // cstrike/addons/eventscripts/mugmod/es_mykeygroup_db.txt
    es_keygroupsave mykeygroup |mugmod
New Commands:
  • es_strlen <var> "<string-to-measure>"
    Stores the length of the string into var.
  • es_xnq <command>
    Removes quotes same as esnq but does not expand any variables.
  • es_soon <command>
    es_xsoon <command>
    Places the command at the end of the current command-queue. (Runs sooner than es_delayed 0.00001, but isn't "in-line" like a normal command. Pretty much like you typed the command at the console. Be careful with event_var()'s just as you would be with es_delayed.)
  • es_doblock <blockname>
    Executes a named block of code from a script addon file
  • else <command>
    NOT RECOMMENDED. Execute command when the previous if call returned false. (You have to be careful with this function.)
  • else do
    Will execute the following block if the previous if do call returned false. (Not supported in cfg files.)
  • es_xelse (same as else but no variable expansion)
  • es_load <scriptname>
    Loads and enables a stand-alone script addon from addons/eventscripts/script/es_script.txt. If no script is provided, it lists the state of all loaded addons to the console.
  • es_unload <scriptname>
    Unloads a stand-alone script addon
  • es_disable <scriptname>
    Disables a loaded stand-alone script addon
  • es_enable <scriptname>
    Enables a loaded stand-alone script addon
  • es_getentityindex <var> <entity-name>
    Stores in var the index of the first entity with the name provided. This index is used for es_getindexprop and es_setindexprop.
    Code:
    // stores the internal index for the c4
    es_getentityindex myvariable weapon_c4
  • es_getindexprop <variable> <index> <propertypath>
    Looks-up an entity at a particular index, finds the value for the named ServerClass property and stores it in variable. Use with caution.
    Code:
    // if you have the hostage index, looks up their health and stores in myvar
    es_getindexprop myvar server_var(hostage_index) "CHostage.m_iHealth"
  • es_setindexprop <index> <propertypath> <value>
    Sets a server class property for the given entity (at index). Use with caution.
    Code:
    // if you looked-up the team entity index, this sets the team score to 10
    es_setindexprop server_var(myteamindex) CCSTeam.baseclass.m_iScore 10
  • es_getplayerprop <variable> <userid> <propertypath>
    Looks-up a player, finds the value for the named ServerClass property and stores it in variable. Use with caution.
    Code:
    // is the player wearing a helmet in CS:S?
    es_getplayerprop myvar event_var(userid) CCSPlayer.m_bHasHelmet
  • es_setplayerprop <userid> <propertypath> <value>
    Sets a server class property for the given entity (at index). Use with caution.
    Code:
    // sets a CS:S player's cash
    es_setplayerprop event_var(userid) CCSPlayer.m_iAccount 16000
  • es_dumpentities
    Dumps to console a list of all entities and their current ServerClass values (writes to the server log if eventscripts_debuglog 1)
  • es_dumpserverclasses
    Enumerates all possible ServerClass types and lists the type and name of structures. Dumps info to console (writes to the server log if eventscripts_debuglog 1).
  • es_give <userid> <entity>
    Gives the named entity to the user specified by userid
    Code:
    // gives the player an awp
    es_give event_var(userid) weapon_awp
  • es_fire <userid> <target> [action] [value] [delay]
    Behaves just like ent_fire sent from the player. (Garry's Mod has some great examples for uses.)
    Code:
    // tells all awps that they should catch on fire
    es_fire event_var(userid) weapon_awp ignite
  • es_remove <entity-name>
    Destroys all entities using the internal name provided by entity-name.
    Code:
    // removes all awps
    es_remove weapon_awp
  • es_entsetname <userid> <entity-name>
    Works just like Valve's "ent_setname"-- provides internal name for the entity the player is looking at.
    Code:
    //renames the entity the player is looking at
    es_entsetname event_var(userid) weapon_MattieAwp
  • es_setpos <userid> <x> <y> [z]
    Teleports a player
    Code:
    // teleports a player
    es_setpos event_var(userid) 100.20 -200.99 -300
  • es_setang <userid> <pitch> <roll> [yaw]
    Snaps a player's eyes/views to a particular direction
    Code:
    // forces player's eyes to look in a direction
    es_setang event_var(userid) 0 100
  • es_createplayerlist <new-key-name> [userid]
    Creates a new keygroup containing the current list of players. If you provide userid, only returns data for that particular user.
    Code:
    // gives all players an awp
    es_createplayerlist mynewkey
    es_foreachkey tplayer in mynewkey "es_give server_var(tplayer) weapon_awp"
    es_keygroupdelete mynewkey
  • es_createentitylist <new-key-name> [entity-name]
    Creates a new keygroup containing the current list of all entities and their ServerClass properties. If you provide an entity name, only returns data entities with that name.
    Code:
    // retrieves ServerClass data for all awps
    es_createentitylist mynewkey weapon_awp
  • es_toptext <userid> <duration> <color> <message>
    Shows a message in the top left of the specified player's screen for <duration> seconds.
  • es_xtoptext <userid> <duration> <color> <message>
    Same as es_toptext, but variables are not expanded
  • es_cexec_all <command>
    Executes a command on all client's consoles.
    Code:
    // plays a sound on all clients
    es_cexec_all playgamesound bot/owned.wav
  • es_createvectorfrompoints <outputvar> <vectorstring-A> <vectorstring-B>
    Creates a vectorstring (stored in outputvar) that points from vector/point A to vector/point B.
  • es_createvectorstring <var> <x> <y> <z>
    Creates a string form of three x y z variables representing a vector.
  • es_splitvectorstring <var-x> <var-y> <var-z> <vectstring>
    Stores the vector's current x, y, and z as read from the vector in string form.
  • es_precachemodel <model-path>
    Tells the server to precache a particular model

Detailed Description:
Quote:
EventScripts v1.0 is fully backwards compatible with previous versions of EventScripts. That being said, EventScripts adds new dimensions to server-side console scripting that brings a lot of power to the cross-platform scripts that would normally be reserved for C++ plugins.

Highlights
We'll talk about each item in detail, but there are some very key differences in EventScripts v1.0. For starters, there is the concept of Script Addons. These are stand-alone script txt files that are loaded once and reside fully in memory. Instead of having separate CFG files for each event, all event code is stored and defined in a single file of the form es_scriptname.txt. The use of a stand-alone script addon opens the doors to a lot of conventional scripting constructs that aren't available in standard .cfg files (e.g. blocks, conditionals, etc.)

In addition, support has been added for entity propery values. With the es_*prop commands, you can read all sorts of internal Source values for entities without worrying about tracking hard-coded offset values. These commands open doors previously unavailable to scripts (and some even unknown to plugin authors).

And finally, the third big highlight of EventScripts v1.0 is the addition of entity events through the use of es_fire (like Valve's ent_fire command). This creates a lot of opportunity for scripts that customize maps and entities in many different ways. There are a variety of clever tricks in store that even full-fledged plugins haven't tried.

EventScripts Script Addons
(TODO: Complete this section)
Each line within a block in a script addon is pretty much the same as it was for the old .cfg scripts. (You can execute any console command, Mani, ES_Tools, etc.) There are just new block constructs and if do and else do conditional blocks. For now, here's an example of my RatesFor script pack redone in the form of a Script Addon:
Mattie wrote:
autoexec.cfg
Code:
es_load ratesfor

cstrike/addons/eventscripts/ratesfor/es_ratesfor.txt
Code:
// Mattie EventScripts v1.0.0+
// RatesFor Script

// init is always called when the addon is loaded
block load
{
   es_setinfo mattie_ratesfor 1
   es_makepublic mattie_ratesfor
}

event es_client_command
{
   if (server_var(mattie_ratesfor) = 1) do
   {
      es_msg event_var(command)
      if (event_var(command) = "!ratesfor") do
      {
         es_xsetinfo rate_playerid 0
         es_getuserid rate_playerid event_var(commandstring)
         if (server_var(rate_playerid) != 0) do
         {
            es_doblock ratesfor/output
         }
         else do
         {
            es_tell event_var(userid) #green [Rates] That user cannot be found.
         }

      }
   }
}

// blocks are special sections that you can call again and again
block output
{
   es_xsetinfo rate_playername 0
   es_xsetinfo rate_playersteam 0
   es_xsetinfo rate_output 0
   es_xsetinfo rate_rate 0
   es_xsetinfo rate_cmdrate 0
   es_xsetinfo rate_updaterate 0
   es_xsetinfo rate_interp 0
   es_getclientvar rate_rate server_var(rate_playerid) rate
   es_getclientvar rate_cmdrate server_var(rate_playerid) cl_cmdrate
   es_getclientvar rate_updaterate server_var(rate_playerid) cl_updaterate
   es_getclientvar rate_interp server_var(rate_playerid) cl_interp
   es_getplayername rate_playername server_var(rate_playerid)
   es_getplayersteamid rate_playersteam server_var(rate_playerid)
   es_format rate_output "Mattie's Rate Output Script\n--- Rates for ---\n%1\n%6\n \nrate: %2\ncl_cmdrate: %3\ncl_updaterate: %4\ncl_interp: %5\n" server_var

(rate_playername) server_var(rate_rate) server_var(rate_cmdrate) server_var(rate_updaterate) server_var(rate_interp) server_var(rate_playersteam)
   esnq ma_msay 4 event_var(userid) server_var(rate_output)

}


ServerClass Properties
(TODO: Complete this section)
es_dumpentities and es_dumpserverclasses are very helpful in understanding what properties are available.

Here's an example of a script that uses ServerClass Properties to create a cool mod effect:
Quote:
autoexec.cfg
Code:
es_load attract


cstrike/addons/eventscripts/attract/es_attract.txt
Code:
// EventScripts v1.0 example
// This script causes the attacker to be pulled forcefully towards the victim as he fires.
//   Can change gameplay significantly.

block load
{
   es_setinfo mattie_attract 1
   es_makepublic mattie_attract
   es_msg #green [Attract] Attract has been enabled.
}

event round_start
{
   if (server_var(mattie_attract) = 1) do
   {
      es_msg #green [Attract] Whenever you shoot someone, you will be pulled to them.
   }
}

event player_hurt
{
   if (server_var(mattie_attract) = 1) do
   {
      if (event_var(es_userteam) != event_var(es_attackerteam)) do
      {
         es_xsetinfo fA 0
         es_xsetinfo fB 0
         es_xsetinfo FC 0
         // get the location of the attacker
         es_getplayerprop fA event_var(attacker) "CBaseEntity.m_vecOrigin"
         // get the location of the victim
         es_getplayerprop fB event_var(userid) "CBaseEntity.m_vecOrigin"
         // create a vector from attacker to victim
         es_createvectorfrompoints FC server_var(fA) server_var(fB)
         // pull the attacker towards the victim
         es_setplayerprop event_var(attacker) "CCSPlayer.baseclass.localdata.m_vecBaseVelocity" server_var(FC)
         es_tell event_var(attacker) #green [Attract] You have been pulled towards event_var(es_username) for shooting him.
      }
   }
}


Entity Events and Fields
(TODO: Complete this section)
Awesome resource to get you started with neat things you can do:
http://gmwiki.garry.tv/index.php/Entity_Scripting_Guide

Here's an example script addon that makes use of all the tricks above:
Code:
// es_randwep.txt
//   Chooses a random weapon each round and gives
block load
{
   es_doblock randwep/randwep
   es_log Randwep enabled.
}

event round_end
{
   es_doblock randwep/randwep
}

event player_spawn
{
   // take away their weapons
   es_give event_var(userid) player_weaponstrip
   es_fire event_var(userid) player_weaponstrip Strip 1
   // take away their cash
   es_setplayerprop event_var(userid) CCSPlayer.m_iAccount 0
   // give them the random weapon
   es_delayed 1 es_give event_var(userid) server_var(todayweapon)
   es_tell event_var(userid) #multi #lightgreenRANDOM WEAPON CHOSEN:#green server_var(todayweapon)
}

block randwep
{
   es_xsetinfo randwep 0
   es_xrand randwep 1 25
   if (server_var(randwep) equalto 1) then es_xsetinfo todayweapon weapon_awp
   if (server_var(randwep) equalto 2) then es_xsetinfo todayweapon weapon_g3sg1
   if (server_var(randwep) equalto 3) then es_xsetinfo todayweapon weapon_sg550
   if (server_var(randwep) equalto 4) then es_xsetinfo todayweapon weapon_galil
   if (server_var(randwep) equalto 5) then es_xsetinfo todayweapon weapon_ak47
   if (server_var(randwep) equalto 6) then es_xsetinfo todayweapon weapon_scout
   if (server_var(randwep) equalto 7) then es_xsetinfo todayweapon weapon_sg552
   if (server_var(randwep) equalto 8) then es_xsetinfo todayweapon weapon_famas
   if (server_var(randwep) equalto 9) then es_xsetinfo todayweapon weapon_m4a1
   if (server_var(randwep) equalto 10) then es_xsetinfo todayweapon weapon_aug
   if (server_var(randwep) equalto 11) then es_xsetinfo todayweapon weapon_glock
   if (server_var(randwep) equalto 12) then es_xsetinfo todayweapon weapon_usp
   if (server_var(randwep) equalto 13) then es_xsetinfo todayweapon weapon_p228
   if (server_var(randwep) equalto 14) then es_xsetinfo todayweapon weapon_deagle
   if (server_var(randwep) equalto 15) then es_xsetinfo todayweapon weapon_elite
   if (server_var(randwep) equalto 16) then es_xsetinfo todayweapon weapon_fiveseven
   if (server_var(randwep) equalto 17) then es_xsetinfo todayweapon weapon_m3
   if (server_var(randwep) equalto 18) then es_xsetinfo todayweapon weapon_xm1014
   if (server_var(randwep) equalto 19) then es_xsetinfo todayweapon weapon_mac10
   if (server_var(randwep) equalto 20) then es_xsetinfo todayweapon weapon_tmp
   if (server_var(randwep) equalto 21) then es_xsetinfo todayweapon weapon_mp5navy
   if (server_var(randwep) equalto 22) then es_xsetinfo todayweapon weapon_ump45
   if (server_var(randwep) equalto 23) then es_xsetinfo todayweapon weapon_p90
   if (server_var(randwep) equalto 24) then es_xsetinfo todayweapon weapon_m249
   if (server_var(randwep) equalto 25) then es_xsetinfo todayweapon weapon_knife
}



Special Thanks:
    Special thanks goes out to the amazing beta testers. This release is far better due to their awesome suggestions and feedback. In alphabetic order:
      :!: Ace Rimmer
      :!: awuh0
      :!: cagemonkey
      :!: Don
      :!: Einlanzers
      :!: ichthys
      :!: Intelligence
      :!: laderan210
      :!: mIKesReVeNGe
      :!: orion78fr
      :!: Seth_Rose
      :!: SumGuy14
      :!: TIM3PORT
      :!: XE_ManUp
      :!: [NATO]Hunter
      :!: [SAS]==Colster==


Download: :arrow: All Platforms

Updates:
Mattie wrote:
Hey everyone-- I just released a bug fix version of v1.0 that includes the following changes:

EventScripts v1.0.0.16 Beta:
  • es_toptext should now colorize properly
  • es_load is much more tolerant of random spaces inside script files (i.e. copy-and-paste problems)
  • Updated MugMod example with bug fix
New additions:
  • Added es_corelib.txt v0.1 to the distribution. This will become a library for general routines that scripts find necessary. It has two commands at the moment:
    • es_doblock corelib/noisy_on
    • es_doblock corelib/noisy_off
    These allow scripts to reference count the eventscripts_noisy variable such that they don't collide with one another. See the Mattie's Slingshot example for an example of how to use this.
  • Added Mattie's KnifeSyphon example to the distribution as an example. Use es_load syphon in autoexec.cfg if you want to turn on knife-kill healing.
  • Added Mattie's Slingshot to the distribution as an example. Use es_load slingshot in autoexec.cfg if you want the default pistols to propel you around the map when you fire them (sorta like grappling hooks: you'll have lots of deaths and fun mastering this).


Download:
http://mattie.info/downloads/mattie_eventscripts.zip


Last edited by Mattie on 2006-09-13, 9:55 pm, edited 20 times in total.




User avatar
Regular
Profile

Posts: 150
 
New postPosted: 2006-05-01, 1:12 am 

Some of these new features are so exciting I just can't help but piss my pants every time I think about them.

Thanks for the great work, Mattie!

_________________
-Faaip
http://www.toolcs.com/


User avatar
Moderator
Moderator
Profile

Posts: 3180
Location:
10,000 feet

Steam Friends Name: Phil Pendlebury
 
New postPosted: 2006-05-01, 2:31 am 

Forgot me again. LOL...

Don't worry Mattie, I'm sure it's not intentional... :-) Congrats on the release anyway.

Everyone, get it on now, it rocks! :-)

_________________
How To: Download Ace Event Scripts
How To: Install ES + Scripts
How To: Get Scripts Running (for users)
How To: Get Scripts Running (for scripters)
How To: Using the MACE Clients Converter

Phil Pendlebury (Ace Rimmer)

http://www.pendlebury.biz - http://www.meap.biz - http://www.axeskillz.com - http://www.digital96.com - http://www.riffsandrays.com


User avatar
New User
Profile

Posts: 1
 
New postPosted: 2006-05-01, 6:02 am 

Liking the release ;)

although, have to admit it doesn't rock.


It shakes the fabric of the known universe! :o


User avatar
Site Administrator
Site Administrator
Profile

Posts: 7640
Location:
At Work
 
New postPosted: 2006-05-01, 6:51 am 

Ace Rimmer wrote:
Forgot me again. LOL...

Don't worry Mattie, I'm sure it's not intentional... :-) Congrats on the release anyway.

Everyone, get it on now, it rocks! :-)


:o :oops:

I copied and pasted these so I can't believe I left your name off. I've hereby placed your name at the top of the list to show my appreciation, Ace! It helps that your name comes first alphabetically, too. ;)

Sorry about that, sir! Your help is always wildly appreciated.

_________________
Got errors? Try searching ErrorHelp first.
EventScripts won't load? Read Known Issues first.


Last edited by Mattie on 2006-05-16, 9:10 pm, edited 1 time in total.

User avatar
Moderator
Moderator
Profile

Posts: 3180
Location:
10,000 feet

Steam Friends Name: Phil Pendlebury
 
New postPosted: 2006-05-01, 6:58 am 

LOL. Thanks Mattie. I guess I could always change my nick name to "Zace Rimmer".

Anyways sorry to OT the thread and congrats once again.

I am having absolutely zero problems with the latest version so far.

_________________
How To: Download Ace Event Scripts
How To: Install ES + Scripts
How To: Get Scripts Running (for users)
How To: Get Scripts Running (for scripters)
How To: Using the MACE Clients Converter

Phil Pendlebury (Ace Rimmer)

http://www.pendlebury.biz - http://www.meap.biz - http://www.axeskillz.com - http://www.digital96.com - http://www.riffsandrays.com


User avatar
Experienced
Profile

Posts: 443
Location:
Scotland
 
New postPosted: 2006-05-01, 7:25 am 

Nice work Mattie, thanks for the mention. :)


User avatar
Newbie
Profile

Posts: 57
 
New postPosted: 2006-05-01, 12:08 pm 

Hi

I upgraded to the v1.0.0.015 beta today, and installed ace rates alongside. In the space of 1 hour my SRCDS application has crashed twice, with

The instruction at "0x00e32723" referenced memory at "0x11ae00a8". The memory could not be "read"

And

The instruction at "0x00e32723" referenced memory at "0x11ae00c0". The memory could not be "read"

I have since removed acerates and installed the 0.9.5.1 version of eventscripts. FYI, my server is also running the beta of mani 1.2RC7 and had the following scripts running.

CounterBet
OneAndOnly
MugMod

Before this my server was perfectly stable. If i can help or you need more information, please let me know!


User avatar
Site Administrator
Site Administrator
Profile

Posts: 7640
Location:
At Work
 
New postPosted: 2006-05-01, 12:15 pm 

Thanks toytown-- do you by chance know what was happening on the server at the time of crash? (Player connecting, etc?)

Do you have any server logs from before the crash?

Since the only scripts there using 'new stuff' was Ace_Rates and MugMod can you disable those and see if the problem goes away?

Do you have any other plugins installed other than Mani?

Thanks for your feedback,
-Mattie


User avatar
Newbie
Profile

Posts: 44
 
New postPosted: 2006-05-01, 12:16 pm 

is there any new command to make says invisible like es_tools sayhooks ?


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 4290
Location:
Michigan
 
New postPosted: 2006-05-01, 12:22 pm 

I don't think so.

_________________
Image


User avatar
Newbie
Profile

Posts: 57
 
New postPosted: 2006-05-01, 12:28 pm 

Quote:
do you by chance know what was happening on the server at the time of crash?


The first time i was connected, the only thing i remember was the bomb was about 10 seconds left to go, and it crashed.

Quote:
Do you have any server logs from before the crash?


I have logs but they dont seem to get written to disk fast enough? i.e., the first crash happened at 17:40:09 but the last log for that session was made at 17:33:16, the second crash happened at 17:57:02 but the last log for that session was recorded at 17:56:52. Im guessing i must use a setting to stop it caching the information and get it to write it directly to disk immediately.

Quote:
Since the only scripts there using 'new stuff' was Ace_Rates and MugMod can you disable those and see if the problem goes away?


I'll definetely give it a try in an hour or two.

Quote:
Do you have any other plugins installed other than Mani?


Nope just mani and eventscripts.


User avatar
New User
Profile

Posts: 6
 
New postPosted: 2006-05-01, 6:00 pm 

Klan-host.co.uk
we shall test your new script wed sometime looks simple enough to intigrate to our klanpanel for auto install just looks like a move from the cfg folder to addons thats all

thanks for the top scripts here guys keep em rolling it keeps us hosting ppl in business


User avatar
Veteran
Profile

Posts: 872
Location:
New Jersey
 
New postPosted: 2006-05-01, 9:11 pm 

don is confusing me.....

aren't all new scripts inside the addons folder as they get called from in there.

why would they put new scripts inside a new folder in the cfg folder....????

_________________
Image
BYFBO. Custom Maps, http://www.pandatales.org/BYFBO_maps.html


User avatar
EventScripts Administrator
EventScripts Administrator
Profile

Posts: 2983
Location:
Tampa, FL
 
New postPosted: 2006-05-01, 9:19 pm 

TIM3PORT wrote:
don is confusing me.....

aren't all new scripts inside the addons folder as they get called from in there.

why would they put new scripts inside a new folder in the cfg folder....????


Ok...for clarification: there are two forms of "script types" that will work with EventScripts.

:arrow: One is located in the "eventscripts_subdirectory" based out of the "cfg" directory, e.g. cstrike/cfg/events. These are script packs. Script packs are placed in their own folder and corresponding configs for that script that will be executed if the script pack is registered are placed inside the folder, to make it a script pack.

:arrow: The other is the newer script-based version. These are placed in the cstrike/addons/eventscripts/<scriptname> folder. The scripts are all one file, which is a single text file. So, in the example of my new version of XE_Bet, it would look like this: cstrike/addons/eventscripts/xe_bet/es_xe_bet.txt

Does that make any more sense? Basically, with the newer script files, it loads every event from within a text file instead of having several separate config files.

_________________
"If life had an SDK, only the smart people would survive."
"I got tired of my wife being my page file, so I ordered more memory from Newegg."
Image
Image
Image


User avatar
Experienced
Profile

Posts: 344
 
New postPosted: 2006-05-01, 9:44 pm 

[FOUND BUG] Im 99% sure this is a bug with es_setpos when ever you save come coords in var's the x coord will all ways get subtracted 1035.962555 when you try and ues es_setpos

e.g. say you save var's
es_setinfo telex 1035.962555
es_setinfo teley 1035.962555
es_setinfo telez 1035.962555
and then you try and ues
es_setpos 71 server_var(telez) server_var(teley) server_var(telez)

it will teleport them to point
x=(0) y=(1035.962555) z=(1035.962555)

_________________
Why dont birds fly like fish swim? :P


User avatar
Historian
Historian
Profile

Posts: 2542
Location:
Under your rug
 
New postPosted: 2006-05-01, 9:51 pm 

Well you don't have server_var(telex) in your es_setpos command...

_________________
Image


User avatar
Helper
Profile

Posts: 264
 
New postPosted: 2006-05-01, 10:10 pm 

I have a question :mrgreen: which will help a lot of noobs (like me) out along the way.

Do we keep the 0.9.5.1 version of event script files (the 3 files) in cstrike\addons and also install the Source 0.1.0?
Or do we need to delete the 3 files that come with 0.9.5.1 and only use the files that downloaded with 0.1.0?


Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 49 posts ]  Go to page 1, 2, 3  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group