I'm now in another thread! I wanted to know how to get Team Score? For example:
If I'm CT, and I killed someone, The CT Team have increased a score, and if I'm TR, and I killed someone, The TR Team have increased a score! And when the game is over, I mean when the game shows the highscore, the sound is playing!
And I tried this code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>
new ct_score = 0
new t_score = 0
new const ct_win[] = "ct/yes!.wav"
new const t_win[] = "t/no!.wav"
public plugin_init() {
register_event("DeathMsg","onDeath","a") //This is the Death Event
register_event("30","TheEnd","a") //This is the Intermission Event, that means this event is used when the highscore shows
}
public onDeath() {
new iKiller = read_data(1)
new iVictim = read_data(2)
if (iKiller > 0 && iVictim > 0 && iKiller != iVictim) {
if (is_user_alive(iKiller)) {
if (cs_get_user_team(iKiller) == CS_TEAM_CT) {
ct_score += 0
}
if (cs_get_user_team(iKiller) == CS_TEAM_T) {
t_score += 0
}
}
}
}
public TheEnd(id) {
if (ct_score > t_score) {
client_cmd(id,"spk %s",ct_win)
}
if (ct_score < t_score) {
client_cmd(id,"spk %s",t_win)
}
}
But it not worked!
Can anyone help me?
And I'm sorry for what have I done with the thread. But I promise I'll never get wrong.