Forum

> > CS2D > Scripts > Destroying building and Round end..
Forums overviewCS2D overview Scripts overviewLog in to reply

English Destroying building and Round end..

1 reply
To the start Previous 1 Next To the start

old Destroying building and Round end..

Rainoth
Moderator Off Offline

Quote
Hey all, I need to understand few things.
• How to check which team won ?
My script will be running on ctf map and I want to know how to check which team won so I could give extra score for it or play a sound for all players in that team.. It's most likely going to use "endround" hook, right ? I know that you can check "if player(id,"team")" but that doesn't define whether the team won or not.. How Do I find this out ?

• How to destroy buildings for one particular player ?
Disconnecting would work but it's pointless so I need to know how to destroy buildings the player made and I think killobject would destroy all buildings instead of only those that the player made ?

Can anyone answer these questions ? Thanks

old Re: Destroying building and Round end..

DC
Admin Off Offline

Quote
• Who won?
cs2d lua hook endround - I just added the modes which were only listed at cs2d lua hook startround before.
> All even values mean: Ts win
> All uneven values: CTs win
> EXCEPT for the values below 10! You have to check those individually.

• How to destroy buildings for one particular player?
> use cs2d lua cmd object with the parameters 0,table and loop over all objects (see example on the command reference page).
> Use cs2d lua cmd object player to get the player who owns that building
> In case it's the right player (if-condition): cs2d cmd damageobject (this is a CS2D command and no Lua command so use it with cs2d lua cmd parse - also use cs2d lua cmd object health to get the health value for the damage parameter or just use a very high damage value)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview