achso, und noch was... hab das voice-plugin mit ein paar voice-dateien aufgepeppt...
ich habs mit dem plugin_speech kombiniert...
Code:
/* voice_plugin by Stillsetzhut */
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_STILLS 256
#define ACCESS_SERSET 128
#define ACCESS_VOTE_MUTE 1
#define FLAG_INVALID 0
#define FLAG_MUTE 1
new UserFlags[MAX_PLAYERS] = {FLAG_INVALID,...};
new STRING_VERSION[MAX_DATA_LENGTH] = "0.6";
AddUserFlag(UserIndex,Flag) {
new Name[MAX_NAME_LENGTH];
new VaultData[MAX_DATA_LENGTH];
new sAuthID[MAX_AUTHID_LENGTH];
UserFlags[UserIndex] = UserFlags[UserIndex] | Flag;
if (Flag == FLAG_MUTE && getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,_,_,_,_,sAuthID) != 0) {
if(get_vaultdata(sAuthID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData,"mute") == -1) {
strcat(VaultData,"mute",MAX_DATA_LENGTH);
set_vaultdata(sAuthID,VaultData);
}
}
else {
strcpy(VaultData,"mute",MAX_DATA_LENGTH);
set_vaultdata(sAuthID,VaultData);
}
}
}
}
CheckVaultFlags(UserIndex) {
new Name[MAX_NAME_LENGTH];
new sAuthID[MAX_AUTHID_LENGTH];
new VaultData[MAX_DATA_LENGTH];
new TargetName[MAX_NAME_LENGTH];
if (getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,_,_,_,_,sAuthID) != 0) {
if(get_vaultdata(sAuthID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData,"mute") != -1) {
UserFlags[UserIndex] = UserFlags[UserIndex] | FLAG_MUTE;
execclient(TargetName,"voice_enable 0");
}
}
}
}
}
RemoveUserFlag(UserIndex,Flag) {
new Name[MAX_NAME_LENGTH];
new sAuthID[MAX_AUTHID_LENGTH];
new VaultData[MAX_DATA_LENGTH];
UserFlags[UserIndex] = UserFlags[UserIndex] & ~Flag;
if (Flag == FLAG_MUTE && getvar("sv_lan") == 0) {
if (playerinfo(UserIndex,Name,MAX_NAME_LENGTH,_,_,_,_,sAuthID) != 0) {
if(get_vaultdata(sAuthID,VaultData,MAX_DATA_LENGTH) != 0) {
if (strcasestr(VaultData,"mute") != -1) {
strsubst(VaultData,"mute","", MAX_DATA_LENGTH);
set_vaultdata(sAuthID,VaultData);
}
}
}
}
}
public admin_voiceenable(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new User[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
execute_command(User,Command,"sv_voiceenable",Data);
if (check_param(Data) == 1) {
snprintf(Text,MAX_TEXT_LENGTH,"Voicerecording is online!!");
typesay(Text,10,68,255,125);
plugin_exec("admin_speakall","voice_on");
}
else {
snprintf(Text,MAX_TEXT_LENGTH,"Voicecommunikation is deactivated");
typesay(Text,10,255,40,44);
plugin_exec("admin_speakall","voice_off");
}
return PLUGIN_HANDLED;
}
public admin_alltalk(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new User[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
execute_command(User,Command,"sv_alltalk",Data);
if (check_param(Data) == 1) {
snprintf(Text,MAX_TEXT_LENGTH,"BE CAREFULL !!!^nEverybody hear your Voice!!^nsv_alltalk on");
typesay(Text,15,255,40,44);
}
else {
snprintf(Text,MAX_TEXT_LENGTH,"Keep cool,^nonly Teammates hear your Voice^nsv_alltalk off");
typesay(Text,10,68,255,125);
}
return PLUGIN_HANDLED;
}
public admin_voice(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new User[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
new Voice[MAX_DATA_LENGTH];
new Talk[MAX_DATA_LENGTH];
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
getstrvar("sv_voiceenable",Voice,MAX_DATA_LENGTH);
getstrvar("sv_alltalk",Talk,MAX_DATA_LENGTH);
snprintf(Text,MAX_TEXT_LENGTH,"voiceenable is %s^nalltalk is %s^n1 is on^n0 is off",Voice,Talk);
messageex(User,Text,print_tty);
return PLUGIN_HANDLED;
}
public SayCommand(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
new UserName[MAX_NAME_LENGTH];
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,UserName,MAX_NAME_LENGTH);
strstripquotes(Data);
if (streq(Data,"voice")==1) {
admin_voice(HLCommand,HLData,HLUserName,UserIndex);
}
return PLUGIN_CONTINUE;
}
public admin_mute(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new iIndex;
new TargetName[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
new User[MAX_NAME_LENGTH];
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
if (check_user(Data) == 1) {
get_username(Data,TargetName,MAX_NAME_LENGTH);
if(check_immunity(TargetName)!=0) {
snprintf(Text,MAX_TEXT_LENGTH,"You don't have access to mute %s, body.",TargetName);
messageex(User,Text,print_tty);
}
else {
get_userindex(TargetName,iIndex);
AddUserFlag(iIndex,FLAG_MUTE);
execclient(TargetName,"voice_enable 0");
snprintf(Text,MAX_TEXT_LENGTH,"%s is now muted from admin",TargetName);
typesay(Text,10,255,40,44);
messageex(TargetName,"[ADMIN] You have been muted, so SHUT UP!",print_tty);
selfmessage("Mute Succeeded for player: ");
selfmessage(TargetName);
}
}
else {
selfmessage("Unrecognized player: ");
selfmessage(Data);
}
return PLUGIN_HANDLED;
}
public admin_unmute(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new iIndex;
new TargetName[MAX_NAME_LENGTH];
new Text[MAX_TEXT_LENGTH];
new User[MAX_NAME_LENGTH];
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
if (check_user(Data) == 1) {
get_username(Data,TargetName,MAX_NAME_LENGTH);
get_userindex(TargetName,iIndex);
RemoveUserFlag(iIndex,FLAG_MUTE);
execclient(TargetName,"voice_enable 1");
snprintf(Text,MAX_TEXT_LENGTH,"%s is unmuted from admin",TargetName);
typesay(Text,10,68,255,125);
messageex(TargetName, "[ADMIN] You have been UNmuted. Restart your CS to enable voicecommunication.",print_tty);
selfmessage( "UNMute Succeeded for player: ");
selfmessage(TargetName);
}
else {
selfmessage("Unrecognized player: ");
selfmessage(Data);
}
return PLUGIN_HANDLED;
}
public admin_vote_mute(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new Text[MAX_TEXT_LENGTH];
new User[MAX_NAME_LENGTH];
if (vote_allowed()!=1) {
selfmessage("Vote not allowed at this time.");
return PLUGIN_HANDLED;
}
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
if (check_user(Data) == 1) {
new real_user[MAX_NAME_LENGTH];
get_username(Data,real_user,MAX_NAME_LENGTH);
if(check_immunity(real_user)!=0) {
snprintf(Text,MAX_TEXT_LENGTH,"You can't vote_mute %s, body.",real_user);
messageex(User,Text,print_tty);
}
else {
snprintf(Text,MAX_TEXT_LENGTH,"Mute %s ?",real_user);
vote(Text,"Yes","No","HandleMuteVote",real_user);
}
}
else {
selfmessage("Unrecognized user name ");
selfmessage(Data);
}
return PLUGIN_HANDLED;
}
public HandleMuteVote(WinningOption,HLUser,VoteCount,UserCount) {
new strNumber[MAX_NUMBER_LENGTH];
new Text[MAX_TEXT_LENGTH];
new iIndex;
new TargetName[MAX_NAME_LENGTH];
new VoteUser[MAX_DATA_LENGTH];
convert_string(HLUser,VoteUser,MAX_DATA_LENGTH);
if (WinningOption == 1) {
new Ratio = getvar("kick_ratio");
if (VoteCount >= Ratio*UserCount/100) {
snprintf(Text,MAX_TEXT_LENGTH,"%s was muted due to a vote.",VoteUser);
typesay(Text,10,68,255,125);
snprintf(Text, MAX_TEXT_LENGTH, "^n^n^nYou have been muted due to a vote.");
messageex(VoteUser,Text,print_tty);
get_userindex(TargetName,iIndex);
AddUserFlag(iIndex,FLAG_MUTE);
execclient(VoteUser,"voice_enable 0");
}
else {
numtostr(Ratio*UserCount/100,strNumber);
snprintf(Text,MAX_TEXT_LENGTH,"Mute vote succeeded, but not enough votes to mute %s (needed %s)",VoteUser,strNumber);
typesay(Text,10,255,40,44);
}
}
else {
say("The Mute Vote Was A Failiure.");
}
}
public plugin_connect(HLUserName,HLIP,UserIndex) {
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS) {
UserFlags[UserIndex] = FLAG_INVALID;
CheckVaultFlags(UserIndex);
}
return PLUGIN_CONTINUE;
}
public plugin_disconnect(HLUserName,UserIndex) {
new TargetName[MAX_NAME_LENGTH];
if (UserIndex >= 1 && UserIndex <= MAX_PLAYERS) {
UserFlags[UserIndex] = FLAG_INVALID;
execclient(TargetName,"voice_enable 1");
}
return PLUGIN_CONTINUE;
}
public plugin_init() {
plugin_registerinfo("Stills's Voice Plugin","Control servers and clients voicesettings",STRING_VERSION);
plugin_registercmd("admin_voice","admin_voice",ACCESS_ALL,"admin_voice - Display the Servers Voicesettingstatus");
plugin_registercmd("admin_vote_mute","admin_vote_mute",ACCESS_VOTE_MUTE,"admin_vote_mute <name or wonid> - Starts a vote to mute target.");
plugin_registercmd("admin_voiceenable","admin_voiceenable",ACCESS_SERSET,"admin_voiceenable <1 or 0> - sv_voiceenable on or off");
plugin_registercmd("admin_alltalk","admin_alltalk",ACCESS_STILLS,"admin_alltalk <1 or 0> - sv_alltalk on or off");
plugin_registercmd("admin_mute","admin_mute",ACCESS_STILLS,"admin_mute <name or wonid> - Mutes a players Voice Comm.");
plugin_registercmd("admin_unmute","admin_unmute",ACCESS_STILLS,"admin_unmute <name or wonid> - Unmutes a muted player.");
plugin_registercmd("say","SayCommand",ACCESS_ALL,"say voice - Display the Servers Voicesettingstatus");
return PLUGIN_CONTINUE;
}
achso, die sounds... (müssen in den sound/vox-ordner in cstrike)