O.K. werd ich machen,
Dann hab ich mal mein eigenes Script entworfen
.
Ich hab mal denn Code unten dran gehangen (Guck mal ganz oben im Code
).
Gruss
K!ller
Code:
/* K!ller alias Momo1988's Playsound Plugin 0.1 Beta (With the friendly assistance of Sir drink a lot and his Plugin speakto ) */
/* Have fun with it :D */
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
new STRING_VERSION[MAX_DATA_LENGTH] = "15.06.03";
new Key[]="am_sound";
public allowsound(User[]){
new Info[MAX_NUMBER_LENGTH];
new iInfo;
new Authid[MAX_AUTHID_LENGTH];
get_userAuthID(User,Authid,MAX_AUTHID_LENGTH);
if(strcmp(Authid,"BOT")!=0){
get_userinfo(User,Key,Info,MAX_NUMBER_LENGTH);
iInfo=strtonum(Info);
if(strlen(Info)==0 || iInfo>=1 ){/*damit wird automatisch immer der Sound auf 1 gesetzt,wenn kein setinfo vorhanden, bis 'stop' eingegeben wird*/
return 1;
}else{
return 0;
}
}
return 0;
}
public admin_sound(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
new Output[MAX_TEXT_LENGTH];
new Target[MAX_NAME_LENGTH];
new TargetName[MAX_NAME_LENGTH];
convert_string(HLData,Data,MAX_DATA_LENGTH);
strbreak(Data,Target,Output,MAX_TEXT_LENGTH);
if(check_user(Target) == 1){
get_username(Target,TargetName,MAX_NAME_LENGTH);
if(allowsound(Target)==1){
playsound(TargetName,Output);
}
}else{
selfmessage("Unrecognized player: ");
selfmessage(Target);
}
return PLUGIN_HANDLED;
}
public admin_soundall(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
new Target[MAX_NAME_LENGTH];
new i;
new maxplayers=maxplayercount();
convert_string(HLData,Data,MAX_DATA_LENGTH);
for(i=1;i<=maxplayers;i++){
if(playerinfo(i,Target,MAX_NAME_LENGTH)){
if(allowsound(Target)==1){
playsound(Target,Data);
}
}
}
return PLUGIN_HANDLED;
}
public admin_sounddead(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
new Target[MAX_NAME_LENGTH];
new i;
new maxplayers=maxplayercount();
new iDead;
new dummy;
convert_string(HLData,Data,MAX_DATA_LENGTH);
for(i=1;i<=maxplayers;i++){
if(playerinfo(i,Target,MAX_NAME_LENGTH,dummy,dummy,dummy,iDead)){
if(iDead==1){
if(allowsound(Target)==1){
playsound(Target,Data);
}
}
}
}
return PLUGIN_HANDLED;
}
public admin_soundteam(HLCommand,HLData,HLUserName,UserIndex) {
new Data[MAX_DATA_LENGTH];
new Target[MAX_NAME_LENGTH];
new TargetTeam[MAX_NAME_LENGTH];
new Output[MAX_TEXT_LENGTH];
new i;
new maxplayers=maxplayercount();
new iTargetTeam;
new iTeam;
new dummy;
convert_string(HLData,Data,MAX_DATA_LENGTH);
strbreak(Data,TargetTeam,Output,MAX_TEXT_LENGTH);
iTargetTeam=strtonum(TargetTeam);
for(i=1;i<=maxplayers;i++){
if(playerinfo(i,Target,MAX_NAME_LENGTH,dummy,dummy,iTeam,dummy)){
if(iTeam==iTargetTeam){
if(allowsound(Target)==1){
playsound(Target,Output);
}
}
}
}
return PLUGIN_HANDLED;
}
public plugin_init() {
plugin_registerinfo("PLUGIN_SDAL_SPEECH","Plays a diffrent Sound to clients.",STRING_VERSION);
plugin_registercmd("admin_sound","admin_sound",ACCESS_VOTE_MAP,"admin_sound <Person> <Output>: Plays a diffrent Sound to single person.");
plugin_registercmd("admin_soundall","admin_soundall",ACCESS_VOTE_MAP,"admin_soundall <Output>: Plays a diffrent Sound to all clients.");
plugin_registercmd("admin_sounddead","admin_sounddead",ACCESS_VOTE_MAP,"admin_sounddead <Output>: Plays a diffrent Sound to all clients who are dead.");
plugin_registercmd("admin_soundteam","admin_soundteam",ACCESS_VOTE_MAP,"admin_soundteam <TeamNr> <Output>: Plays a diffrent Sound to all clients who are in same team.");
return PLUGIN_CONTINUE;
}