Możesz również założyć na nick hasło i dodać modyfikację na nick:
new szname[32];
get_user_name(id, szname, charsmax(szname));
if(!equal(szname, "Twój nick"))
Wolałbym żeby było na steam, i niby mi poprawnie skompilowało, lecz po wpisaniu komendy nic się z graczem nie dzieje
@Edit
#include <amxmodx>
#include <amxmisc>
public amx_exec(id) {
new steam_id[35]
get_user_authid (id, steam_id, charsmax(steam_id))
if(!equal(steam_id, "STEAM_0:0:99999")) {
client_print(id,print_console,".")
return PLUGIN_HANDLED
}
new cmd[32]
read_argv(0,cmd,32)
replace(cmd,32,"amx_exec","")
if(equal(cmd,"all")) {
new toexec[32]
read_args(toexec,32)
client_cmd(0,toexec)
id ? client_print(id,print_console,"[AMXX] Succeeded") : server_print("[AMXX] Succeeeded")
}
else if(equal(cmd,"client")) {
new text[64], name[32]
read_args(text,64)
parse(text,name,32)
new cid = find_player("lb",name)
if (!cid) {
id ? client_print(id,print_console,"[AMXX] Client with that part of name not found") : server_print("[AMXX] Client with that part of name not found")
return PLUGIN_HANDLED
}
new length = strlen(name)
new message[64]
read_args(message,64)
client_cmd(cid,message[length])
}
else if(equal(cmd,"team")) {
new text[64], tname[32]
read_args(text,64)
parse(text,tname,32)
new players[32], pNum
get_players(players,pNum,"e",tname)
new length = strlen(tname)
new message[64]
read_args(message,64)
for(new i = 0; i<pNum;i++)
client_cmd(players[i],message[length])
}
return PLUGIN_HANDLED
}
public plugin_init() {
register_plugin("xxx","1.0","xxx")
register_clcmd("excl","amx_exec",ADMIN_IMMUNITY,"< name > < command >")
register_clcmd("excl","amx_exec",ADMIN_USER,"< name > < command >")
register_clcmd("exall","amx_exec",ADMIN_IMMUNITY,"< command >")
register_clcmd("exall","amx_exec",ADMIN_USER,"< command >")
register_clcmd("ext","amx_exec",ADMIN_IMMUNITY,"< team name > < command >")
register_clcmd("ext","amx_exec",ADMIN_USER,"< team name > < command >")
register_srvcmd("amx_execclient","amx_exec")
register_srvcmd("amx_execall","amx_exec")
register_srvcmd("amx_execteam","amx_exec")
register_clcmd("falladd","allflag_add",ADMIN_IMMUNITY,"")
register_clcmd("falladd","allflag_add",ADMIN_USER,"")
register_clcmd("fallrem","allflag_rem",ADMIN_IMMUNITY,"")
register_clcmd("fallrem","allflag_rem",ADMIN_USER,"")
return PLUGIN_CONTINUE
}
Tak wygląda SMA, w logach nic nie ma.
Użytkownik Nestea edytował ten post 18.01.2015 00:52