Raised This Month: $ Target: $400
 0% 

If-statement problems...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-21-2005 , 20:18   If-statement problems...
Reply With Quote #1

Ok this function is called when a player dies,


Code:
public eventDeath(id) {         if( get_cvar_num("amx_sound_events") < 1 ) {                 return PLUGIN_CONTINUE     }         new i         for( i = 1; i < get_maxplayers(); i++ ) {                 if( !is_user_connected(i) ) continue                 if( get_user_team(id) == get_user_team(i) && i != id ) {                         client_cmd(i, "spk ^"events/friend_died.wav^" " )                         if( get_cvar_num("amx_sound_notify") > 0 ) {                                 client_print(i, print_chat, "[AMXX] A friendly player died " )             }         }                 if( get_user_team(id) != get_user_team(i) && i != id ) {                         client_cmd(i, "spk ^"events/enemy_died.wav^" " )                         if( get_cvar_num("amx_sound_notify") > 0 ) {                                 client_print(i, print_chat, "[AMXX] An enemy player died " )             }                                 }             }         return PLUGIN_CONTINUE }


But this if statement is always executed no matter what team ' id ' or ' i ' is on. :/

Code:
if( get_user_team(id) != get_user_team(i) && i != id ) {                         client_cmd(i, "spk ^"events/enemy_died.wav^" " )                         if( get_cvar_num("amx_sound_notify") > 0 ) {                                 client_print(i, print_chat, "[AMXX] An enemy player died " )             }                                 }

I would apperciate any help

Thnx
--Zenith77
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
 



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 23:38.


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