Discord sunucumuz açılmıştır, hepinizi bekleriz

https://discord.gg/43gGDQe6tS

doku yetkisine sahip olanlar hook basabilsin

Eklenti sorunlarınız ve özel eklenti istekleriniz

Moderatör: Moderatörler


Ali
Mesajlar: 421
Kayıt: Çrş Eyl 09, 2015 11:08 pm

doku yetkisine sahip olanlar hook basabilsin

Mesaj gönderen Ali »

ByBuLuT ☪ yazdı: Cum May 31, 2019 4:23 am
Ali yazdı: Cum May 31, 2019 4:09 am
ByBuLuT ☪ yazdı: Cum May 31, 2019 4:05 am 4. satırda #define YETKI
ADMIN_IMMUNITY bu mesela doku demek.Ben bunların hepsine nasıl ulaşırım yani b yetkisinin yazı olarak karşılığı ne

Kod: Tümünü seç

ADMIN_ALL          //Everyone ||||||
;;=== ADMIN_IMMUNITY     //Flag "a" |||||| 
;;=== ADMIN_RESERVATION  //Flag "b" |||||
;;=== ADMIN_KICK         //Flag "c" ||||||
;;=== ADMIN_BAN          //Flag "d" ||||||
;;=== ADMIN_SLAY         //Flag "e" ||||||
;;=== ADMIN_MAP          //Flag "f" ||||||
;;=== ADMIN_CVAR         //Flag "g" ||||||
;;=== ADMIN_CFG          //Flag "h" |||||| 
;;=== ADMIN_CHAT         //Flag "i" |||||| 
;;=== ADMIN_VOTE         //Flag "j" |||||| 
;;=== ADMIN_PASSWORD     //Flag "k" ||||||
;;=== ADMIN_RCON         //Flag "l" |||||| 
;;=== ADMIN_LEVEL_A      //Flag "m" ||||||
;;=== ADMIN_LEVEL_B      //Flag "n" |||||| 
;;=== ADMIN_LEVEL_C      //Flag "o" |||||| 
;;=== ADMIN_LEVEL_D      //Flag "p" |||||| 
;;=== ADMIN_LEVEL_E      //Flag "q" |||||| 
;;=== ADMIN_LEVEL_F      //Flag "r" ||||||
;;=== ADMIN_LEVEL_G      //Flag "s" ||||||
;;=== ADMIN_LEVEL_H      //Flag "t" |||||| 
;;=== ADMIN_MENU         //Flag "u" |||||| 
;;xxx ADMIN_BAN_TEMP     //Flag "v" xxxxx 
;;=== ADMIN_ADMIN        //Flag "y" |||||| 
;;=== ADMIN_USER         //Flag "z" |||||| 
çok teşekkürler benim şu donduran bomba işi ne olcak :D

Link:
Linklerini gizle
Linki Kopyala

Konu Sahibi
TX_RepSac
Mesajlar: 50
Kayıt: Cmt Ara 22, 2018 10:50 pm

doku yetkisine sahip olanlar hook basabilsin

Mesaj gönderen TX_RepSac »

ByBuLuT ☪ yazdı: Cum May 31, 2019 12:52 am Arkadaşın attığının yetkisini doku olana ayarladım eklentiyi test etmedim

Kod: Tümünü seç

#include <amxmodx>
#include <reapi>

#define YETKI ADMIN_IMMUNITY

