Заказать игровой сервер Контакты (заказать плагин/исправить ошибки/другое) Пожертвовать Поиск

[ вход ]
[ последние сообщения ]

  • Страница 1 из 1
  • 1
Плиз помогите найти ошибку в плагине
scorpion2904 Дата: Четверг, 06.09.2012, 11:42:08 | Сообщение # 1
Сообщений: 68
Репутация: 5 [ +/- ]
Сделал плагин для включения игрокам музыки через sm_play.
Он работает , но в консоле пишет : "Не найден подходящий игрок"

Добавлено (06.09.2012, 11:42:08)
---------------------------------------------
#include <sourcemod>
#include <sdktools>

public Plugin:myinfo =

{
name = "Scorpion Super Admin",
author = "Scorpion",
description = "SoundMenu",
version = "1.00",
url = "http://deadzone.sosbb.net/"
}

new String:name[64];

public OnPluginStart()
{
RegAdminCmd("mus", ConsoleCmd, ADMFLAG_RESERVATION);
decl String:buffer[80];
PrecacheSound("music/res.mp3", true);
Format(buffer, sizeof(buffer), "sound/%s", "music/res.mp3");
AddFileToDownloadsTable(buffer)
}

public Action:ConsoleCmd(player,args){
if(GetUserAdmin(player))
{
if(!args){
new Handle:menu = CreateMenu(MenuHandler1);
SetMenuTitle(menu, "Which player?");

new String:playerName[64];
new String:playerIndex[6];
for(new client=1;client<GetMaxClients();client++){
if(IsClientInGame(client)){
IntToString(client,playerIndex,sizeof(playerIndex));
GetClientName(client,playerName,sizeof(playerName));
AddMenuItem(menu,playerIndex,playerName);
}
}
AddMenuItem(menu,"@all","Everyone");
SetMenuExitButton(menu,true);
DisplayMenu(menu, player, MENU_TIME_FOREVER);
}
return Plugin_Handled;
}
}

