Hook ve Grab
Gönderilme zamanı: Çrş Nis 24, 2019 5:26 pm
Ben Sadice Rcon Yetkisi Olanların T deyken Hook basmasını istiyorum.Böyle Bir Şey Mümkün Mü ? Yani sADice kurucular T de hook Basabilcek Lütfen ? 
Kod: Tümünü seç
#include <amxmodx>
#include <reapi>
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(!(get_user_flags(id) & ADMIN_RCON)|| hook[id]) return PLUGIN_HANDLED;
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) & ADMIN_RCON)) 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
}bunu baska bir harf yetkisine uyarliyabiliyor muyuz ?Necati Doğan yazdı: Çrş Nis 24, 2019 6:59 pmKod: Tümünü seç
#include <amxmodx> #include <reapi> 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(!(get_user_flags(id) & ADMIN_RCON)|| hook[id]) return PLUGIN_HANDLED; 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) & ADMIN_RCON)) 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 }
necati bu pluginde sadece l yetkisine sahip olan t ct ler hook basabiliyor. sadece t lerde l yetkisine sahip olanlar icin ayarlayabilirmisinNecati Doğan yazdı: Çrş Nis 24, 2019 6:59 pmKod: Tümünü seç
#include <amxmodx> #include <reapi> 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(!(get_user_flags(id) & ADMIN_RCON)|| hook[id]) return PLUGIN_HANDLED; 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) & ADMIN_RCON)) 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 }