Raised This Month: $ Target: $400
 0% 

If-statement problems...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 10-21-2005 , 21:46  
Reply With Quote #1

My style of programming is slightly different and some of my variables could probably be named better but...
Code:
public eventDeath(id) {     if( !get_cvar_num("amx_sound_events") ) return PLUGIN_CONTINUE         new iTeamID = get_user_team(id)     new iOtherID, iOtherTeamID     new players[32], iPlayerCnt     get_players(players, iPlayerCnt)         for( new i = 0; i < iPlayerCnt; i++ )     {         iOtherID = get_user_userid(players[i])         iOtherTeamID = get_user_team(iOtherID)                 if (iOtherID != id)         {             if (iTeamID == iOtherTeamID)             {                 client_cmd(i, "spk ^"events/friend_died.wav^" " )                             if( get_cvar_num("amx_sound_notify") )                 {                     client_print(i, print_chat, "[AMXX] A friendly player died " )                 }             }             else             {                 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 }
If you'd like to question anything I've done, please do so.
Brad is offline
Reply



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