[Tutorial] CS 1.6 Cum setezi accesul la un plugin
Just4You :: COUNTER-STRIKE :: Tutoriale
Pagina 1 din 1
[Tutorial] CS 1.6 Cum setezi accesul la un plugin
In acest tutorial va voi invata cum setati accesul la un plugin.Sau sa inteleaga toata lumea : "Cine poate accesa acea comanda"
1. Luam un plugin,neaparat sa aiba fisierul .sma.Eu am luat amx_ss.
2. Deschidem acest fisier cu notepad sau alt program de editare text
#include
#include
#define PLUGIN "Screenshot"
#define VERSION "1.2"
#define AUTHOR "darkmihai"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_ss","admin_ss",ADMIN_KICK,"message");
}
public admin_ss(id,level,cid)
{
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED;
new argument[32]
read_argv(1,argument,31)
new player = cmd_target(id,argument,31)
new hostname[64], tname[32], usrip[32], timer[32];
get_cvar_string("hostname",hostname,63);
get_user_name(player,tname,31);
get_user_ip(player,usrip,31);
get_time("%m/%d/%Y - %H:%M:%S", timer,31);
if(!player)
return PLUGIN_HANDLED;
client_print(player, print_chat, "* Un admin ti-a facut un poza !")
client_print(player, print_chat, "* Nick-ul tau: %s, IP-ul tau: %s",tname,usrip)
client_print(player, print_chat, "* Data si ora: %s - pe serverul %s",timer,hostname)
client_cmd(player,"snapshot")
return PLUGIN_HANDLED
}
Acesta este pluginul
3. Ce este ingrosat este accesul.
4. Schimbati acea linie "ADMIN_KICK" cu alta eu voi inlocui cu "ADMIN_BAN" si va iesi(atentie comanda trebie sa o poate da adminii )
#include
#include
#define PLUGIN "Screenshot"
#define VERSION "1.2"
#define AUTHOR "darkmihai"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_ss","admin_ss",ADMIN_BAN,"message");
}
public admin_ss(id,level,cid)
{
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED;
new argument[32]
read_argv(1,argument,31)
new player = cmd_target(id,argument,31)
new hostname[64], tname[32], usrip[32], timer[32];
get_cvar_string("hostname",hostname,63);
get_user_name(player,tname,31);
get_user_ip(player,usrip,31);
get_time("%m/%d/%Y - %H:%M:%S", timer,31);
if(!player)
return PLUGIN_HANDLED;
client_print(player, print_chat, "* Un admin ti-a facut un poza !")
client_print(player, print_chat, "* Nick-ul tau: %s, IP-ul tau: %s",tname,usrip)
client_print(player, print_chat, "* Data si ora: %s - pe serverul %s",timer,hostname)
client_cmd(player,"snapshot")
return PLUGIN_HANDLED
}
1. Luam un plugin,neaparat sa aiba fisierul .sma.Eu am luat amx_ss.
2. Deschidem acest fisier cu notepad sau alt program de editare text
#include
#include
#define PLUGIN "Screenshot"
#define VERSION "1.2"
#define AUTHOR "darkmihai"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_ss","admin_ss",ADMIN_KICK,"message");
}
public admin_ss(id,level,cid)
{
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED;
new argument[32]
read_argv(1,argument,31)
new player = cmd_target(id,argument,31)
new hostname[64], tname[32], usrip[32], timer[32];
get_cvar_string("hostname",hostname,63);
get_user_name(player,tname,31);
get_user_ip(player,usrip,31);
get_time("%m/%d/%Y - %H:%M:%S", timer,31);
if(!player)
return PLUGIN_HANDLED;
client_print(player, print_chat, "* Un admin ti-a facut un poza !")
client_print(player, print_chat, "* Nick-ul tau: %s, IP-ul tau: %s",tname,usrip)
client_print(player, print_chat, "* Data si ora: %s - pe serverul %s",timer,hostname)
client_cmd(player,"snapshot")
return PLUGIN_HANDLED
}
Acesta este pluginul
3. Ce este ingrosat este accesul.
4. Schimbati acea linie "ADMIN_KICK" cu alta eu voi inlocui cu "ADMIN_BAN" si va iesi(atentie comanda trebie sa o poate da adminii )
#include
#include
#define PLUGIN "Screenshot"
#define VERSION "1.2"
#define AUTHOR "darkmihai"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_ss","admin_ss",ADMIN_BAN,"message");
}
public admin_ss(id,level,cid)
{
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED;
new argument[32]
read_argv(1,argument,31)
new player = cmd_target(id,argument,31)
new hostname[64], tname[32], usrip[32], timer[32];
get_cvar_string("hostname",hostname,63);
get_user_name(player,tname,31);
get_user_ip(player,usrip,31);
get_time("%m/%d/%Y - %H:%M:%S", timer,31);
if(!player)
return PLUGIN_HANDLED;
client_print(player, print_chat, "* Un admin ti-a facut un poza !")
client_print(player, print_chat, "* Nick-ul tau: %s, IP-ul tau: %s",tname,usrip)
client_print(player, print_chat, "* Data si ora: %s - pe serverul %s",timer,hostname)
client_cmd(player,"snapshot")
return PLUGIN_HANDLED
}
Icsulescu- Membru
- Mesaje : 100
Data de inscriere : 12/06/2017
Puncte : 296
Reputatie : 0
Subiecte similare
» [Tutorial] CS 1.6 Instalare Plugin
» [Tutorial]Cum pun un plugin pe server
» Tutorial Compilare Plugin-uri AmxModX
» [Tutorial] CS 1.6 Cum sa modifici un plugin si sa il compilezi
» Tutorial compilare plugin-uri (Din .sma in .amxx) Standard
» [Tutorial]Cum pun un plugin pe server
» Tutorial Compilare Plugin-uri AmxModX
» [Tutorial] CS 1.6 Cum sa modifici un plugin si sa il compilezi
» Tutorial compilare plugin-uri (Din .sma in .amxx) Standard
Just4You :: COUNTER-STRIKE :: Tutoriale
Pagina 1 din 1
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum