Raised This Month: $51 Target: $400
 12% 

need your help: *theoneandonly-script*


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rebell
Veteran Member
Join Date: Nov 2004
Location: GERMANY
Old 04-20-2005 , 02:17   need your help: *theoneandonly-script*
Reply With Quote #1

hi you coders

i want a script that shows a message and plays a sound like "i am the one and only!" when one player of a team is left (one of t or one of ct) and the other teammates are dead.

this was in the old cs with amx - i think.

would be nice ...
__________________
Rebell is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 04-20-2005 , 03:08  
Reply With Quote #2

at round end or at any time there is only one team member left?
ajax is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 04-20-2005 , 03:37  
Reply With Quote #3

i haven't tested this, but this might be the basics. not sure about player_disconnect or player_team... if player_death is also triggered in those instances, the count will be off. the vars are reset @ round_end because i believe the (first?) player spawns before round_start... otherwise they can go in round_start. because of this, the first round will be wrong (after restart). it would be easy to make this feature skip the first round, but i excluded that for simplicity.

EDIT NOTE: REPLACE <INSERT SOUND HERE> WITH A MANI PLAYLIST # OR THE PATH TO A SOUNDFILE.

in server.cfg
setinfo alive_t 0
setinfo alive_ct 0

round_end.cfg
alive_t 0
alive_ct 0

player_spawn.cfg
if (event_var(es_userteam) equalto 2) then es_math alive_t + 1
if (event_var(es_userteam) equalto 3) then es_math alive_ct + 1

player_disconnect.cfg
if (event_var(es_userdead) equalto 0) then if (event_var(es_userteam) equalto 2) then es_math alive_t - 1
if (event_var(es_userdead) equalto 0) then if (event_var(es_userteam) equalto 3) then es_math alive_ct - 1

player_team.cfg (possibly unnecessary if player_death is also triggered)
if (event_var(es_userdead) equalto 0) then if (event_var(es_userteam) equalto 2) then es_math alive_t - 1
if (event_var(es_userdead) equalto 0) then if (event_var(es_userteam) equalto 3) then es_math alive_ct - 1

player_death.cfg
if (event_var(es_userteam) equalto 2) then es_math alive_t - 1
if (event_var(es_userteam) equalto 2) then if (server_var(alive_t) equalto 1) then es_msg Terrorist: THERE IS ONLY ONE!
if (event_var(es_userteam) equalto 2) then if (server_var(alive_t) equalto 1) then ma_play <INSERT SOUND HERE>
if (event_var(es_userteam) equalto 3) then es_math alive_ct - 1
if (event_var(es_userteam) equalto 3) then if (server_var(alive_ct) equalto 1) then es_msg Counter-Terrorist: THERE IS ONLY ONE!
if (event_var(es_userteam) equalto 3) then if (server_var(alive_ct) equalto 1) then ma_play <INSERT SOUND HERE>
ajax is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 04-20-2005 , 07:27  
Reply With Quote #4

player_disconnect shouldn't have the counter. What if someone thats dead disconnects?
Lets just hope that player_death runs before a player_disconnect
ichthys is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 04-20-2005 , 12:47  
Reply With Quote #5

Quote:
Originally Posted by ichthys
player_disconnect shouldn't have the counter. What if someone thats dead disconnects?
Lets just hope that player_death runs before a player_disconnect
i check for that situation with this part of the code...
Code:
if (event_var(es_userdead) equalto 0) ...
ajax is offline
Rebell
Veteran Member
Join Date: Nov 2004
Location: GERMANY
Old 04-20-2005 , 14:07  
Reply With Quote #6

tnx for your support !

@ajax: please test it before i do - you can script directly to an error !

TNX !
__________________
Rebell is offline
ajax
Veteran Member
Join Date: Jan 2005
Old 04-20-2005 , 15:03  
Reply With Quote #7

Quote:
Originally Posted by Rebell
@ajax: please test it before i do - you can script directly to an error !
EDIT: this script remains untested to see if player_team code is necessary.
ajax is offline
ichthys
Veteran Member
Join Date: Dec 2004
Location: []*[]
Old 04-20-2005 , 16:29  
Reply With Quote #8

ichthys is offline
Rebell
Veteran Member
Join Date: Nov 2004
Location: GERMANY
Old 04-21-2005 , 01:28  
Reply With Quote #9

*gg*

This title gives the forum to me - im not that really
I just test everything at my server and post suggestions, bugs and want to help others too (like in my own forum). But i will try myself this scipt at weekend - tnx so far !

cya
__________________
Rebell 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 22:17.


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