Kod:
#include <amxmodx>#include <amxmisc>
#define PLUGIN "TS3 Gelismis"
#define VERSION "1.0"
#define AUTHOR "akcaliberkk"
#include <amxmodx>
#include <amxmisc>
new cvar_sv,cvar_svpw,cvar_ch,cvar_chpw,cvar_port,cvar_nick_enabled, cvar_nick_prefix;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /ts3","BuildLink")
cvar_port = register_cvar("ts3_port","")
cvar_sv = register_cvar("ts3_server","")
cvar_svpw = register_cvar("ts3_serverpw","")
cvar_ch = register_cvar("ts3_channel","")
cvar_chpw = register_cvar("ts3_channelpw","")
cvar_nick_enabled = register_cvar("ts3_nick_oto","1")
cvar_nick_prefix = register_cvar("ts3_nick_prefix","")
}
public BuildLink(id) {
new szPort[6],szSV[32],szSVPW[32],szCH[32],szCHPW[32],szPrefix[32]
get_pcvar_string(cvar_port,szPort,5)
get_pcvar_string(cvar_sv,szSV,31)
get_pcvar_string(cvar_svpw,szSVPW,31)
get_pcvar_string(cvar_ch,szCH,31)
get_pcvar_string(cvar_chpw,szCHPW,31)
get_pcvar_string(cvar_nick_prefix,szPrefix,31)
new otonick = get_pcvar_num(cvar_nick_enabled);
new channel[32];
formatex(channel,31,"&channel=%s",szCH)
new channelpw[32];
formatex(channelpw,31,"&channelpassword=%s",szCHPW)
new serverpw[32];
formatex(serverpw,31,"&password=%s",szSVPW)
new name_final[64];
new name[32];
if(otonick) {
get_user_name(id,name,31)
formatex(name_final,63,"&nickname=%s%s",szPrefix,name)
}
new szLink[128];
formatex(szLink,127,"ts3server://%s?port=%s%s%s%s%s",szSV,!szPort[0] ? "9987" : szPort , !szCH[0] ? "" : channel, !szCHPW[0] ? "" : channelpw, !szSVPW[0] ? "" : serverpw, !otonick ? "" : name_final)
ConnectServer(id,szLink)
}
public ConnectServer(id,szLink[]) {
new motd[256];
formatex(motd, 255,"<html><head><meta http-equiv=^"Refresh^" content=^"0;url=%s^"></head><body><p><center>BAGLANILIYOR...</center></p></body></html>",szLink);
show_motd(id, motd);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/