waSpYe ;x FouNdeR
Bara Warm : Forum : Da Ani : 14 Arma : m4a1, ak47, awP Mesaje : 78 Data de inscriere : 01/03/2010
| Subiect: Sayrestart Mar Mar 02, 2010 6:25 pm | |
| Sallut la toti ! In accest tutorial va voi invata cum facem un SayRestart si amx_restart . Sa incepem!
Mai intai avem asa : Cod: /* Script generated by Pawn Studio */
#include #include
#define PLUGIN "New Plugin" #define AUTHOR "Unknown" #define VERSION "1.0"
public plugin_init() { register_plugin(PLUGIN,VERSION,AUTHOR)
}
Adaugam comenzile :
Cod: register_concmd("amx_restart","restart",ADMIN_KICK,"") register_concmd("admin_restart","restart",ADMIN_KICK,"") register_clcmd("say /restart","rr") register_clcmd("say_team /restart","rr")
Acum adaugam publicul : Cod: public restart(id,level,cid)
Verificam daca are acces : Cod: if (!cmd_access(id, level, cid, 2)) return 1
Adaugam un argument si secundele : Cod: new arg[3]
read_argv(1,arg,3) new restart = str_to_num(arg)
Apoi comanda pe care sa o execute serverul : Cod: server_cmd("sv_restartround %d", restart)
Ca sa arate mai fain adaugati si : Cod: static name[32] get_user_name(id,name,31)
client_print(0, print_chat, "(Admin %s): da restart in %d secunde", name, restart);
return 1
DONE ! Partea 1. Urmeaza Partea 2. Adaugam publicul : Cod: public rr(id)
Verificam daca este admin : Cod: if(!is_user_admin(id)){ return PLUGIN_HANDLED
Apoi daca este admin , comanda sa fie executata : Cod: } if(is_user_admin(id)){ server_cmd("sv_restart 1") } return PLUGIN_HANDLED }
Iar la final a iesit asa : Cod: #include #include
#define PLUGIN "New Plugin" #define AUTHOR "Unknown" #define VERSION "1.0"
public plugin_init() { register_plugin(PLUGIN,VERSION,AUTHOR) register_concmd("amx_restart","restart",ADMIN_KICK,"") register_concmd("admin_restart","restart",ADMIN_KICK,"") register_clcmd("say /restart","rr") register_clcmd("say_team /restart","rr") }
public restart(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return 1
static name[32] new arg[3]
read_argv(1,arg,3) new restart = str_to_num(arg) server_cmd("sv_restartround %d", restart) get_user_name(id,name,31)
client_print(0, print_chat, "(Admin %s): da restart in %d secunde", name, restart);
return 1 } public rr(id) { if(!is_user_admin(id)){ return PLUGIN_HANDLED } if(is_user_admin(id)){ server_cmd("sv_restart 1") } return PLUGIN_HANDLED } | |
|
aLyNn.;x FouNdeR
Bara Warm : Pistol : Usp aNd DeaGLe Forum : Da ! Ani : 15 Arma : Ak47 , M4a1 , AWP Mesaje : 29 Data de inscriere : 01/03/2010
| Subiect: Re: Sayrestart Mar Mar 02, 2010 6:39 pm | |
| | |
|
SumI MeMbeR
Bara Warm : Pistol : deagle Forum : da cum pot Ani : 13 Arma : m4a1 Mesaje : 82 Data de inscriere : 01/03/2010 Varsta : 28 Localizare : deva
| Subiect: Re: Sayrestart Mar Mar 02, 2010 7:40 pm | |
| | |
|