BaseBuilder Rengarenk Hook
Gönderilme zamanı: Çrş Ağu 12, 2020 5:53 pm
Elinde basebuilder modu için (oluşturma süresinde kullanabilecek) b yetkisinin kullanabileceği rengarenk hook eklentisi varsa atabilir mi ?
Kod: Tümünü seç
#pragma semicolon 1
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
native bb_is_build_phase();
new bool:hook[33],hook_to[33][3],hook_speed_cvar,bool:has_hook[33],beamsprite;
static const hooksound[]="hookup.wav";
static const via[3][21]={"Hook For BaseBuilder","0.1","Anonim & Aconyonn"};
public plugin_init(){
register_plugin(via[0],via[1][0],via[2][0]);
register_concmd("+hook","hook_on");
register_concmd("-hook","hook_off");
register_concmd("hook_toggle","hook_toggle");
register_concmd("amx_give_hook","cmd_givetake",0,"Give a player the ability to hook <nick>");
register_concmd("amx_take_hook","cmd_givetake",0,"Take a player's ability to hook <nick>");
hook_speed_cvar = register_cvar("hook_speed","10");
}
public plugin_precache(){
beamsprite = precache_model("sprites/dot.spr");
precache_sound(hooksound);
}
public client_putinserver(id){
has_hook[id]=false;
}
public cmd_givetake(const id,const level,const cid){
if(!cmd_access(id,level,cid,2)){return PLUGIN_HANDLED;}
new arg1[32];read_argv(1,arg1,charsmax(arg1));
if(!cmd_target(id,arg1,9)){return PLUGIN_HANDLED;}
new name[32];get_user_name(cmd_target(id,arg1,9),name,charsmax(name));
if(get_user_flags(cmd_target(id,arg1,9)) & ADMIN_IMMUNITY){
client_print(id,print_center,"%s adli kisiye hook verilemiyor!",name);
return PLUGIN_HANDLED;
}
new arg0[32];read_argv(0,arg0,charsmax(arg0));
if(containi(arg0,"give")!=-1){
if(containi(arg0,"hook")!=-1){
if(has_hook[cmd_target(id,arg1,9)]){client_print(id,print_center,"%s adli kisinin zaten hook'u var",name);
}else{
has_hook[cmd_target(id,arg1,9)] = true;
client_print(id,print_center,"%s adli kisiye hook verildi!",name);
client_print(cmd_target(id,arg1,9),print_center,"Bir admin sana hook verdi! Konsola ^"bind tus +hook^" yazarak kullanabilirsin!");
}
}
}
if(containi(arg0,"take")!=-1){
if(containi(arg0,"hook")!=-1){
if(!has_hook[cmd_target(id,arg1,9)]){client_print(id,print_center,"%s adli kisinin zaten hook'u yok!",name);
}else{
has_hook[cmd_target(id,arg1,9)] = false;
client_print(id,print_center,"%s adli kisinin hook'unu kapattiniz!",name);
client_print(cmd_target(id,arg1,9),print_center,"Bir admin hook'unu kapatti!");
}
}
}
return PLUGIN_HANDLED;
}
public hook_toggle(const id,const level,const cid){
if(hook[id]) hook_off(id);
else hook_on(id,level,cid);
return PLUGIN_HANDLED;
}
public hook_on(const id,const level,const cid){
if(!has_hook[id] && !cmd_access(id,level,cid,1)){return PLUGIN_HANDLED;}
if(bb_is_build_phase()){
if(hook[id]){return PLUGIN_HANDLED;}
set_user_gravity(id,0.0);
set_task(0.1,"hook_prethink",id+10000,"",0,"b");
hook[id] = true;
hook_to[id][0] = 999999;
hook_prethink(id+10000);
emit_sound(id,CHAN_VOICE,hooksound,1.0,ATTN_NORM,id,PITCH_NORM);
}else{hook_off(id);remove_task(id);}
return PLUGIN_HANDLED;
}
public hook_off(const id){
if(is_user_alive(id))set_user_gravity(id);
hook[id] = false;
return PLUGIN_HANDLED;
}
public hook_prethink(id){
id -= 10000;
if(!is_user_alive(id)){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,charsmax(origin2));
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); //TE_BEAMENTPOINT
write_short(id); // start entity
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(2); // framerate
write_byte(2); // life in 0.1's
write_byte(50); // width
write_byte(0); // noise
switch(random_num(1,10)){
case 1:write_byte(0),write_byte(255),write_byte(255);
case 2:write_byte(255),write_byte(0),write_byte(255);
case 3:write_byte(0),write_byte(0),write_byte(255);
case 4:write_byte(232),write_byte(0),write_byte(0);
case 5:write_byte(255),write_byte(0),write_byte(0);
case 6:write_byte(255),write_byte(232),write_byte(0);
case 7:write_byte(255),write_byte(0),write_byte(232);
case 8:write_byte(255),write_byte(0),write_byte(145);
case 9:write_byte(255),write_byte(192),write_byte(0);
case 10:write_byte(255),write_byte(198),write_byte(0);
}
write_byte(300); // 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_cvar) * 120.0) / floatsqroot(y);
velocity[0] *= x;
velocity[1] *= x;
velocity[2] *= x;
set_velo(id,velocity);
return PLUGIN_CONTINUE;
}
public set_velo(const id,const Float:velocity[3]){
return set_pev(id,pev_velocity,velocity);
}Teşekkürler, hookun boyutunu inceltebilme imkanın var mı ?Aconyonn yazdı: Çrş Ağu 12, 2020 5:56 pm Buyur,Kod: Tümünü seç
#pragma semicolon 1 #include <amxmodx> #include <amxmisc> #include <fun> #include <fakemeta> native bb_is_build_phase(); new bool:hook[33],hook_to[33][3],hook_speed_cvar,bool:has_hook[33],beamsprite; static const hooksound[]="hookup.wav"; static const via[3][21]={"Hook For BaseBuilder","0.1","Anonim & Aconyonn"}; public plugin_init(){ register_plugin(via[0],via[1][0],via[2][0]); register_concmd("+hook","hook_on"); register_concmd("-hook","hook_off"); register_concmd("hook_toggle","hook_toggle"); register_concmd("amx_give_hook","cmd_givetake",0,"Give a player the ability to hook <nick>"); register_concmd("amx_take_hook","cmd_givetake",0,"Take a player's ability to hook <nick>"); hook_speed_cvar = register_cvar("hook_speed","10"); } public plugin_precache(){ beamsprite = precache_model("sprites/dot.spr"); precache_sound(hooksound); } public client_putinserver(id){ has_hook[id]=false; } public cmd_givetake(const id,const level,const cid){ if(!cmd_access(id,level,cid,2)){return PLUGIN_HANDLED;} new arg1[32];read_argv(1,arg1,charsmax(arg1)); if(!cmd_target(id,arg1,9)){return PLUGIN_HANDLED;} new name[32];get_user_name(cmd_target(id,arg1,9),name,charsmax(name)); if(get_user_flags(cmd_target(id,arg1,9)) & ADMIN_IMMUNITY){ client_print(id,print_center,"%s adli kisiye hook verilemiyor!",name); return PLUGIN_HANDLED; } new arg0[32];read_argv(0,arg0,charsmax(arg0)); if(containi(arg0,"give")!=-1){ if(containi(arg0,"hook")!=-1){ if(has_hook[cmd_target(id,arg1,9)]){client_print(id,print_center,"%s adli kisinin zaten hook'u var",name); }else{ has_hook[cmd_target(id,arg1,9)] = true; client_print(id,print_center,"%s adli kisiye hook verildi!",name); client_print(cmd_target(id,arg1,9),print_center,"Bir admin sana hook verdi! Konsola ^"bind tus +hook^" yazarak kullanabilirsin!"); } } } if(containi(arg0,"take")!=-1){ if(containi(arg0,"hook")!=-1){ if(!has_hook[cmd_target(id,arg1,9)]){client_print(id,print_center,"%s adli kisinin zaten hook'u yok!",name); }else{ has_hook[cmd_target(id,arg1,9)] = false; client_print(id,print_center,"%s adli kisinin hook'unu kapattiniz!",name); client_print(cmd_target(id,arg1,9),print_center,"Bir admin hook'unu kapatti!"); } } } return PLUGIN_HANDLED; } public hook_toggle(const id,const level,const cid){ if(hook[id]) hook_off(id); else hook_on(id,level,cid); return PLUGIN_HANDLED; } public hook_on(const id,const level,const cid){ if(!has_hook[id] && !cmd_access(id,level,cid,1)){return PLUGIN_HANDLED;} if(bb_is_build_phase()){ if(hook[id]){return PLUGIN_HANDLED;} set_user_gravity(id,0.0); set_task(0.1,"hook_prethink",id+10000,"",0,"b"); hook[id] = true; hook_to[id][0] = 999999; hook_prethink(id+10000); emit_sound(id,CHAN_VOICE,hooksound,1.0,ATTN_NORM,id,PITCH_NORM); }else{hook_off(id);remove_task(id);} return PLUGIN_HANDLED; } public hook_off(const id){ if(is_user_alive(id))set_user_gravity(id); hook[id] = false; return PLUGIN_HANDLED; } public hook_prethink(id){ id -= 10000; if(!is_user_alive(id)){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,charsmax(origin2)); 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); //TE_BEAMENTPOINT write_short(id); // start entity 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(2); // framerate write_byte(2); // life in 0.1's write_byte(50); // width write_byte(0); // noise switch(random_num(1,10)){ case 1:write_byte(0),write_byte(255),write_byte(255); case 2:write_byte(255),write_byte(0),write_byte(255); case 3:write_byte(0),write_byte(0),write_byte(255); case 4:write_byte(232),write_byte(0),write_byte(0); case 5:write_byte(255),write_byte(0),write_byte(0); case 6:write_byte(255),write_byte(232),write_byte(0); case 7:write_byte(255),write_byte(0),write_byte(232); case 8:write_byte(255),write_byte(0),write_byte(145); case 9:write_byte(255),write_byte(192),write_byte(0); case 10:write_byte(255),write_byte(198),write_byte(0); } write_byte(300); // 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_cvar) * 120.0) / floatsqroot(y); velocity[0] *= x; velocity[1] *= x; velocity[2] *= x; set_velo(id,velocity); return PLUGIN_CONTINUE; } public set_velo(const id,const Float:velocity[3]){ return set_pev(id,pev_velocity,velocity); }
124. satırda ki "write_byte(300); düşürürsen incelecektir..LoseBasgan yazdı: Çrş Ağu 12, 2020 6:06 pm Teşekkürler, hookun boyutunu inceltebilme imkanın var mı ?
Teşekkürler.Aconyonn yazdı: Çrş Ağu 12, 2020 6:11 pm124. satırda ki "write_byte(300); düşürürsen incelecektir..LoseBasgan yazdı: Çrş Ağu 12, 2020 6:06 pm Teşekkürler, hookun boyutunu inceltebilme imkanın var mı ?
Bu galiba saydamlık ayarı boyutunu küçültemez miyiz ?Aconyonn yazdı: Çrş Ağu 12, 2020 6:11 pm124. satırda ki "write_byte(300); düşürürsen incelecektir..LoseBasgan yazdı: Çrş Ağu 12, 2020 6:06 pm Teşekkürler, hookun boyutunu inceltebilme imkanın var mı ?