Raised This Month: $ Target: $400
 0% 

Need help with my song script


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-26-2005 , 23:30  
Reply With Quote #2

Variables! Arrays in this case.

Code:
 #include <amxmodx>  #include <amxmisc>  #include <cstrike>  new song_on[33] = { 1, ... };  public plugin_init()  {     register_plugin("Theme Music Player", "0.1", "Demonic")     register_cvar("play_song","1")     register_logevent("play_theme_song",2,"0=World triggered","1=Round_Start")     register_clcmd("say /song","cmdSong")  }  public cmdSong(id)  {     if(song_on[id] == 0)     {         song_on[id] = 1         client_print(id,print_chat,"* You will now hear the song on round start")     }     else     {         song_on[id] = 0         client_print(id,print_chat,"* You will no longer hear the song on round start")     }     return PLUGIN_HANDLED  }  // reset variables when user leaves  public client_disconnect(id)  {     song_on[id] = 1;  }  public play_theme_song()  {     if(get_cvar_num("play_song") == 0)     {         return PLUGIN_HANDLED     }     new players[32], num, i     get_players(players,num)     for(i=0;i<num;i++)     {         new player = players[i]         if(song_on[player] == 1) {             client_cmd(id,"spk misc/CDC2562.wav")         }     }     client_print(0,print_chat,"Welcome to *Team-@[CoDc] Clan Server. Got POONED?")     return PLUGIN_HANDLED  }  public plugin_precache()  {     precache_sound("misc/CDC2562.wav")  }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 09:54.


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