Dupa cum vedeti o sa va explic ceva face set_task.
set_task este o comanda ce activeaza un public dupa un anumit timp.
set_task(timp,"public",id = 0,"",0,flags= "?",repeta = 0)
Deci vom avea asa:
timp = timpul care trebuie setat. ex. 10.0 ( 10 sec) ATentie!! Este extrem de important sa puneti .0
public = puneti numele aceli public ce vreti sa actionati
id = 0 = aici puneti 0 de obicei sau id etc...ex2 uitati-va mai jos..
"" = aici sunt parametri nu aveti treaba
flags= "?" = aiic sunt flagurile care trebuie puse.
adica:
a = repeta operatia la un nr de timp.
b = repeta operatia la infinit
c = face o operati dupa de timpul ramas pe harta
d = face o operatie inainte de timpul ramas pe harta.
repeta = 0 = aici folositi litera "a" si puneti de cate ori vrei sa se repete
ex.
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Show Mesaje"
#define VERSION "1.0"
#define AUTHOR "FireW@ll"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(30.0,"show_mesaje",0,"",0,"b",0)
}
public show_mesaje(id){
client_print(0,print_chat,"Bine ati venit pe server")
}
Dupa 30 de sec va afisa "Bine ati venit pe server" la toti pe server.
Am pus b pentru a afisa pe infinit.
Hint: in loc de set_task(30.0,"show_mesaje",0,"",0,"b",0) puteti sa faci si cu _.
adica set_task(30.0,"show_mesaje",_,_,_,"b",0)
asa nu mai aveti treaba cu alea.
ex2:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "FireW@ll"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_slay","slay",ADMIN_SLAY,"<nume>")
}
public slay(id,level,cid){
if(!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED;
new arg[32]
read_argv(1,arg,31)
new player = cmd_target(id,arg,5)
if(!player)
return PLUGIN_HANDLED;
set_task(3.0,"slay_player",player)
return PLUGIN_CONTINUE;
}
public slay_player(player){
user_silentkill(player)
return PLUGIN_HANDLED;
}
Noroc la facut pluginuri
Welcome to PISTOLARII România @ Since 2011
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!
Toggle shoutbox Chat Online Pistolarii Romania
|
[AMXX] set_task
Started by Tiberiw, Mar 21 2024 12:30 AM
#1
Posted 21 March 2024 - 12:30 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users