CS2D
Scripts
Destroying building and Round end..
Destroying building and Round end..
1 reply 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
DC Admin
Offline
Who won?
endround - I just added the modes which were only listed at
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
object with the parameters 0,table and loop over all objects (see example on the command reference page).
Use
object player to get the player who owns that building
In case it's the right player (if-condition):
damageobject (this is a CS2D command and no Lua command so use it with
parse - also use
object health to get the health value for the damage parameter or just use a very high damage value)