public RandMusic(g_Type){
if(!g_FirstPlay){
g_FirstPlay = true;
}
new g_SoundPath[128],
g_Name[96],
g_Format,
g_FileFormat;
switch(g_Type){
case 1:{
if(g_RandomMusic){
g_ValueTeam[0] = random(g_ArraySize[1]);
}
else{
g_ValueTeam[0]++;
if(g_ValueTeam[0] >= g_ArraySize[1]){
g_ValueTeam[0] = 0;
}
}
ArrayGetString(g_PathTT, g_ValueTeam[0], g_SoundPath, charsmax(g_SoundPath));
ArrayGetString(g_SoundNameTT, g_ValueTeam[0], g_Name, charsmax(g_Name));
}
case 2:{
if(g_RandomMusic){
g_ValueTeam[1] = random(g_ArraySize[0]);
}
else{
g_ValueTeam[1]++;
if(g_ValueTeam[1] >= g_ArraySize[0]){
g_ValueTeam[1] = 0;
}
}
ArrayGetString(g_PathCT, g_ValueTeam[1], g_SoundPath, charsmax(g_SoundPath));
ArrayGetString(g_SoundNameCT, g_ValueTeam[1], g_Name, charsmax(g_Name));
}
}
/* if(equal(g_LastSoundPath, g_SoundPath)){
RandMusic(g_Type);
return PLUGIN_HANDLED;
} */
copy(g_LastSong, charsmax(g_LastSong), g_Name);
g_Format = strlen(g_SoundPath) - 4;
if(equal(g_SoundPath[ g_Format ], ".mp3")){
g_FileFormat = 1;
}
else{
g_FileFormat = 2;
}
for(new i = 1; i <= g_MaxPlayers; i++){
if(is_user_connected(i) && g_RoundSound[i]){
switch(g_FileFormat){
case 1:{
client_cmd(i, "mp3 play %s", g_SoundPath);
}
case 2:{
client_cmd(i, "spk %s", g_SoundPath);
}
}
}
}
return PLUGIN_CONTINUE;
}
ublic ShowAds(){
for(new i = 1; i <= g_MaxPlayers; i++){
if(is_user_connected(i) && g_ShowAds[i]){
switch(random(3)){
case 0:{
ColorChat(i, TEAM_COLOR, "[%s]^x04 Chcesz %s roundsound? Napisz^x03 /roundsound ^x04lub^x03 /rs", g_Prefix, g_RoundSound[i] ? "wylaczyc" : "wlaczyc");
}
case 1:{
ColorChat(i, TEAM_COLOR, "[%s]^x04 Podobala Ci sie ostatnia piosenka, a nie pamietasz jej nazwy? Napisz^x03 /last", g_Prefix);
}
case 2:{
ColorChat(i, TEAM_COLOR, "[%s]^x04 Chcesz posluchac utworow CT / TT? Napisz^x03 /roundsound ^x04lub^x03 /rs", g_Prefix);
}
}
}
}
}