public MenuHandler1(Handle:menu, MenuAction:action, client, param2)
{
if (action == MenuAction_Select)
{
new String:info[64];
new String:playerName[64];
new String:playerIndex[6];
GetMenuItem(menu, param2, info, sizeof(info));
GetClientName(client, name, sizeof(name));
new Handle:musicmenu = CreateMenu(MenuHandler1);
SetMenuTitle(musicmenu, "Music Menu");
AddMenuItem(musicmenu, "HL2_song4", "Adrenaline");
AddMenuItem(musicmenu, "HL2_song31", "Calm Battle");
AddMenuItem(musicmenu, "HL1_song17", "Calm Travel");
AddMenuItem(musicmenu, "HL2_song16", "Cautious Travel");
AddMenuItem(musicmenu, "HL2_song12_long", "Easy Battle");
AddMenuItem(musicmenu, "HL2_song7", "Entrance to Ravenholm");
AddMenuItem(musicmenu, "HL2_song6", "Final Ascend");
AddMenuItem(musicmenu, "HL1_song25_REMIX3", "Half-Life 1 Credits");
AddMenuItem(musicmenu, "HL2_song3", "Half-Life 2 Credits");
AddMenuItem(musicmenu, "HL2_song15", "Half-Life 2 Credits 2");
AddMenuItem(musicmenu, "HL2_song10", "Heavens");
AddMenuItem(musicmenu, "HL2_song17", "Horrific Discovery");
AddMenuItem(musicmenu, "HL2_song28", "Horror");
AddMenuItem(musicmenu, "HL2_song29", "Intense Escape");
AddMenuItem(musicmenu, "HL2_song14", "Journey");
AddMenuItem(musicmenu, "HL2_song25_Teleporter", "Majestical Horror");
AddMenuItem(musicmenu, "HL2_song23_SuitSong3", "Memories");
AddMenuItem(musicmenu, "HL2_song19", "Nova Prospekt");
AddMenuItem(musicmenu, "Ravenholm_1", "Ravenholm Ending");
AddMenuItem(musicmenu, "HL1_song10", "River Chase");
AddMenuItem(musicmenu, "HL2_song20_submix0", "Slow Battle");
AddMenuItem(musicmenu, "HL2_song20_submix4", "Slow Battle 2");
AddMenuItem(musicmenu, "HL2_song32", "Sad End");
AddMenuItem(musicmenu, "HL1_song11", "Source Engine");
AddMenuItem(musicmenu, "HL2_song33", "Spooky Place");
AddMenuItem(musicmenu, "HL1_song19", "Spooky Tunnel");
AddMenuItem(musicmenu, "Residend", "Resident");
SetMenuExitBackButton(musicmenu, true);
DisplayMenu(musicmenu, client, 0);
if(strcmp(info, "HL2_song4") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song4.mp3", playerName);
}
if(strcmp(info, "HL2_song31") == 0)
{
ClientCommand(client, "sm_play %d /music/HL2_song31.mp3", playerName);
}
if(strcmp(info, "HL1_song17") == 0)
{
IntToString(client,playerIndex,sizeof(playerIndex));
GetClientName(client,playerName,sizeof(playerName));
ClientCommand(client, "sm_play %d /music/HL1_song17.mp3", playerName);
}
if(strcmp(info, "HL2_song16") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song16.mp3", playerName);
}
if(strcmp(info, "HL2_song12_long") == 0)
{
ServerCommand("sm_play %N /music/HL2_song12_long.mp3", playerName);
}
if(strcmp(info, "HL2_song7") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song7.mp3", playerName);
}
if(strcmp(info, "HL2_song6") == 0)
{
ClientCommand(client, "sm_play @all /music/HL2_song6.mp3", playerName);
}
if(strcmp(info, "HL1_song25_REMIX3") == 0)
{
ClientCommand(client, "sm_play %N /music/HL1_song25_REMIX3.mp3", playerName);
}
if(strcmp(info, "HL2_song3") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song3.mp3", playerName);
}
if(strcmp(info, "HL2_song15") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song15.mp3", playerName);
}
if(strcmp(info, "HL2_song10") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song10.mp3", playerName);
}
if(strcmp(info, "HL2_song17") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song17.mp3", playerName);
}
if(strcmp(info, "HL2_song28") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song28.mp3", playerName);
}
if(strcmp(info, "HL2_song29") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song29.mp3", playerName);
}
if(strcmp(info, "HL2_song14") == 0)
{
ClientCommand(client, "sm_play %N HL2_song14.mp3", playerName);
}
if(strcmp(info, "HL2_song25_Teleporter") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song25_Teleporter.mp3", playerName);
}
if(strcmp(info, "HL2_song23_SuitSong3") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song23_SuitSong3.mp3", playerName);
}
if(strcmp(info, "HL2_song19") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song19.mp3", playerName);
}
if(strcmp(info, "Ravenholm_1") == 0)
{
ClientCommand(client, "sm_play %N /music/Ravenholm_1.mp3", playerName);
}
if(strcmp(info, "HL1_song10") == 0)
{
ClientCommand(client, "sm_play %N /music/HL1_song10.mp3", playerName);
}
if(strcmp(info, "HL2_song20_submix0") == 0)
{
ClientCommand(client, "sm_play v /music/HL2_song20_submix0.mp3", playerName);
}
if(strcmp(info, "HL2_song20_submix4") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song20_submix4.mp3", playerName);
}
if(strcmp(info, "HL2_song32") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song32.mp3", playerName);
}
if(strcmp(info, "HL1_song11") == 0)
{
ClientCommand(client, "sm_play %N /music/HL1_song11.mp3", playerName);
}
if(strcmp(info, "HL2_song33") == 0)
{
ClientCommand(client, "sm_play %N /music/HL2_song33.mp3", playerName);
}
if(strcmp(info, "HL1_song19") == 0)
{
ClientCommand(client, "sm_play %N /music/HL1_song19.mp3", playerName);
}
if(strcmp(info, "Resident") == 0)
{
ClientCommand(client, "sm_play %N /music/res.mp3", playerName);
}

return Plugin_Handled
}
}


Гости не могут скачивать файлы


Сообщение отредактировал scorpion2904 - Четверг, 06.09.2012, 11:39:38
 
Scarface_slv Дата: Пятница, 07.09.2012, 13:44:37 | Сообщение # 2
Сообщений: 737
Репутация: 61 [ +/- ]
У тебя весь код странный и вообще я ничего толком и не понял что ты хочешь. Там не особо понятно=)
Вот пример проигрывание музыки определенному игроку через меню.

Гости не могут скачивать файлы
 
scorpion2904 Дата: Пятница, 07.09.2012, 15:43:39 | Сообщение # 3
Сообщений: 68
Репутация: 5 [ +/- ]
А можно сделать чтоб игроки могли останавливать музыку?
 
Scarface_slv Дата: Пятница, 07.09.2012, 18:30:07 | Сообщение # 4
Сообщений: 737
Репутация: 61 [ +/- ]
Вроде можно вся тема про звуки тут http://world-source.ru/forum/100-2357-1 разбирайся.


Сообщение отредактировал Scarface_slv - Пятница, 07.09.2012, 18:39:50
 
scorpion2904 Дата: Пятница, 07.09.2012, 21:08:04 | Сообщение # 5
Сообщений: 68
Репутация: 5 [ +/- ]
СПС)
 
  • Страница 1 из 1
  • 1
Поиск: