Happy halloween!

,


TOPIC INCHIS!  
TOPIC LOCKED
Va informam ca pana la redeschiderea topicului doar cei din administratie vor putea continua sa posteze daca mai au ceva de adaugat si este strict necesar.

 [ 1 post ] 
[Tutorial] CS 1.6 Cum setezi accesul la un plugin 
Author Message
Membru
User avatar
Posts: 381
Membru din: Sat Sep 15, 2018 11:58 pm
Location: Rm.Valcea
Age: 17
Status: Offline
Puncte: 381 - INCEPATOR
Multumiri date: 3 times

Multumiri primite: 2 times
[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

Code:
#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. ADMIN_KICK este accesul , deci doar helperi pot da.
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 )

Code:
#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);










CSGAMERS.RO - SEMNATURA
Image

Image




Fri Oct 12, 2018 11:37 am
Display posts from previous:  Sort by  
   [ 1 post ] 
TOPIC INCHIS!  
TOPIC LOCKED
Va informam ca pana la redeschiderea topicului doar cei din administratie vor putea continua sa posteze daca mai au ceva de adaugat si este strict necesar.

,


Who is online

Users browsing this forum: No registered users and 41 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
 
Translation/Traducere: phpBB Romania
Design realizat de catre EPIKAL pentru Counter-Strike Gamers Romania
For browsing this site is recommended to use Google Chrome with widescreen resolution 1280 x 1024 pixels. This website is Search Engine Optimization (SEO)
COPYRIGHT © CSGAMERS.RO - All right reserved.