Raised This Month: $ Target: $400
 0% 

Quick EventScripts examples question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rebell
Veteran Member
Join Date: Nov 2004
Location: GERMANY
Old 03-22-2005 , 02:34  
Reply With Quote #1

Hi Mattie,

great work ! My Q1:
can a make a config like "eventscript.cfg" and have i to execute this in my server.cfg ?

i made a script i want to use - is this correct ?!? :

Code:
// EVENTSCRIPT V.01 BY REBELL FOR T-O-M-B (www.t-o-m-b.de)
// =======================================================
// welcome message
es_tell event_var(userid) ah - a new victim on our server : event_var(name)!
// round end message
es_msg team event_var(winner) has won because event_var(reason) : event_var(message)
// bomb message
es_msg hey - they planted the bomb at: event_var(site). 
// admin message
if (event_var(text) equalto "admins") then es_xmsg [Info] ADMINS ON THIS SERVER ARE REBELL + VIPER
if (event_var(text) equalto "admin") then es_xmsg [Info] ADMINS ON THIS SERVER ARE REBELL + VIPER
// knifekill
if (event_var(weapon) equalto "knife") then es_tell event_var(attacker) HUMILIATION!
... or have i to edit everyone script from you ?

Q2: when someone leaves the server i want to play "goodbye.wav" - how to do ? (tnx for my n00b quests - i am no programmer ;))

TNX !!
__________________
Rebell is offline
joysticker
Member
Join Date: Mar 2005
Old 03-22-2005 , 07:35  
Reply With Quote #2

you cant put it all in one cfg file.
you have to put the code into the right ones

Code:
// welcome message 
es_tell event_var(userid) ah - a new victim on our server : event_var(name)
-> player_connect.cfg

Code:
// round end message 
es_msg team event_var(winner) has won because event_var(reason) : event_var(message)
-> round_end.cfg

Code:
// bomb message 
es_msg hey - they planted the bomb at: event_var(site).
-> bomb_planted.cfg
(personally i wouldnt like to have the bombsite announced)

Code:
// admin message 
if (event_var(text) equalto "admins") then es_xmsg [Info] ADMINS ON THIS SERVER ARE REBELL + VIPER
if (event_var(text) equalto "admin") then es_xmsg [Info] ADMINS ON THIS SERVER ARE REBELL + VIPER
-> player_say.cfg

Code:
// knifekill 
if (event_var(weapon) equalto "knife") then es_tell event_var(attacker) HUMILIATION!
-> player_death.cfg

once you've done all that, put the files into the cstrike/cfg/ folder of the server.

then it's all fine and should work, if not -> sorry ;)[/quote]
joysticker is offline
Mattie
Veteran Member
Join Date: Jan 2005
Old 03-22-2005 , 07:48   Topic split
Reply With Quote #3

Thanks a lot for clarifying, joysticker!

Rebell, I split this topic because the other thread was only for working script examples. I'd rather the questions get separate threads so other people will see them.

Quote:
Originally Posted by Rebell
or have i to edit everyone script from you ?
Rebell, you don't have to edit the scripts I provided, but they're a starting point. There are many, many other possible scripts that I don't create .cfg files for, but you need the config file to be named after the event you're trying to catch.

Player death scripts should go in player_death.cfg, say scripts should go in player_say.cfg, etc.

Quote:
Originally Posted by Rebell
Q2: when someone leaves the server i want to play "goodbye.wav" - how to do ?
This is a cute idea. I haven't tried this, but you should be able to accomplish this without much trickery. If you have Mani Admin's plugin and configured your sound within it. Just put the following line in a player_disconnect.cfg file:
Code:
ma_play 7
Where you should replace 7 with the sound you want to play when a player disconnects.

Hope this helps,
-Mattie
Mattie is offline
Rebell
Veteran Member
Join Date: Nov 2004
Location: GERMANY
Old 03-22-2005 , 09:46  
Reply With Quote #4

BIG TNX !!!

Ill try out - cya
__________________
Rebell is offline
Rebell
Veteran Member
Join Date: Nov 2004
Location: GERMANY
Old 03-22-2005 , 11:27  
Reply With Quote #5

Hi,

this dont work:
Code:
// welcome message
es_tell event_var(userid) ah - a new victim on our server : event_var(name)
but this does:
Code:
// bomb message
es_msg hey - they planted the bomb at: event_var(site).
hmmm ... and please could you put YOUR configs into /cfg/events/ so that we have a better file-structure ?

--- cya !
__________________
Rebell is offline
joysticker
Member
Join Date: Mar 2005
Old 03-22-2005 , 12:07  
Reply With Quote #6

the player_connect event starts whenever a play connects to the server.

so the message you print them might be printed when he's still seeing the steam loading bar

i read about mattie considering adding an own folder for the event-plugin
joysticker is offline
[TGC]spin
Senior Member
Join Date: Dec 2004
Old 03-22-2005 , 12:10  
Reply With Quote #7

Mattie this pluggin is the such fun..i love it....thank you....

i have most of my scripts done and sounds set up now....one more though..hehe

anyone know the code if a players gets killed by his own and not via the enemy.... eg: blowing himself up or falling of a high area to his death


I wanna make a string in my player_death.cfg so that when this happends
a sounds is played


Ps: many thanks for all your great help so far mattie "top man"
[TGC]spin is offline
joysticker
Member
Join Date: Mar 2005
Old 03-22-2005 , 13:31  
Reply With Quote #8

yeah there you go
player_death.cfg
Code:
if (event_var(attacker) equalto event_var(userid)) then ma_play 7
replace 7 with the sound you want to have played.

if someone kills himself, the weapon name is "world" (at least i read that somewhere)
so a script for people that kill themselves by falling down looks like this

Code:
if (event_var(weapon) equalto "world") then ma_play 8
and again, replace 8 with the right sound number ;)
joysticker is offline
Mattie
Veteran Member
Join Date: Jan 2005
Old 03-22-2005 , 14:41  
Reply With Quote #9

Quote:
Originally Posted by Rebell
this dont work:
Code:
// welcome message
es_tell event_var(userid) ah - a new victim on our server : event_var(name)
Yeah, player_connect seems to happen too early for the player to see it. I tried player_activate.cfg and I may have gotten a better experience, but I can't remember.

I'll see if I can think of anything interesting there.

Quote:
Originally Posted by Rebell
hmmm ... and please could you put YOUR configs into /cfg/events/ so that we have a better file-structure ?
It's on the feature request list-- your suggested location might be a good compromise. I want the files treated somewhat like config files, but it's probably better if they're separated. Putting them in a /cfg/ subdirectory might be good, but might also make it hard for some leased servers to take advantage of it.

I'll keep brainstorming.

Thanks for the suggestions,
-Mattie
Mattie is offline
[TGC]spin
Senior Member
Join Date: Dec 2004
Old 03-22-2005 , 16:07  
Reply With Quote #10

Quote:
Originally Posted by joysticker
yeah there you go
player_death.cfg
Code:
if (event_var(attacker) equalto event_var(userid)) then ma_play 7
replace 7 with the sound you want to have played.

if someone kills himself, the weapon name is "world" (at least i read that somewhere)
so a script for people that kill themselves by falling down looks like this

Code:
if (event_var(weapon) equalto "world") then ma_play 8
and again, replace 8 with the right sound number ;)

Thanks alot m8
[TGC]spin is offline
Reply



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

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

Forum Jump


All times are GMT -4. The time now is 06:25.


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