new hook_speed,bool:hook[MAX_CLIENTS+1],hook_to[MAX_CLIENTS+1][3],beamsprite;
public plugin_init() {
	register_plugin("Hook", "1.0", "PurposeLess");

	register_clcmd("+hook", "hook_on");
	register_clcmd("-hook", "hook_off");

	hook_speed = register_cvar("hook_speed", "5");
}
public plugin_precache() beamsprite=precache_model("sprites/dot.spr"),precache_sound("weapons/xbow_hit2.wav");
public hook_on(id) {
	if(hook[id]) return PLUGIN_HANDLED;

	if(get_user_flags(id) & YETKI || get_user_team(id)==2) {
		set_entvar(id, var_gravity, 0.0);
		set_task(0.1, "hook_prethink", id+10000, "", 0, "b");
		hook[id] = true;
		hook_to[id][0] = 999999;
		hook_prethink(id+10000);
		rh_emit_sound2(id, 0, CHAN_AUTO, "weapons/xbow_hit2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	}
	return PLUGIN_HANDLED;
}

public hook_off(id) {
	if(!hook[id]) return PLUGIN_HANDLED;

	if(is_user_alive(id)) set_entvar(id, var_gravity, 1.0);

	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id) {
	id -= 10000;

	if(!(get_user_flags(id) & YETKI || get_user_team(id)==2)) hook[id] = false;

	if(!hook[id]) { remove_task(id+10000); return PLUGIN_HANDLED; }

	static origin1[3];
	get_user_origin(id, origin1);

	if(hook_to[id][0] == 999999)
	{
		static origin2[3];
		get_user_origin(id, origin2, 3);

		hook_to[id][0]= origin2[0];
		hook_to[id][1]= origin2[1];
		hook_to[id][2]= origin2[2];
	}

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(1);
	write_short(id);
	write_coord(hook_to[id][0]);
	write_coord(hook_to[id][1]);
	write_coord(hook_to[id][2]);
	write_short(beamsprite);
	write_byte(1);
	write_byte(1);
	write_byte(2);
	write_byte(5);
	write_byte(0);
	write_byte(0);
	write_byte(0);
	write_byte(255);
	write_byte(200);
	write_byte(0);
	message_end();

	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (get_pcvar_float(hook_speed) * 120.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_entvar(id, var_velocity, velocity);
	return PLUGIN_CONTINUE
}
çalışmıyor

Link:
Linklerini gizle
Linki Kopyala
Kullanıcı avatarı

ByBuLuT ☪
Mesajlar: 2368
Kayıt: Sal Oca 26, 2016 3:54 pm
Konum: Samsun
Clan İsmi: -
İletişim:

doku yetkisine sahip olanlar hook basabilsin

Mesaj gönderen ByBuLuT ☪ »

TX_RepSac yazdı: Cum May 31, 2019 4:59 pm
ByBuLuT ☪ yazdı: Cum May 31, 2019 12:52 am Arkadaşın attığının yetkisini doku olana ayarladım eklentiyi test etmedim

Kod: Tümünü seç

#include <amxmodx>
#include <reapi>

#define YETKI ADMIN_IMMUNITY

new hook_speed,bool:hook[MAX_CLIENTS+1],hook_to[MAX_CLIENTS+1][3],beamsprite;
public plugin_init() {
	register_plugin("Hook", "1.0", "PurposeLess");

	register_clcmd("+hook", "hook_on");
	register_clcmd("-hook", "hook_off");

	hook_speed = register_cvar("hook_speed", "5");
}
public plugin_precache() beamsprite=precache_model("sprites/dot.spr"),precache_sound("weapons/xbow_hit2.wav");
public hook_on(id) {
	if(hook[id]) return PLUGIN_HANDLED;

	if(get_user_flags(id) & YETKI || get_user_team(id)==2) {
		set_entvar(id, var_gravity, 0.0);
		set_task(0.1, "hook_prethink", id+10000, "", 0, "b");
		hook[id] = true;
		hook_to[id][0] = 999999;
		hook_prethink(id+10000);
		rh_emit_sound2(id, 0, CHAN_AUTO, "weapons/xbow_hit2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	}
	return PLUGIN_HANDLED;
}

public hook_off(id) {
	if(!hook[id]) return PLUGIN_HANDLED;

	if(is_user_alive(id)) set_entvar(id, var_gravity, 1.0);

	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id) {
	id -= 10000;

	if(!(get_user_flags(id) & YETKI || get_user_team(id)==2)) hook[id] = false;

	if(!hook[id]) { remove_task(id+10000); return PLUGIN_HANDLED; }

	static origin1[3];
	get_user_origin(id, origin1);

	if(hook_to[id][0] == 999999)
	{
		static origin2[3];
		get_user_origin(id, origin2, 3);

		hook_to[id][0]= origin2[0];
		hook_to[id][1]= origin2[1];
		hook_to[id][2]= origin2[2];
	}

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(1);
	write_short(id);
	write_coord(hook_to[id][0]);
	write_coord(hook_to[id][1]);
	write_coord(hook_to[id][2]);
	write_short(beamsprite);
	write_byte(1);
	write_byte(1);
	write_byte(2);
	write_byte(5);
	write_byte(0);
	write_byte(0);
	write_byte(0);
	write_byte(255);
	write_byte(200);
	write_byte(0);
	message_end();

	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (get_pcvar_float(hook_speed) * 120.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_entvar(id, var_velocity, velocity);
	return PLUGIN_CONTINUE
}
çalışmıyor
Tekrar test ettim hlds de sorunsuz çalışıyor A harfi yani DOKU'ya ayarlı durumda

Link:
Linklerini gizle
Linki Kopyala

Konu Sahibi
TX_RepSac
Mesajlar: 50
Kayıt: Cmt Ara 22, 2018 10:50 pm

doku yetkisine sahip olanlar hook basabilsin

Mesaj gönderen TX_RepSac »

ByBuLuT ☪ yazdı: Cum May 31, 2019 5:44 pm
TX_RepSac yazdı: Cum May 31, 2019 4:59 pm
ByBuLuT ☪ yazdı: Cum May 31, 2019 12:52 am Arkadaşın attığının yetkisini doku olana ayarladım eklentiyi test etmedim

Kod: Tümünü seç

#include <amxmodx>
#include <reapi>

#define YETKI ADMIN_IMMUNITY

new hook_speed,bool:hook[MAX_CLIENTS+1],hook_to[MAX_CLIENTS+1][3],beamsprite;
public plugin_init() {
	register_plugin("Hook", "1.0", "PurposeLess");

	register_clcmd("+hook", "hook_on");
	register_clcmd("-hook", "hook_off");

	hook_speed = register_cvar("hook_speed", "5");
}
public plugin_precache() beamsprite=precache_model("sprites/dot.spr"),precache_sound("weapons/xbow_hit2.wav");
public hook_on(id) {
	if(hook[id]) return PLUGIN_HANDLED;

	if(get_user_flags(id) & YETKI || get_user_team(id)==2) {
		set_entvar(id, var_gravity, 0.0);
		set_task(0.1, "hook_prethink", id+10000, "", 0, "b");
		hook[id] = true;
		hook_to[id][0] = 999999;
		hook_prethink(id+10000);
		rh_emit_sound2(id, 0, CHAN_AUTO, "weapons/xbow_hit2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	}
	return PLUGIN_HANDLED;
}

public hook_off(id) {
	if(!hook[id]) return PLUGIN_HANDLED;

	if(is_user_alive(id)) set_entvar(id, var_gravity, 1.0);

	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id) {
	id -= 10000;

	if(!(get_user_flags(id) & YETKI || get_user_team(id)==2)) hook[id] = false;

	if(!hook[id]) { remove_task(id+10000); return PLUGIN_HANDLED; }

	static origin1[3];
	get_user_origin(id, origin1);

	if(hook_to[id][0] == 999999)
	{
		static origin2[3];
		get_user_origin(id, origin2, 3);

		hook_to[id][0]= origin2[0];
		hook_to[id][1]= origin2[1];
		hook_to[id][2]= origin2[2];
	}

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(1);
	write_short(id);
	write_coord(hook_to[id][0]);
	write_coord(hook_to[id][1]);
	write_coord(hook_to[id][2]);
	write_short(beamsprite);
	write_byte(1);
	write_byte(1);
	write_byte(2);
	write_byte(5);
	write_byte(0);
	write_byte(0);
	write_byte(0);
	write_byte(255);
	write_byte(200);
	write_byte(0);
	message_end();

	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (get_pcvar_float(hook_speed) * 120.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_entvar(id, var_velocity, velocity);
	return PLUGIN_CONTINUE
}
çalışmıyor
Tekrar test ettim hlds de sorunsuz çalışıyor A harfi yani DOKU'ya ayarlı durumda
ct deki yetkililer dokusu olmasa bile kullanabiliyor

Link:
Linklerini gizle
Linki Kopyala
Kullanıcı avatarı

ByBuLuT ☪
Mesajlar: 2368
Kayıt: Sal Oca 26, 2016 3:54 pm
Konum: Samsun
Clan İsmi: -
İletişim:

doku yetkisine sahip olanlar hook basabilsin

Mesaj gönderen ByBuLuT ☪ »

TX_RepSac yazdı: Cum May 31, 2019 5:49 pm
ByBuLuT ☪ yazdı: Cum May 31, 2019 5:44 pm
TX_RepSac yazdı: Cum May 31, 2019 4:59 pm

çalışmıyor
Tekrar test ettim hlds de sorunsuz çalışıyor A harfi yani DOKU'ya ayarlı durumda
ct deki yetkililer dokusu olmasa bile kullanabiliyor
O zaman komutcunun dokusu yoksa basamaz buyur

Kod: Tümünü seç

#include <amxmodx>
#include <reapi>

#define YETKI ADMIN_IMMUNITY

new hook_speed,bool:hook[MAX_CLIENTS+1],hook_to[MAX_CLIENTS+1][3],beamsprite;
public plugin_init() {
	register_plugin("Hook", "1.0", "PurposeLess");

	register_clcmd("+hook", "hook_on");
	register_clcmd("-hook", "hook_off");

	hook_speed = register_cvar("hook_speed", "5");
}
public plugin_precache() beamsprite=precache_model("sprites/dot.spr"),precache_sound("weapons/xbow_hit2.wav");
public hook_on(id) {
	if(hook[id]) return PLUGIN_HANDLED;

	if(get_user_flags(id) & YETKI || get_user_team(id)==2) {
		set_entvar(id, var_gravity, 0.0);
		set_task(0.1, "hook_prethink", id+10000, "", 0, "b");
		hook[id] = true;
		hook_to[id][0] = 999999;
		hook_prethink(id+10000);
		rh_emit_sound2(id, 0, CHAN_AUTO, "weapons/xbow_hit2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	}
	return PLUGIN_HANDLED;
}

public hook_off(id) {
	if(!hook[id]) return PLUGIN_HANDLED;

	if(is_user_alive(id)) set_entvar(id, var_gravity, 1.0);

	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id) {
	id -= 10000;

	if(!(get_user_flags(id) & YETKI)) hook[id] = false;

	if(!hook[id]) { remove_task(id+10000); return PLUGIN_HANDLED; }

	static origin1[3];
	get_user_origin(id, origin1);

	if(hook_to[id][0] == 999999)
	{
		static origin2[3];
		get_user_origin(id, origin2, 3);

		hook_to[id][0]= origin2[0];
		hook_to[id][1]= origin2[1];
		hook_to[id][2]= origin2[2];
	}

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(1);
	write_short(id);
	write_coord(hook_to[id][0]);
	write_coord(hook_to[id][1]);
	write_coord(hook_to[id][2]);
	write_short(beamsprite);
	write_byte(1)		// framestart
	write_byte(1)		// framerate
	write_byte(1)		// life in 0.1's
	write_byte(5)		// width
	write_byte(0)		// noise
	write_byte(random_num(70,225))		// red
	write_byte(random_num(20,255))		// green
	write_byte(random_num(20,255))		// blue
	write_byte(255)		// brightness
	write_byte(0)		// speed
	message_end()

	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (get_pcvar_float(hook_speed) * 120.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_entvar(id, var_velocity, velocity);
	return PLUGIN_CONTINUE
}

Link:
Linklerini gizle
Linki Kopyala

Konu Sahibi
TX_RepSac
Mesajlar: 50
Kayıt: Cmt Ara 22, 2018 10:50 pm

doku yetkisine sahip olanlar hook basabilsin

Mesaj gönderen TX_RepSac »

ByBuLuT ☪ yazdı: Cum May 31, 2019 5:54 pm
TX_RepSac yazdı: Cum May 31, 2019 5:49 pm
ByBuLuT ☪ yazdı: Cum May 31, 2019 5:44 pm

Tekrar test ettim hlds de sorunsuz çalışıyor A harfi yani DOKU'ya ayarlı durumda
ct deki yetkililer dokusu olmasa bile kullanabiliyor
O zaman komutcunun dokusu yoksa basamaz buyur

Kod: Tümünü seç

#include <amxmodx>
#include <reapi>

#define YETKI ADMIN_IMMUNITY

new hook_speed,bool:hook[MAX_CLIENTS+1],hook_to[MAX_CLIENTS+1][3],beamsprite;
public plugin_init() {
	register_plugin("Hook", "1.0", "PurposeLess");

	register_clcmd("+hook", "hook_on");
	register_clcmd("-hook", "hook_off");

	hook_speed = register_cvar("hook_speed", "5");
}
public plugin_precache() beamsprite=precache_model("sprites/dot.spr"),precache_sound("weapons/xbow_hit2.wav");
public hook_on(id) {
	if(hook[id]) return PLUGIN_HANDLED;

	if(get_user_flags(id) & YETKI || get_user_team(id)==2) {
		set_entvar(id, var_gravity, 0.0);
		set_task(0.1, "hook_prethink", id+10000, "", 0, "b");
		hook[id] = true;
		hook_to[id][0] = 999999;
		hook_prethink(id+10000);
		rh_emit_sound2(id, 0, CHAN_AUTO, "weapons/xbow_hit2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	}
	return PLUGIN_HANDLED;
}

public hook_off(id) {
	if(!hook[id]) return PLUGIN_HANDLED;

	if(is_user_alive(id)) set_entvar(id, var_gravity, 1.0);

	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id) {
	id -= 10000;

	if(!(get_user_flags(id) & YETKI)) hook[id] = false;

	if(!hook[id]) { remove_task(id+10000); return PLUGIN_HANDLED; }

	static origin1[3];
	get_user_origin(id, origin1);

	if(hook_to[id][0] == 999999)
	{
		static origin2[3];
		get_user_origin(id, origin2, 3);

		hook_to[id][0]= origin2[0];
		hook_to[id][1]= origin2[1];
		hook_to[id][2]= origin2[2];
	}

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(1);
	write_short(id);
	write_coord(hook_to[id][0]);
	write_coord(hook_to[id][1]);
	write_coord(hook_to[id][2]);
	write_short(beamsprite);
	write_byte(1)		// framestart
	write_byte(1)		// framerate
	write_byte(1)		// life in 0.1's
	write_byte(5)		// width
	write_byte(0)		// noise
	write_byte(random_num(70,225))		// red
	write_byte(random_num(20,255))		// green
	write_byte(random_num(20,255))		// blue
	write_byte(255)		// brightness
	write_byte(0)		// speed
	message_end()

	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (get_pcvar_float(hook_speed) * 120.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_entvar(id, var_velocity, velocity);
	return PLUGIN_CONTINUE
}

eyw aga eline sağlık çalışıyor ama dokusu olmayanlar hook basmaya calısırken hook sesi geliyor ama kullanamıyorlar o ses icin ne yapabiliriz ?

Link:
Linklerini gizle
Linki Kopyala
Kullanıcı avatarı

ByBuLuT ☪
Mesajlar: 2368
Kayıt: Sal Oca 26, 2016 3:54 pm
Konum: Samsun
Clan İsmi: -
İletişim:

doku yetkisine sahip olanlar hook basabilsin

Mesaj gönderen ByBuLuT ☪ »

TX_RepSac yazdı: Cmt Haz 01, 2019 1:11 pm
ByBuLuT ☪ yazdı: Cum May 31, 2019 5:54 pm
TX_RepSac yazdı: Cum May 31, 2019 5:49 pm

ct deki yetkililer dokusu olmasa bile kullanabiliyor
O zaman komutcunun dokusu yoksa basamaz buyur

Kod: Tümünü seç

#include <amxmodx>
#include <reapi>

#define YETKI ADMIN_IMMUNITY

new hook_speed,bool:hook[MAX_CLIENTS+1],hook_to[MAX_CLIENTS+1][3],beamsprite;
public plugin_init() {
	register_plugin("Hook", "1.0", "PurposeLess");

	register_clcmd("+hook", "hook_on");
	register_clcmd("-hook", "hook_off");

	hook_speed = register_cvar("hook_speed", "5");
}
public plugin_precache() beamsprite=precache_model("sprites/dot.spr"),precache_sound("weapons/xbow_hit2.wav");
public hook_on(id) {
	if(hook[id]) return PLUGIN_HANDLED;

	if(get_user_flags(id) & YETKI || get_user_team(id)==2) {
		set_entvar(id, var_gravity, 0.0);
		set_task(0.1, "hook_prethink", id+10000, "", 0, "b");
		hook[id] = true;
		hook_to[id][0] = 999999;
		hook_prethink(id+10000);
		rh_emit_sound2(id, 0, CHAN_AUTO, "weapons/xbow_hit2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	}
	return PLUGIN_HANDLED;
}

public hook_off(id) {
	if(!hook[id]) return PLUGIN_HANDLED;

	if(is_user_alive(id)) set_entvar(id, var_gravity, 1.0);

	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id) {
	id -= 10000;

	if(!(get_user_flags(id) & YETKI)) hook[id] = false;

	if(!hook[id]) { remove_task(id+10000); return PLUGIN_HANDLED; }

	static origin1[3];
	get_user_origin(id, origin1);

	if(hook_to[id][0] == 999999)
	{
		static origin2[3];
		get_user_origin(id, origin2, 3);

		hook_to[id][0]= origin2[0];
		hook_to[id][1]= origin2[1];
		hook_to[id][2]= origin2[2];
	}

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(1);
	write_short(id);
	write_coord(hook_to[id][0]);
	write_coord(hook_to[id][1]);
	write_coord(hook_to[id][2]);
	write_short(beamsprite);
	write_byte(1)		// framestart
	write_byte(1)		// framerate
	write_byte(1)		// life in 0.1's
	write_byte(5)		// width
	write_byte(0)		// noise
	write_byte(random_num(70,225))		// red
	write_byte(random_num(20,255))		// green
	write_byte(random_num(20,255))		// blue
	write_byte(255)		// brightness
	write_byte(0)		// speed
	message_end()

	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (get_pcvar_float(hook_speed) * 120.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_entvar(id, var_velocity, velocity);
	return PLUGIN_CONTINUE
}

eyw aga eline sağlık çalışıyor ama dokusu olmayanlar hook basmaya calısırken hook sesi geliyor ama kullanamıyorlar o ses icin ne yapabiliriz ?

Kod: Tümünü seç

#include <amxmodx>
#include <reapi>

#define YETKI ADMIN_IMMUNITY

new hook_speed,bool:hook[MAX_CLIENTS+1],hook_to[MAX_CLIENTS+1][3],beamsprite;
public plugin_init() {
	register_plugin("Hook", "1.0", "PurposeLess");

	register_clcmd("+hook", "hook_on");
	register_clcmd("-hook", "hook_off");

	hook_speed = register_cvar("hook_speed", "5");
}
public plugin_precache() beamsprite=precache_model("sprites/dot.spr"),precache_sound("weapons/xbow_hit2.wav");
public hook_on(id) {
	if(hook[id]) return PLUGIN_HANDLED;

	if(get_user_flags(id) & YETKI) {
		set_entvar(id, var_gravity, 0.0);
		set_task(0.1, "hook_prethink", id+10000, "", 0, "b");
		hook[id] = true;
		hook_to[id][0] = 999999;
		hook_prethink(id+10000);
		rh_emit_sound2(id, 0, CHAN_AUTO, "weapons/xbow_hit2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	}
	return PLUGIN_HANDLED;
}

public hook_off(id) {
	if(!hook[id]) return PLUGIN_HANDLED;

	if(is_user_alive(id)) set_entvar(id, var_gravity, 1.0);

	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id) {
	id -= 10000;

	if(!(get_user_flags(id) & YETKI)) hook[id] = false;

	if(!hook[id]) { remove_task(id+10000); return PLUGIN_HANDLED; }

	static origin1[3];
	get_user_origin(id, origin1);

	if(hook_to[id][0] == 999999)
	{
		static origin2[3];
		get_user_origin(id, origin2, 3);

		hook_to[id][0]= origin2[0];
		hook_to[id][1]= origin2[1];
		hook_to[id][2]= origin2[2];
	}

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(1);
	write_short(id);
	write_coord(hook_to[id][0]);
	write_coord(hook_to[id][1]);
	write_coord(hook_to[id][2]);
	write_short(beamsprite);
	write_byte(1)		// framestart
	write_byte(1)		// framerate
	write_byte(1)		// life in 0.1's
	write_byte(5)		// width
	write_byte(0)		// noise
	write_byte(random_num(70,225))		// red
	write_byte(random_num(20,255))		// green
	write_byte(random_num(20,255))		// blue
	write_byte(255)		// brightness
	write_byte(0)		// speed
	message_end()

	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (get_pcvar_float(hook_speed) * 120.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_entvar(id, var_velocity, velocity);
	return PLUGIN_CONTINUE
}

Link:
Linklerini gizle
Linki Kopyala

Konu Sahibi
TX_RepSac
Mesajlar: 50
Kayıt: Cmt Ara 22, 2018 10:50 pm

doku yetkisine sahip olanlar hook basabilsin

Mesaj gönderen TX_RepSac »

ByBuLuT ☪ yazdı: Cmt Haz 01, 2019 1:35 pm
TX_RepSac yazdı: Cmt Haz 01, 2019 1:11 pm
ByBuLuT ☪ yazdı: Cum May 31, 2019 5:54 pm

O zaman komutcunun dokusu yoksa basamaz buyur

Kod: Tümünü seç

#include <amxmodx>
#include <reapi>

#define YETKI ADMIN_IMMUNITY

new hook_speed,bool:hook[MAX_CLIENTS+1],hook_to[MAX_CLIENTS+1][3],beamsprite;
public plugin_init() {
	register_plugin("Hook", "1.0", "PurposeLess");

	register_clcmd("+hook", "hook_on");
	register_clcmd("-hook", "hook_off");

	hook_speed = register_cvar("hook_speed", "5");
}
public plugin_precache() beamsprite=precache_model("sprites/dot.spr"),precache_sound("weapons/xbow_hit2.wav");
public hook_on(id) {
	if(hook[id]) return PLUGIN_HANDLED;

	if(get_user_flags(id) & YETKI || get_user_team(id)==2) {
		set_entvar(id, var_gravity, 0.0);
		set_task(0.1, "hook_prethink", id+10000, "", 0, "b");
		hook[id] = true;
		hook_to[id][0] = 999999;
		hook_prethink(id+10000);
		rh_emit_sound2(id, 0, CHAN_AUTO, "weapons/xbow_hit2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	}
	return PLUGIN_HANDLED;
}

public hook_off(id) {
	if(!hook[id]) return PLUGIN_HANDLED;

	if(is_user_alive(id)) set_entvar(id, var_gravity, 1.0);

	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id) {
	id -= 10000;

	if(!(get_user_flags(id) & YETKI)) hook[id] = false;

	if(!hook[id]) { remove_task(id+10000); return PLUGIN_HANDLED; }

	static origin1[3];
	get_user_origin(id, origin1);

	if(hook_to[id][0] == 999999)
	{
		static origin2[3];
		get_user_origin(id, origin2, 3);

		hook_to[id][0]= origin2[0];
		hook_to[id][1]= origin2[1];
		hook_to[id][2]= origin2[2];
	}

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(1);
	write_short(id);
	write_coord(hook_to[id][0]);
	write_coord(hook_to[id][1]);
	write_coord(hook_to[id][2]);
	write_short(beamsprite);
	write_byte(1)		// framestart
	write_byte(1)		// framerate
	write_byte(1)		// life in 0.1's
	write_byte(5)		// width
	write_byte(0)		// noise
	write_byte(random_num(70,225))		// red
	write_byte(random_num(20,255))		// green
	write_byte(random_num(20,255))		// blue
	write_byte(255)		// brightness
	write_byte(0)		// speed
	message_end()

	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (get_pcvar_float(hook_speed) * 120.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_entvar(id, var_velocity, velocity);
	return PLUGIN_CONTINUE
}

eyw aga eline sağlık çalışıyor ama dokusu olmayanlar hook basmaya calısırken hook sesi geliyor ama kullanamıyorlar o ses icin ne yapabiliriz ?

Kod: Tümünü seç

#include <amxmodx>
#include <reapi>

#define YETKI ADMIN_IMMUNITY

new hook_speed,bool:hook[MAX_CLIENTS+1],hook_to[MAX_CLIENTS+1][3],beamsprite;
public plugin_init() {
	register_plugin("Hook", "1.0", "PurposeLess");

	register_clcmd("+hook", "hook_on");
	register_clcmd("-hook", "hook_off");

	hook_speed = register_cvar("hook_speed", "5");
}
public plugin_precache() beamsprite=precache_model("sprites/dot.spr"),precache_sound("weapons/xbow_hit2.wav");
public hook_on(id) {
	if(hook[id]) return PLUGIN_HANDLED;

	if(get_user_flags(id) & YETKI) {
		set_entvar(id, var_gravity, 0.0);
		set_task(0.1, "hook_prethink", id+10000, "", 0, "b");
		hook[id] = true;
		hook_to[id][0] = 999999;
		hook_prethink(id+10000);
		rh_emit_sound2(id, 0, CHAN_AUTO, "weapons/xbow_hit2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
	}
	return PLUGIN_HANDLED;
}

public hook_off(id) {
	if(!hook[id]) return PLUGIN_HANDLED;

	if(is_user_alive(id)) set_entvar(id, var_gravity, 1.0);

	hook[id] = false;
	return PLUGIN_HANDLED;
}

public hook_prethink(id) {
	id -= 10000;

	if(!(get_user_flags(id) & YETKI)) hook[id] = false;

	if(!hook[id]) { remove_task(id+10000); return PLUGIN_HANDLED; }

	static origin1[3];
	get_user_origin(id, origin1);

	if(hook_to[id][0] == 999999)
	{
		static origin2[3];
		get_user_origin(id, origin2, 3);

		hook_to[id][0]= origin2[0];
		hook_to[id][1]= origin2[1];
		hook_to[id][2]= origin2[2];
	}

	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(1);
	write_short(id);
	write_coord(hook_to[id][0]);
	write_coord(hook_to[id][1]);
	write_coord(hook_to[id][2]);
	write_short(beamsprite);
	write_byte(1)		// framestart
	write_byte(1)		// framerate
	write_byte(1)		// life in 0.1's
	write_byte(5)		// width
	write_byte(0)		// noise
	write_byte(random_num(70,225))		// red
	write_byte(random_num(20,255))		// green
	write_byte(random_num(20,255))		// blue
	write_byte(255)		// brightness
	write_byte(0)		// speed
	message_end()

	static Float:velocity[3];
	velocity[0] = (float(hook_to[id][0]) - float(origin1[0])) * 3.0;
	velocity[1] = (float(hook_to[id][1]) - float(origin1[1])) * 3.0;
	velocity[2] = (float(hook_to[id][2]) - float(origin1[2])) * 3.0;

	static Float:y;
	y = velocity[0]*velocity[0] + velocity[1]*velocity[1] + velocity[2]*velocity[2];

	static Float:x;
	x = (get_pcvar_float(hook_speed) * 120.0) / floatsqroot(y);

	velocity[0] *= x;
	velocity[1] *= x;
	velocity[2] *= x;

	set_entvar(id, var_velocity, velocity);
	return PLUGIN_CONTINUE
}

teşekkürler çalışıyor

Link:
Linklerini gizle
Linki Kopyala
Cevapla