View Single Post
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 09-13-2006 , 19:14   Why doesn't this code work?
Reply With Quote #1

Hi, this code is "supposed" to play a sound when say_team is used, to ONLY the team of the player that typed. I don't know why it doesn't work, and hoping some of you elite coders can help me debug it.

Code:
public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_clcmd("say_team", "chatSoundTeam"); } public chatSoundTeam(id) {     new CsTeams:teamSaid = cs_get_user_team(id);     new players[32], playersDead[32];     new playerCount, i, playerCountDead, iDead;         get_players(players, playerCount, "a");     for(i=0; i<playerCount; i++) {         if(cs_get_user_team(i) == teamSaid) {             client_cmd(i, "speak sound/testing/talk.wav");         }     }         if(is_user_alive(id)) {         return PLUGIN_CONTINUE;     }     get_players(playersDead, playerCountDead, "b");     for(iDead=0; iDead<playerCountDead; iDead++) {         if(cs_get_user_team(iDead) == teamSaid) {             client_cmd(iDead, "speak sound/testing/talk.wav");         }     }         return PLUGIN_CONTINUE; }
hlstriker is offline