Senior Member
Join Date: Mar 2017
Location: Palestine
|
05-24-2017
, 13:43
csgo musickit
|
#1
|
Hello guys.
i need someone rewrite this plugin with these sounds,
when you write kit1-kit5 ( 5 files, kit1 = folder 1 etc..) , play sounds automatic ( planting , win , lose sounds , etc.)
File is big, i can't upload it to forum , here is the download link : https://drive.google.com/open?id=0B2...XhjdWl6ZGhCc1k
PHP Code:
#include <amxmodx> #include <amxmisc> #include <cstrike>
new const PLUGIN[] = "CS:GO Music Kit for CS 1.6"; new const VERSION[] = "1.7.3"; new const AUTHOR[] = "hellmonja";
//These sounds are in arrays so we could match them with each other new const MUSIC[][] = { "startround_01.mp3", //0 "startround_02.mp3", //1 "startround_03.mp3", //2 "startaction_01.mp3", //3 "startaction_02.mp3", //4 "startaction_03.mp3", //5 "deathcam.mp3", //6 "bombplanted.mp3", //7 "bombtenseccount.mp3", //8 "roundtenseccount.mp3", //9 "wonround.mp3", //10 "lostround.mp3" //11 }
// Setting task with their IDs so we can remove them later enum (+= 100000) { TASKID_ROUND_TEN = 100000, // start with 100000 TASKID_BOMB_TEN }
new player_cache[32], player_kit[32], player_folder[32][45]; new bool_firstround = 1, bool_endofround, bool_bomb_planted ; new cvar_musickit_set, cvar_round_time, cvar_c4_time, cvar_freeze_time, cvar_musickit_howmany; new variant, client_cmds[6];
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_event("HLTV", "Event_New_Round", "a", "1=0", "2=0"); register_message(get_user_msgid("TextMsg"), "Event_End_Round"); register_event("DeathMsg", "Event_Death", "a"); register_logevent("Event_Start_Round", 2, "1=Round_Start"); register_logevent("Event_Bomb_Planted", 3, "2=Planted_The_Bomb"); register_logevent("Event_Round_Draw" , 4, "1=Round_Draw"); register_logevent("Event_Bomb_Defused", 3, "2=Defused_The_Bomb"); register_logevent("Event_BombTarget_Saved", 6, "3=Target_Saved") ; register_logevent("Remove_Tasks", 2, "1=Round_End"); // CVARS cvar_round_time = get_cvar_pointer("mp_roundtime"); cvar_c4_time = get_cvar_pointer("mp_c4timer"); cvar_freeze_time = get_cvar_pointer("mp_freezetime"); cvar_musickit_set = register_cvar("musickit_set", "1"); cvar_musickit_howmany = register_cvar("musickit_howmany", "5") for(new i = 0; i <= get_pcvar_num(cvar_musickit_howmany); i++) { formatex(client_cmds, charsmax(client_cmds), "kit%d", i); register_concmd(client_cmds, "ClientCommand_Select_Kit"); } register_concmd("debug", "Debug"); }
public Debug(id) { new players[32], playername[32], num; new team = get_user_team(id) get_players(players, num, "a"); for (new i = 1; i < num + 1; i++) { get_user_name(i, playername, charsmax(playername)); console_print(id, "%s: %s | %d", playername, player_folder[i], player_cache[i]); } client_print(1, print_chat, "TEAM: %d", team); client_print(1, print_chat, "First Round: %d", bool_firstround); console_print(id, "=============================="); }
public ClientCommand_Select_Kit(id) { static cmd[6]; read_argv(0, cmd, 5); new num = str_to_num(cmd[3]); player_cache[id] = num; client_print(id, print_chat, "Music Kit changed to %d.", num); client_print(id, print_chat, "Player: %d.", id); client_print(id, print_chat, "Source Folder: %s.", player_folder[id]); client_print(id, print_center, "Music Kit will change next round."); }
public Event_New_Round() { // Resetting some values for later bool_endofround = 0; bool_bomb_planted = 0; client_print(1, print_chat, "End Round: %d.", bool_endofround); client_print(1, print_chat, "Bomb Planted: %d.", bool_bomb_planted);
new players[32], num; get_players(players, num, "a"); for (new i = 1; i < num + 1; i++) { if(bool_firstround == 1) { player_cache[i] = get_pcvar_num(cvar_musickit_set); player_kit[i] = player_cache[i]; } else player_kit[i] = player_cache[i]; } if(get_pcvar_num(cvar_freeze_time) <= 2) { variant = random_num(0,2); return }
variant = random_num(0,2); Play_Music(0 + variant, 0, 0); }
public Event_Start_Round() { if(bool_endofround == 1) return Play_Music(3 + variant, 0, 0); client_print(1, print_center, "Works up till this point."); new Float:SecUntilRoundEnd = float((get_pcvar_num(cvar_round_time) * 60) - 10); // We calculate when there's only ten seconds left of round time set_task(SecUntilRoundEnd, "Round_Ten_Seconds_Left", TASKID_ROUND_TEN); // Setting task to play sound when only ten seconds of round time is left }
public Round_Ten_Seconds_Left() { if(bool_endofround == 1) return
// If is already planted, function is ignored if(bool_bomb_planted == 1) return
Play_Music(9, 0, 0); }
public Event_Bomb_Planted() { if(bool_endofround == 1) return bool_bomb_planted = 1; Play_Music(7, 0, 0); new Float:SecUntilExplosion = float(get_pcvar_num(cvar_c4_time) - 10); // Calculating when ten seconds is left on the C4 timer set_task(SecUntilExplosion, "Bomb_Ten_Seconds_Left", TASKID_BOMB_TEN); // Sets tasks when ten seconds of C4 timer is left }
public Bomb_Ten_Seconds_Left() { if(bool_endofround == 1) return
Play_Music(8, 0, 0); }
public Event_End_Round(id) { // We get what type of End Round we have... static textmsg[22]; get_msg_arg_string(2, textmsg, charsmax(textmsg)); //...and play the appropriate sound to each player according to their team if(equali(textmsg, "#Terrorists_Win")) //Terrorists Wins Play_Music(10, 1, 1); else if(equali(textmsg, "#CTs_Win")) //Counter-Terrorists Wins Play_Music(10, 2, 1); else if(equali(textmsg, "#Target_Bombed")) //C4 explodes, eliminates target Play_Music(10, 1, 1); else if(equali(textmsg, "#Hostages_Not_Rescued")) //Time ran out and hostages not rescued Play_Music(10, 1, 1); else if(equali(textmsg, "#VIP_Assassinated") || equali(textmsg, "#VIP_Not_Escaped")) //VIP killed or time ran out and VIP has not escaped Play_Music(10, 1, 1); else if(equali(textmsg, "#VIP_Escaped")) //VIP escapes Play_Music(10, 2, 1); }
// Plays victory sound for CT when C4 is defused public Event_Bomb_Defused(id) { if(bool_endofround == 1) return Play_Music(10, 2, 1); }
// Plays victory sound for CT when target has not been bombed public Event_BombTarget_Saved(id) { Play_Music(10, 2, 1); }
public Event_Round_Draw() { Play_Music(11, 0, 1); }
public Event_Death() { if(bool_endofround == 1) return
new id = read_data(2) // Getting index of player who just died Format_Music_Folder(id); client_cmd(id, "mp3 play ^"%s%s^"", player_folder[id], MUSIC[6]); }
public Remove_Tasks() { //Removing set tasks remove_task(TASKID_ROUND_TEN); remove_task(TASKID_BOMB_TEN);
// Resetting values for next round bool_endofround = 1; bool_bomb_planted = 0; }
public Play_Music(music, team, end) { new players[32], num; get_players(players, num); for (new i = 1; i < num + 1; i++) { Format_Music_Folder(i); if(end == 1) { if(team) // If one team wins { if(get_user_team(i) == team) client_cmd(i, "mp3 play ^"%s%s^"", player_folder[i], MUSIC[10]); else client_cmd(i, "mp3 play ^"%s%s^"", player_folder[i], MUSIC[11]); } else // When no one wins, everybody loses client_cmd(i, "mp3 play ^"%s%s^"", player_folder[i], MUSIC[11]); // The 1st round is when players are still connecting and game has not commenced. // To prevent the sound from playing after that, we do this check if(bool_firstround == 1) { bool_firstround = 0; return } } else client_cmd(i, "mp3 play ^"%s%s^"", player_folder[i], MUSIC[music]);
} }
stock Format_Music_Folder(id) { new iFolder[45]; if(player_kit[id] == 1) { if(CsTeams:get_user_team(id) == CS_TEAM_T) formatex(iFolder, charsmax(iFolder), "media/musickits/1/TER/"); else if(CsTeams:get_user_team(id) == CS_TEAM_CT) formatex(iFolder, charsmax(iFolder), "media/musickits/1/CT/"); else formatex(iFolder, charsmax(iFolder), "media/musickits/1/CT/"); } else if(player_kit[id] >> 1) formatex(iFolder, charsmax(iFolder), "media/musickits/%d/", player_kit[id]); player_folder[id] = iFolder; }
__________________
Last edited by Ayman Khaled; 05-24-2017 at 13:59.
|
|