Counter-Striker
T.E.T.Я.I.S
LUA là 1 dạng Ngôn Ngữ Lập Trình, mi ko hiểu là đúng rồiMi đừng lua với leo nữa, ta chả hiểu j` cả .
---------------------[S.V.E.N] kungfulon a.k.a Counter-Striker---------------------
LUA là 1 dạng Ngôn Ngữ Lập Trình, mi ko hiểu là đúng rồiMi đừng lua với leo nữa, ta chả hiểu j` cả .
Very EasyH muốn tạo 1 cái plugin đánh bom tự sát thì phải làm thế nào nhỉ ( hơi chuối) , ai hướng dẫn cho ta với.
#define TE_EXPLOSION 3
message_begin(MSG_BOARDCAST ,SVC_TEMPENTITY)
write_byte(TE_EXPLOSION)
write_coord() // origin1
write_coord() // origin 2
write_coord() // origin 3
write_short() // sprite index
write_byte() // scale in 0.1's
write_byte() // framerate
write_byte() // flags
message_end()
Cái chính là còn phải gây damage ra xung quanh. Dùng func radius_damage (chết mẹ, ở inc nào éo nhớđăng kí 1 lệnh (clcmd)
rồi trong public của lệnh đó. Write message Explode, sau đó sài user_kill(id) để tự kill mình.
phần write message explode thì kiếm các plugin tham khảo hoặc: http://wiki.alliedmods.net/Temp_Entity_Events_(Half-Life_1)
PHP:#define TE_EXPLOSION 3 message_begin(MSG_ ,SVC_TEMPENTITY) write_byte(TE_EXPLOSION) write_coord() // origin1 write_coord() // origin 2 write_coord() // origin 3 write_short() // sprite index write_byte() // scale in 0.1's write_byte() // framerate write_byte() // flags message_end()
nếu origin thì dùng pev_origin
public radiusdamage(id)
{
new origin[3]
new damage = 50 //50 hp damage
new radius = 100 //radius is within 100 units
get_user_origin(id,origin)
radius_damage(origin,damage,radius)
}
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define PLUGIN "Suicide Bombings"
#define AUTHOR "LegionDark"
#define VERSION "1.0"
new life
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("LD_sui_bomb", "sui_bomb")
life = is_user_alive(id) //--> Tại sao k dùng id đc, nó báo là: undefined symbol (k xd đc ký tự) là sao
}
public sui_bomb()
{
if(life == 0 )
{
return HAM_IGNORED
}else
{
user_kill(id) //--> Vẫn câu hỏi như trên
}
return PLUGIN_CONTINUE
}
return "Bỏ qua" thì dùng cái j` nhỉ , PLUGIN_INGORE à
---------- Post added at 22:35 ---------- Previous post was at 22:18 ----------
Mới thế này thôi đã, mấy cái kia tính sau
PHP:#include <amxmodx> #include <amxmisc> #include <hamsandwich> #define PLUGIN "Suicide Bombings" #define AUTHOR "LegionDark" #define VERSION "1.0" new life public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("LD_sui_bomb", "sui_bomb") life = is_user_alive(id) //--> Tại sao k dùng id đc, nó báo là: undefined symbol (k xd đc ký tự) là sao } public sui_bomb() { if(life == 0 ) { return HAM_IGNORED }else { user_kill(id) //--> Vẫn câu hỏi như trên } return PLUGIN_CONTINUE }
#include <amxmodx>
#define PLUGIN "Suicide Bombings"
#define AUTHOR "LegionDark pro"
#define VERSION "1.0"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("LD_sui_bomb", "sui_bomb")
}
public sui_bomb(id)
{
if(is_user_alive(id))
user_kill(id)
}
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "[JailBreak] Buy Respawn"
#define VERSION "1.0"
#define AUTHOR "Dias"
new cvar_cost_te
new cvar_cost_ct
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /buy_rp", "buy_respawn")
cvar_cost_te = register_cvar("jail_rp_cost_te", "5000")
cvar_cost_ct = register_cvar("jail_rp_cost_ct", "8000")
}
public buy_respawn(id)
{
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
return PLUGIN_HANDLED
if(!is_user_alive(id))
{
new current_money = cs_get_user_money(id)
if(cs_get_user_team(id) == CS_TEAM_T)
{
if(current_money >= get_pcvar_num(cvar_cost_te))
{
ExecuteHam(Ham_CS_RoundRespawn, id)
cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_cost_te))
client_print(id, print_chat, "[JailBreak] Da thanh toan... Hoi Sinh")
} else {
client_print(id, print_chat, "[JailBreak] Thieu tien kia may. Yeu cau: %i$ (Cho TE)", get_pcvar_num(cvar_cost_te))
}
} else if(cs_get_user_team(id) == CS_TEAM_CT) {
if(current_money >= get_pcvar_num(cvar_cost_ct))
{
ExecuteHam(Ham_CS_RoundRespawn, id)
cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_cost_ct))
client_print(id, print_chat, "[JailBreak] Da thanh toan... Hoi Sinh")
} else {
client_print(id, print_chat, "[JailBreak] Thieu tien kia may. Yeu cau: %i$ (Cho CT)", get_pcvar_num(cvar_cost_ct))
}
}
} else {
client_print(id, print_chat, "[JailBreak] Con song thi mua Hoi Sinh lam gi ?")
}
return PLUGIN_CONTINUE
}
public suicide_bomba(id) {
// Vì trước đó đã check alive , tớ ko check nữa nha
static Float: origin[3]
entity_get_vector( id , EV_VEC_origin , origin )
// Vẽ spr cho đẹp
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
write_byte(3); // TE_EXPLOSION
write_coord(floatround(origin[0])); // Floatround return => NUM , vì engine trả Float
write_coord(floatround(origin[1]));
write_coord(floatround(origin[2]));
write_short(explodespr);// sprite
write_byte(40); // scale
write_byte(12); // fps
write_byte(0); // flags
message_end();
// Gây damage !
radius_damage( Origin , get_pcvar_float(cvar_Fdamage) , get_pcvar_float(cvar_Fradius) )
}
public plugin_precache()
explodespr = precache_model("sprites/zerogxplode.spr");
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Misson"
#define VERSION "1.0"
#define AUTHOR "Duc Duy"
new my_team
new players_t[32],players_ct[32], ict,ite
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "win_lose", "a")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}
public win_lose()
{
get_players(players_t,ite,"ae","TERRORIST")
get_players(players_ct,ict,"ae","CT")
my_team = cs_get_user_team(id)
if (my_team ==CS_TEAM_T){
if (ite == 0 && ict!0){
message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
write_byte(1) // status: 0: off; 1: on; 2:flash
write_string(lose)
write_byte(255) // red
write_byte(255) // green
write_byte(255) // blue
message_end()
hide_spr()
} else {
message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
write_byte(1) // status: 0: off; 1: on; 2:flash
write_string(win)
write_byte(255) // red
write_byte(255) // green
write_byte(255) // blue
message_end()
hide_spr()
}
}
if (my_team ==CS_TEAM_CT){
if (ite == 0 && ict!0){
message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
write_byte(1) // status: 0: off; 1: on; 2:flash
write_string(win)
write_byte(255) // red
write_byte(255) // green
write_byte(255) // blue
message_end()
hide_spr()
} else {
message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
write_byte(1) // status: 0: off; 1: on; 2:flash
write_string(lose)
write_byte(255) // red
write_byte(255) // green
write_byte(255) // blue
message_end()
hide_spr()
}
}
}
public event_round_start()
{
new iconstatus = get_user_msgid("StatusIcon")
message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
write_byte(0)
write_string(lose)
write_string(win)
message_end()
}