hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2025.08.08. 04:14



Jelenlévő felhasználók

Jelenleg 357 felhasználó van jelen :: 2 regisztrált, 0 rejtett és 355 vendég

A legtöbb felhasználó (2883 fő) 2025.07.30. 16:00-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot], Google [Bot]az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása Hozzászólás a témához  [11 hozzászólás ]  Oldal12Következő
Szerző Üzenet
 Hozzászólás témája: Admin Spec ESP
HozzászólásElküldve:2012.07.21. 03:42 
Offline
Őskövület
Avatar

Csatlakozott:2013.01.01. 17:48
Hozzászólások:2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Üdv.!

Ez a plugin csak nálam nem megy?!

http://amxmodx.crys.hu/site/?p=pluginz&c=l&f=asdlol123

Beteszema szeróra, resi, aztán nézőbe bejelentkezek adminba, nézek egy gyereket first personban, és beírom a consolba hogy esp_toggle de semmi, aztán esp_menu, de semmi. Ugyan ezt csetbe is beírom, de semmi. Valakinek ötlet? (modul telepítve van)


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Admin Spec ESP
HozzászólásElküldve:2012.07.21. 08:33 
Offline
Developer
Avatar

Csatlakozott:2011.06.01. 21:11
Hozzászólások:7966
Megköszönt másnak: 295 alkalommal
Megköszönték neki: 537 alkalommal
Nézd meg logot, s rájössz a hibára, ha nem másold be a logot!

_________________
http://www.easyrankup.eu


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Admin Spec ESP
HozzászólásElküldve:2012.07.21. 13:34 
Offline
Őskövület
Avatar

Csatlakozott:2013.01.01. 17:48
Hozzászólások:2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Okey!

Na a log semmit nem ír, pluginok között fut szépen, de nem lehet használni:
Kód:
  1. [ 92] Admin Spectator ESP     1.3         KoST              admin_spec_esp.  running  

Pedig allieds ről szedtem le.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Admin Spec ESP
HozzászólásElküldve:2012.07.21. 13:46 
Offline
Őskövület
Avatar

Csatlakozott:2012.02.07. 23:34
Hozzászólások:2192
Megköszönt másnak: 27 alkalommal
Megköszönték neki: 55 alkalommal
próbáld steam id re az admint ,mert nekem loginoson nem mindig megy...

_________________
[sma]CMD:fear(playerid, params[]){ new str[5]; if(!sscanf(params, "s[5]", str)){ if(egyezik(str, "find")) Msg(playerid, "A-a!");}  return 1;}[/sma]


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Admin Spec ESP
HozzászólásElküldve:2012.07.21. 13:56 
Offline
Őstag
Avatar

Csatlakozott:2011.08.27. 23:19
Hozzászólások:1023
Megköszönt másnak: 3 alkalommal
Megköszönték neki: 11 alkalommal
Loginosnak egyáltalán nem megy :D
Viszont néha van olyan, hogy alapból nem kapcsolódik be. Add steam ID-re, ha úgyse jó, akkor ird be chatbe, hogy "/esp_toggle" ha úgyse jó, akkor írd be chatbe, hogy "/esp_menu" és nézd meg mik vannak KI/BE kapcsolva. Ha úgyse jó, akkor nem tudom...xD

_________________
[kozep]t/s[/kozep]


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Admin Spec ESP
HozzászólásElküldve:2012.07.21. 19:25 
Offline
Őstag
Avatar

Csatlakozott:2012.02.14. 15:09
Hozzászólások:1423
Megköszönték neki: 2 alkalommal
R betűvel könnyebb...xd

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Admin Spec ESP
HozzászólásElküldve:2012.07.21. 21:19 
Offline
Őskövület
Avatar

Csatlakozott:2013.01.01. 17:48
Hozzászólások:2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Amúgy télleg nem megy loginra. Azért köszöntem! (2008 as plugin, még akkor gép se volt nem hogy login :) )


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Admin Spec ESP
HozzászólásElküldve:2012.07.26. 07:08 
Offline
Veterán
Avatar

Csatlakozott:2011.06.07. 15:29
Hozzászólások:1728
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 63 alkalommal
Amit bemásoltál, az nem log. Szerver log kell. ( ha még aktuális a probléma ) Attól hogy fut, még nem biztos, hogy jó.


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Admin Spec ESP
HozzászólásElküldve:2012.07.26. 10:38 
Offline
Őskövület
Avatar

Csatlakozott:2013.01.01. 17:48
Hozzászólások:2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Tudom tudom, bocs! De az a lényeg hogy users.ini ben beírt steam id-n, vagy egyéb azonosítónál működik...


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Admin Spec ESP
HozzászólásElküldve:2012.07.26. 12:14 
Offline
Signore Senior
Avatar

Csatlakozott:2011.09.09. 17:39
Hozzászólások:4020
Megköszönt másnak: 12 alkalommal
Megköszönték neki: 139 alkalommal
Átírtam, mostmár loginoson is működik.

Kód:
  1. //--------------------------------------------------------------------------------------------------

  2.  

  3. #include <amxmodx>

  4. #include <engine>

  5.  

  6. // Here you can adjust the required admin level if needed


  7.  

  8. #define REQUIRED_ADMIN_LEVEL ADMIN_KICK

  9.  

  10. //--------------------------------------------------------------------------------------------------

  11.  

  12. #define PLUGIN "Admin Spectator ESP"

  13. #define VERSION "1.3"

  14. #define AUTHOR "KoST"

  15.  

  16. enum {

  17.         ESP_ON=0,

  18.         ESP_LINE,

  19.         ESP_BOX,

  20.         ESP_NAME,

  21.         ESP_HEALTH_ARMOR,

  22.         ESP_WEAPON,

  23.         ESP_CLIP_AMMO,

  24.         ESP_DISTANCE,

  25.         ESP_TEAM_MATES,

  26.         ESP_AIM_VEC,

  27. }

  28.  

  29. new bool:admin[33] // is/is not admin

  30. new bool:first_person[33] //is/is not in first person view

  31. new spec[33] // spec[player_id]=the players id if

  32. new laser // precached model

  33. new max_players // if you start hlds with +maxplayers 20 for example this would be 20

  34. new team_colors[4][3]={{0,0,0},{150,0,0},{0,0,150},{0,150,0}}

  35. new esp_colors[5][3]={{0,255,0},{100,60,60},{60,60,100},{255,0,255},{128,128,128}}

  36. new bool:ducking[33] //is/is not player ducked

  37. new damage_done_to[33] //damage_done_to[p1]=p2 // p1 has hit p2

  38. new view_target[33] // attackers victim

  39. new bool:admin_options[33][10] // individual esp options

  40. new bool:is_in_menu[33] // has esp menu open

  41.  

  42. // weapon strings

  43. new weapons[30][10]={"None","P228","Scout","HE","XM1014","C4",

  44.         "MAC-10","AUG","Smoke","Elite","Fiveseven",

  45.         "UMP45","SIG550","Galil","Famas","USP",

  46.         "Glock","AWP","MP5","M249","M3","M4A1",

  47.         "TMP","G3SG1","Flash","Deagle","SG552",

  48.         "AK47","Knife","P90"}

  49.  

  50. public plugin_precache(){

  51.         laser=precache_model("sprites/laserbeam.spr")

  52. }

  53.  

  54. public plugin_init(){

  55.         register_plugin(PLUGIN,VERSION,AUTHOR)

  56.         server_print("^n^t%s v%s, Copyright (C) 2006 by %s^n",PLUGIN,VERSION,AUTHOR)

  57.         register_clcmd("amx_login", "checkadmin");

  58.         // cvars

  59.         register_cvar("esp","1")

  60.         register_cvar("esp_timer","0.3")

  61.         register_cvar("esp_allow_all","0")

  62.         register_cvar("esp_disable_default_keys","0")

  63.         register_cvar("aesp_version",VERSION,FCVAR_SERVER|FCVAR_UNLOGGED|FCVAR_SPONLY)

  64.        

  65.         // client commands

  66.         register_clcmd("esp_menu","cmd_esp_menu",REQUIRED_ADMIN_LEVEL,"Shows ESP Menu")

  67.         register_clcmd("esp_toggle","cmd_esp_toggle",REQUIRED_ADMIN_LEVEL,"Toggle ESP on/off")

  68.         register_clcmd("say /esp_menu","cmd_esp_menu",REQUIRED_ADMIN_LEVEL,"Shows ESP Menu")

  69.         register_clcmd("say /esp_toggle","cmd_esp_toggle",REQUIRED_ADMIN_LEVEL,"Toggle ESP on/off")

  70.         register_clcmd("esp_settings","cmd_esp_settings",REQUIRED_ADMIN_LEVEL," ESP adasdsassdasd")

  71.        

  72.        

  73.         // events

  74.         register_event("StatusValue","spec_target","bd","1=2")

  75.         register_event("SpecHealth2","spec_target","bd")

  76.         register_event("TextMsg","spec_mode","b","2&#Spec_Mode")

  77.         register_event("Damage", "event_Damage", "b", "2!0", "3=0", "4!0")

  78.         register_event("ResetHUD", "reset_hud_alive", "be")

  79.        

  80.        

  81.         // menu

  82.         new keys=MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9

  83.         register_menucmd(register_menuid("Admin Specator ESP"),keys,"menu_esp")

  84.        

  85.         max_players=get_maxplayers()

  86.        

  87.         // start esp_timer for the first time

  88.         set_task(1.0,"esp_timer")

  89. }

  90.  

  91. public reset_hud_alive(id){

  92.         spec[id]=0

  93.         return PLUGIN_CONTINUE

  94. }

  95.  

  96. public cmd_esp_settings(id){

  97.         if (admin[id]){

  98.                 new out[11]

  99.                 read_argv(1,out,10)

  100.                 new len=strlen(out)    

  101.                 for (new i=0;i<len;i++){

  102.                         if (out[i]=='1'){

  103.                                 admin_options[id][i]=true

  104.                         }else{

  105.                                 admin_options[id][i]=false

  106.                         }

  107.                 }

  108.         }

  109. }

  110.  

  111. public cmd_esp_menu(id){

  112.         if (admin[id] && get_cvar_num("esp")==1){

  113.                 show_esp_menu(id)

  114.         }

  115. }

  116.  

  117. public cmd_esp_toggle(id){

  118.         if (admin[id] && get_cvar_num("esp")==1){

  119.                 change_esp_status(id,!admin_options[id][0])

  120.         }

  121. }

  122.  

  123. public show_esp_menu(id){

  124.         is_in_menu[id]=true

  125.         new menu[301]

  126.         new keys=MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9

  127.         new onoff[2][]={{"\ki\"},{"\be\"}} // \r=Piros \y=Sarga \w=Feher

  128.         new text[2][]={{"(Itt tudod ki/be kapcsolni az admin wh funkcioit)"},{"(use esp_toggle command to toggle)"}} // \r=Piros \y=Sarga \w=Feher

  129.         new text_index=get_cvar_num("esp_disable_default_keys")

  130.         if (text_index!=1) text_index=0

  131.         format(menu, 300, "Admin Specator ESP^n %s %s^n^n1. Vonal %s^n2. HitBox %s^n3. Nev %s^n4. Hp/Ap %s^n5. Fegyver %s^n6. Loszer %s^n7. Tavolsag %s^n8. Csapattars %s^n9. AimVektor %s^n^n0. Kilep",

  132.         onoff[admin_options[id][ESP_ON]],

  133.         text[text_index],

  134.         onoff[admin_options[id][ESP_LINE]],

  135.         onoff[admin_options[id][ESP_BOX]],

  136.         onoff[admin_options[id][ESP_NAME]],

  137.         onoff[admin_options[id][ESP_HEALTH_ARMOR]],

  138.         onoff[admin_options[id][ESP_WEAPON]],

  139.         onoff[admin_options[id][ESP_CLIP_AMMO]],

  140.         onoff[admin_options[id][ESP_DISTANCE]],

  141.         onoff[admin_options[id][ESP_TEAM_MATES]],

  142.         onoff[admin_options[id][ESP_AIM_VEC]])

  143.         show_menu(id,keys,menu)

  144.        

  145.         return PLUGIN_HANDLED

  146. }

  147.  

  148. public menu_esp(id,key){

  149.         if (key==9){ // exit

  150.                 is_in_menu[id]=false

  151.                 return PLUGIN_HANDLED

  152.         }

  153.         // toggle esp options

  154.         if (admin_options[id][key+1]){

  155.                 admin_options[id][key+1]=false

  156.                 }else{

  157.                 admin_options[id][key+1]=true

  158.         }

  159.         show_esp_menu(id)

  160.         return PLUGIN_HANDLED

  161. }

  162.  

  163. public event_Damage(id){

  164.         if (id>0) {

  165.                 new attacker=get_user_attacker(id)

  166.                 if (attacker>0 && attacker<=max_players){

  167.                         if (view_target[attacker]==id){

  168.                                 damage_done_to[attacker]=id

  169.                         }

  170.                 }

  171.         }

  172.         return PLUGIN_CONTINUE

  173. }

  174.  

  175. public spec_mode(id){

  176.         // discover if in first_person_view

  177.         new specMode[12]

  178.         read_data(2,specMode,11)

  179.        

  180.         if(equal(specMode,"#Spec_Mode4")){

  181.                 first_person[id]=true

  182.                 }else{

  183.                 first_person[id]=false

  184.         }

  185.         return PLUGIN_CONTINUE

  186. }

  187.  

  188. public spec_target(id){

  189.         if (id>0){

  190.                 new target=read_data(2)

  191.                 if (target!=0){

  192.                         spec[id]=target

  193.                 }

  194.         }

  195.         return PLUGIN_CONTINUE

  196. }

  197.  

  198. public client_putinserver(id){

  199.         first_person[id]=false

  200.         if ((get_user_flags(id) & REQUIRED_ADMIN_LEVEL) || get_cvar_num("esp_allow_all")==1){

  201.                 admin[id]=true

  202.                 init_admin_options(id)

  203.                

  204.                 }else{

  205.                 admin[id]=false

  206.         }

  207. }

  208. public checkadmin(id)

  209. {

  210.         if ((get_user_flags(id) & REQUIRED_ADMIN_LEVEL) || get_cvar_num("esp_allow_all")==1){

  211.                 admin[id]=true

  212.                 init_admin_options(id)

  213.                

  214.                 }else{

  215.                 admin[id]=false

  216.         }

  217.         return PLUGIN_CONTINUE;

  218. }

  219. public init_admin_options(id){

  220.        

  221.         for (new i=0;i<10;i++){

  222.                 admin_options[id][i]=true

  223.         }

  224.         admin_options[id][ESP_TEAM_MATES]=false

  225.         load_vault_data(id)

  226. }

  227.  

  228. public save2vault(id){

  229.         if (admin[id]){

  230.                 new authid[35]

  231.                 get_user_authid (id,authid,34)

  232.                 new tmp[11]

  233.        

  234.                 for (new s=0;s<10;s++){

  235.                

  236.                         if (admin_options[id][s]){

  237.                                 tmp[s]='1';

  238.                         }else{

  239.                                 tmp[s]='0';

  240.                         }

  241.                 }

  242.                 tmp[10]=0

  243.  

  244.                 //server_print("STEAMID: %s OPTIONS: %s",authid,tmp);

  245.                 new key[41]

  246.                 format(key,40,"AESP_%s",authid)

  247.                

  248.                 set_vaultdata(key,tmp)

  249.         }

  250. }

  251.  

  252. public load_vault_data(id){

  253.         if (admin[id]){

  254.                 new data[11]

  255.                 new authid[35]

  256.                 get_user_authid (id,authid,34)

  257.                 new key[41]

  258.                 format(key,40,"AESP_%s",authid)

  259.                 get_vaultdata(key,data,10)

  260.                 if (strlen(data)>0){

  261.                         for (new s=0;s<10;s++){

  262.                                 if (data[s]=='1'){

  263.                                         admin_options[id][s]=true

  264.                                 }else{

  265.                                         admin_options[id][s]=false

  266.                                 }

  267.                         }

  268.                 }

  269.         }      

  270.        

  271. }

  272.  

  273. public client_disconnect(id){

  274.         save2vault(id)

  275.         admin[id]=false

  276.         spec[id]=0

  277. }

  278.  

  279. public change_esp_status(id,bool:on){

  280.         if (on){

  281.                 admin_options[id][0]=true

  282.                 if (!is_in_menu[id]) client_print(id,print_chat,"[%s] BEKAPCSOLVA",PLUGIN)

  283.                 if (is_in_menu[id]) show_esp_menu(id)

  284.         }else{

  285.                 admin_options[id][0]=false

  286.                 if (!is_in_menu[id]) client_print(id,print_chat,"[%s] KIKAPCSOLVA",PLUGIN)

  287.                 if (is_in_menu[id]) show_esp_menu(id)

  288.         }

  289. }

  290.  

  291. public client_PreThink(id){

  292.         if (!is_user_connected(id)) return PLUGIN_CONTINUE

  293.        

  294.         new button=get_user_button(id)

  295.         if (button==0) return PLUGIN_CONTINUE // saves a lot of cpu

  296.        

  297.         new oldbutton=get_user_oldbutton(id)

  298.        

  299.         if (button & IN_DUCK){

  300.                 ducking[id]=true

  301.                 }else{

  302.                 ducking[id]=false

  303.         }

  304.        

  305.         if ((get_cvar_num("esp")==1) && (get_cvar_num("esp_disable_default_keys")!=1)){

  306.                 if (admin[id]){

  307.                         if (first_person[id] && !is_user_alive(id)){

  308.                                 if ((button & IN_RELOAD) && !(oldbutton & IN_RELOAD)){

  309.                                         show_esp_menu(id)

  310.                                 }

  311.                                 if ((button & IN_FORWARD)  && !(oldbutton & IN_FORWARD) && !admin_options[id][0]){

  312.                                         change_esp_status(id,true)

  313.                                 }

  314.                                 if ((button & IN_BACK)  && !(oldbutton & IN_BACK) && admin_options[id][0]){

  315.                                         change_esp_status(id,false)

  316.                                 }

  317.                         }

  318.                 }

  319.         }

  320.         return PLUGIN_CONTINUE

  321. }

  322.  

  323. public draw_aim_vector(i,s,len){

  324.         new Float:endpoint[3]

  325.         new tmp[3]

  326.         new Float:vec1[3]

  327.         get_user_origin(s, tmp, 1)

  328.         IVecFVec(tmp,vec1)

  329.         vec1[2]-=6.0

  330.         VelocityByAim(s,len,endpoint) // get aim vector

  331.         addVec(endpoint,vec1) // add origin to get absolute coordinates

  332.         make_TE_BEAMPOINTS(i,4,vec1,endpoint,10,0,255)

  333.         return PLUGIN_CONTINUE

  334. }

  335.  

  336. public esp_timer(){

  337.        

  338.         if (get_cvar_num("esp")!=1) { // if esp is not 1, it is off

  339.                 set_task(1.0,"esp_timer") // check for reactivation in 1 sec intervals

  340.                 return PLUGIN_CONTINUE

  341.         }

  342.        

  343.         for (new i=1;i<=max_players;i++){ // loop through players

  344.                

  345.                 if (admin_options[i][ESP_ON] && first_person[i] && is_user_connected(i) && admin[i] && (!is_user_alive(i)) && (spec[i]>0) && is_user_alive(spec[i])){ // :)

  346.                        

  347.                         new spec_id=spec[i]

  348.                         new Float:my_origin[3]

  349.                         entity_get_vector(i,EV_VEC_origin,my_origin) // get origin of spectating admin

  350.                         new my_team

  351.                         my_team=get_team(spec_id) // get team of spectated :)

  352.                        

  353.                         new Float:smallest_angle=180.0

  354.                         new smallest_id=0

  355.                         new Float:xp=2.0,Float:yp=2.0 // x,y of hudmessage

  356.                         new Float:dist

  357.                        

  358.                         for (new s=1;s<=max_players;s++){ // loop through the targets

  359.                                 if (is_user_alive(s)){ // target must be alive

  360.                                         new target_team=get_team(s) // get team of target

  361.                                         if (!(target_team==3)){ //if not spectator

  362.                                                 if (spec_id!=s){ // do not target myself

  363.                                                         // if the target is in the other team and not spectator

  364.                                                        

  365.                                                         if (((my_team!=target_team && (target_team==1 || target_team==2)) || admin_options[i][ESP_TEAM_MATES])){

  366.                                                                

  367.                                                                 new Float:target_origin[3]

  368.                                                                 // get origin of target

  369.                                                                 entity_get_vector(s,EV_VEC_origin,target_origin)

  370.                                                                

  371.                                                                

  372.                                                                 // get distance from me to target

  373.                                                                 new Float:distance=vector_distance(my_origin,target_origin)

  374.                                                                

  375.                                                                 if (admin_options[i][ESP_LINE]){

  376.                                                                        

  377.                                                                         new width

  378.                                                                         if (distance<2040.0){

  379.                                                                                 // calculate width according to distance

  380.                                                                                 width=(255-floatround(distance/8.0))/3

  381.                                                                                 }else{

  382.                                                                                 width=1

  383.                                                                         }      

  384.                                                                         // create temp_ent

  385.                                                                         make_TE_BEAMENTPOINT(i,target_origin,width,target_team)

  386.                                                                 }

  387.                                                                

  388.                                                                

  389.                                                                 // get vector from me to target

  390.                                                                 new Float:v_middle[3]

  391.                                                                 subVec(target_origin,my_origin,v_middle)

  392.                                                                

  393.                                                                 // trace from me to target, getting hitpoint

  394.                                                                 new Float:v_hitpoint[3]

  395.                                                                 trace_line (-1,my_origin,target_origin,v_hitpoint)

  396.                                                                

  397.                                                                 // get distance from me to hitpoint (nearest wall)

  398.                                                                 new Float:distance_to_hitpoint=vector_distance(my_origin,v_hitpoint)

  399.                                                                

  400.                                                                 // scale

  401.                                                                 new Float:scaled_bone_len

  402.                                                                 if (ducking[spec_id]){

  403.                                                                         scaled_bone_len=distance_to_hitpoint/distance*(50.0-18.0)

  404.                                                                         }else{

  405.                                                                         scaled_bone_len=distance_to_hitpoint/distance*50.0

  406.                                                                 }

  407.                                                                 scaled_bone_len=distance_to_hitpoint/distance*50.0

  408.                                                                

  409.                                                                 new Float:scaled_bone_width=distance_to_hitpoint/distance*150.0

  410.                                                                

  411.                                                                 new Float:v_bone_start[3],Float:v_bone_end[3]

  412.                                                                 new Float:offset_vector[3]

  413.                                                                 // get the point 10.0 units away from wall

  414.                                                                 normalize(v_middle,offset_vector,distance_to_hitpoint-10.0) // offset from wall

  415.                                                                

  416.                                                                 // set to eye level

  417.                                                                 new Float:eye_level[3]

  418.                                                                 copyVec(my_origin,eye_level)

  419.                                                                

  420.                                                                 if (ducking[spec_id]){

  421.                                                                         eye_level[2]+=12.3

  422.                                                                         }else{

  423.                                                                         eye_level[2]+=17.5

  424.                                                                 }

  425.                                                                

  426.                                                                

  427.                                                                 addVec(offset_vector,eye_level)

  428.                                                                

  429.                                                                 // start and end of green box

  430.                                                                 copyVec(offset_vector,v_bone_start)

  431.                                                                 copyVec(offset_vector,v_bone_end)

  432.                                                                 v_bone_end[2]-=scaled_bone_len

  433.                                                                

  434.                                                                 new Float:distance_target_hitpoint=distance-distance_to_hitpoint

  435.                                                                

  436.                                                                 new actual_bright=255

  437.                                                                

  438.                                                                 if (admin_options[i][ESP_BOX]){

  439.                                                                         // this is to make green box darker if distance is larger

  440.                                                                         if (distance_target_hitpoint<2040.0){

  441.                                                                                 actual_bright=(255-floatround(distance_target_hitpoint/12.0))

  442.                                                                                

  443.                                                                                 }else{

  444.                                                                                 actual_bright=85

  445.                                                                         }      

  446.                                                                         new color

  447.                                                                         if (distance_to_hitpoint!=distance){ // if no line of sight

  448.                                                                                 color=0

  449.                                                                                 }else{ // if line of sight

  450.                                                                                 color=target_team

  451.                                                                         }

  452.                                                                        

  453.                                                                         if (damage_done_to[spec_id]==s) {

  454.                                                                                 color=3

  455.                                                                                 damage_done_to[spec_id]=0

  456.                                                                         }

  457.                                                                         make_TE_BEAMPOINTS(i,color,v_bone_start,v_bone_end,floatround(scaled_bone_width),target_team,actual_bright)

  458.                                                                 }

  459.                                                                

  460.                                                                

  461.                                                                 if (admin_options[i][ESP_AIM_VEC] || admin_options[i][ESP_NAME] || admin_options[i][ESP_HEALTH_ARMOR] || admin_options[i][ESP_WEAPON] || admin_options[i][ESP_CLIP_AMMO] || admin_options[i][ESP_DISTANCE]){

  462.                                                                        

  463.                                                                        

  464.                                                                         new Float:ret[2]

  465.                                                                         new Float:x_angle=get_screen_pos(spec_id,v_middle,ret)

  466.                                                                        

  467.                                                                         // find target with the smallest distance to crosshair (on x-axis)

  468.                                                                         if (smallest_angle>floatabs(x_angle)){

  469.                                                                                 if (floatabs(x_angle)!=0.0){

  470.                                                                                         smallest_angle=floatabs(x_angle)

  471.                                                                                         view_target[spec_id]=s

  472.                                                                                         smallest_id=s // store nearest target id..

  473.                                                                                         xp=ret[0] // and x,y coordinates of hudmessage

  474.                                                                                         yp=ret[1]

  475.                                                                                         dist=distance

  476.                                                                                 }

  477.                                                                         }

  478.                                                                 }

  479.                                                         }

  480.                                                 }

  481.                                         }

  482.                                 }

  483.                         } // inner player loop end

  484.                         if (!is_user_alive(smallest_id)) {

  485.                                 smallest_id=0

  486.                                 xp=-1.0

  487.                         }

  488.                         if (smallest_id>0 && admin_options[i][ESP_AIM_VEC]){

  489.                                 draw_aim_vector(i,smallest_id,2000)

  490.                         }

  491.                         if (xp>0.0 && xp<=1.0 && yp>0.0 && yp<=1.0){ // if in visible range

  492.                                 // show the player info

  493.                                 set_hudmessage(255, 255, 0, floatabs(xp), floatabs(yp), 0, 0.0, get_cvar_float("esp_timer"), 0.0, 0.0, 2)

  494.                                

  495.                                 new name[37]=""

  496.                                 new tmp[33]

  497.                                 get_user_name(smallest_id,tmp,32)

  498.                                 if (admin_options[i][ESP_NAME]){

  499.                                         format(name,36,"[%s]^n",tmp)

  500.                                 }

  501.                                

  502.                                

  503.                                 new health[25]=""

  504.                                 if (admin_options[i][ESP_HEALTH_ARMOR]){

  505.                                         new hp=get_user_health(smallest_id)

  506.                                         new armor=get_user_armor(smallest_id)

  507.                                         format(health,24,"health: %d armor: %d^n",hp,armor)

  508.                                 }

  509.                                

  510.                                

  511.                                 new clip_ammo[22]=""

  512.                                 new clip,ammo

  513.                                 new weapon_id=get_user_weapon(smallest_id,clip,ammo)

  514.                                 if (admin_options[i][ESP_CLIP_AMMO]){

  515.                                         format(clip_ammo,21,"clip: %d ammo: %d^n",clip,ammo)

  516.                                 }

  517.                                

  518.                                 new weapon_name[21]=""

  519.                                 if (admin_options[i][ESP_WEAPON]){

  520.                                         if ((weapon_id-1)<0 || (weapon_id-1)>29) weapon_id=1

  521.                                         format(weapon_name,20,"weapon: %s^n",weapons[weapon_id-1])

  522.                                         //copy(weapon_name,9,weapons[weapon_id-1])

  523.                                 }

  524.                                

  525.                                 new str_dist[19]

  526.                                 if (admin_options[i][ESP_DISTANCE]){

  527.                                         format(str_dist,18,"distance: %d^n",floatround(dist))

  528.                                 }

  529.                                

  530.                                 show_hudmessage(i, "%s%s%s%s%s",name,health,weapon_name,clip_ammo,str_dist)

  531.                         }

  532.                 }

  533.         }

  534.         set_task(get_cvar_float("esp_timer"),"esp_timer") // keep it going

  535.         return PLUGIN_CONTINUE 

  536. }

  537.  

  538. public Float:get_screen_pos(id,Float:v_me_to_target[3],Float:Ret[2]){

  539.         new Float:v_aim[3]

  540.         VelocityByAim(id,1,v_aim) // get aim vector

  541.         new Float:aim[3]

  542.         copyVec(v_aim,aim) // make backup copy of v_aim

  543.         v_aim[2]=0.0 // project aim vector vertically to x,y plane

  544.         new Float:v_target[3]

  545.         copyVec(v_me_to_target,v_target)

  546.         v_target[2]=0.0 // project target vector vertically to x,y plane

  547.         // both v_aim and v_target are in the x,y plane, so angle can be calculated..

  548.         new Float:x_angle

  549.         new Float:x_pos=get_screen_pos_x(v_target,v_aim,x_angle) // get the x coordinate of hudmessage..

  550.         new Float:y_pos=get_screen_pos_y(v_me_to_target,aim) // get the y coordinate of hudmessage..

  551.         Ret[0]=x_pos

  552.         Ret[1]=y_pos

  553.         return x_angle

  554. }

  555.  

  556. public Float:get_screen_pos_x(Float:target[3],Float:aim[3],&Float:xangle){

  557.         new Float:x_angle=floatacos(vectorProduct(aim,target)/(getVecLen(aim)*getVecLen(target)),1) // get angle between vectors

  558.         new Float:x_pos

  559.         //this part is a bit tricky..

  560.         //the problem is that the 'angle between vectors' formula returns always positive values

  561.         //how can be determined if the target vector is on the left or right side of the aim vector? with only positive angles?

  562.         //the solution:

  563.         //the scalar triple product returns the volume of the parallelepiped that is created by three input vectors

  564.         //

  565.         //i used the aim and target vectors as the first two input parameters

  566.         //and the third one is a vector pointing straight upwards [0,0,1]

  567.         //if now the target is on the left side of spectator origin the created parallelepipeds volume is negative

  568.         //and on the right side positive

  569.         //now we can turn x_angle into a signed value..

  570.         if (scalar_triple_product(aim,target)<0.0) x_angle*=-1 // make signed

  571.         if (x_angle>=-45.0 && x_angle<=45.0){ // if in fov of 90

  572.                 x_pos=1.0-(floattan(x_angle,degrees)+1.0)/2.0 // calulate y_pos of hudmessage

  573.                 xangle=x_angle

  574.                 return x_pos

  575.         }

  576.         xangle=0.0

  577.         return -2.0

  578. }

  579.  

  580. public Float:get_screen_pos_y(Float:v_target[3],Float:aim[3]){

  581.         new Float:target[3]

  582.        

  583.         // rotate vector about z-axis directly over the direction vector (to get height angle)

  584.         rotateVectorZ(v_target,aim,target)

  585.        

  586.         // get angle between aim vector and target vector

  587.         new Float:y_angle=floatacos(vectorProduct(aim,target)/(getVecLen(aim)*getVecLen(target)),1) // get angle between vectors

  588.        

  589.         new Float:y_pos

  590.         new Float:norm_target[3],Float:norm_aim[3]

  591.        

  592.         // get normalized target and aim vectors

  593.         normalize(v_target,norm_target,1.0)

  594.         normalize(aim,norm_aim,1.0)

  595.        

  596.         //since the 'angle between vectors' formula returns always positive values

  597.         if (norm_target[2]<norm_aim[2]) y_angle*=-1 //make signed

  598.        

  599.         if (y_angle>=-45.0 && y_angle<=45.0){ // if in fov of 90

  600.                 y_pos=1.0-(floattan(y_angle,degrees)+1.0)/2.0 // calulate y_pos of hudmessage

  601.                 if (y_pos>=0.0 && y_pos<=1.0) return y_pos

  602.         }

  603.         return -2.0

  604. }

  605.  

  606. public get_team(id){

  607.         new team[2]

  608.         get_user_team(id,team,1)

  609.         switch(team[0]){

  610.                 case 'T':{

  611.                         return 1

  612.                 }

  613.                 case 'C':{

  614.                         return 2

  615.                 }

  616.                 case 'S':{

  617.                         return 3

  618.                 }

  619.                 default:{}

  620.         }

  621.         return 0

  622. }

  623.  

  624. // Vector Operations -------------------------------------------------------------------------------

  625.  

  626. public Float:getVecLen(Float:Vec[3]){

  627.         new Float:VecNull[3]={0.0,0.0,0.0}

  628.         new Float:len=vector_distance(Vec,VecNull)

  629.         return len

  630. }

  631.  

  632. public Float:scalar_triple_product(Float:a[3],Float:b[3]){

  633.         new Float:up[3]={0.0,0.0,1.0}

  634.         new Float:Ret[3]

  635.         Ret[0]=a[1]*b[2]-a[2]*b[1]

  636.         Ret[1]=a[2]*b[0]-a[0]*b[2]

  637.         Ret[2]=a[0]*b[1]-a[1]*b[0]

  638.         return vectorProduct(Ret,up)

  639. }

  640.  

  641. public normalize(Float:Vec[3],Float:Ret[3],Float:multiplier){

  642.         new Float:len=getVecLen(Vec)

  643.         copyVec(Vec,Ret)

  644.         Ret[0]/=len

  645.         Ret[1]/=len

  646.         Ret[2]/=len

  647.         Ret[0]*=multiplier

  648.         Ret[1]*=multiplier

  649.         Ret[2]*=multiplier

  650. }

  651.  

  652. public rotateVectorZ(Float:Vec[3],Float:direction[3],Float:Ret[3]){

  653.         // rotates vector about z-axis

  654.         new Float:tmp[3]

  655.         copyVec(Vec,tmp)

  656.         tmp[2]=0.0

  657.         new Float:dest_len=getVecLen(tmp)

  658.         copyVec(direction,tmp)

  659.         tmp[2]=0.0

  660.         new Float:tmp2[3]

  661.         normalize(tmp,tmp2,dest_len)

  662.         tmp2[2]=Vec[2]

  663.         copyVec(tmp2,Ret)

  664. }

  665.  

  666. public Float:vectorProduct(Float:Vec1[3],Float:Vec2[3]){

  667.         return Vec1[0]*Vec2[0]+Vec1[1]*Vec2[1]+Vec1[2]*Vec2[2]

  668. }

  669.  

  670. public copyVec(Float:Vec[3],Float:Ret[3]){

  671.         Ret[0]=Vec[0]

  672.         Ret[1]=Vec[1]

  673.         Ret[2]=Vec[2]

  674. }

  675.  

  676. public subVec(Float:Vec1[3],Float:Vec2[3],Float:Ret[3]){

  677.         Ret[0]=Vec1[0]-Vec2[0]

  678.         Ret[1]=Vec1[1]-Vec2[1]

  679.         Ret[2]=Vec1[2]-Vec2[2]

  680. }

  681.  

  682. public addVec(Float:Vec1[3],Float:Vec2[3]){

  683.         Vec1[0]+=Vec2[0]

  684.         Vec1[1]+=Vec2[1]

  685.         Vec1[2]+=Vec2[2]

  686. }

  687.  

  688. // Temporary Entities ------------------------------------------------------------------------------

  689. // there is a list of much more temp entities at: http://djeyl.net/forum/index.php?s=80ec ... &id=290870

  690. // all messages are sent with MSG_ONE_UNRELIABLE flag to avoid overflow in case of very low esp_timer setting and much targets

  691.  

  692. public make_TE_BEAMPOINTS(id,color,Float:Vec1[3],Float:Vec2[3],width,target_team,brightness){

  693.         message_begin(MSG_ONE_UNRELIABLE ,SVC_TEMPENTITY,{0,0,0},id) //message begin

  694.         write_byte(0)

  695.         write_coord(floatround(Vec1[0])) // start position

  696.         write_coord(floatround(Vec1[1]))

  697.         write_coord(floatround(Vec1[2]))

  698.         write_coord(floatround(Vec2[0])) // end position

  699.         write_coord(floatround(Vec2[1]))

  700.         write_coord(floatround(Vec2[2]))

  701.         write_short(laser) // sprite index

  702.         write_byte(3) // starting frame

  703.         write_byte(0) // frame rate in 0.1's

  704.         write_byte(floatround(get_cvar_float("esp_timer")*10)) // life in 0.1's

  705.         write_byte(width) // line width in 0.1's

  706.         write_byte(0) // noise amplitude in 0.01's

  707.         write_byte(esp_colors[color][0])

  708.         write_byte(esp_colors[color][1])

  709.         write_byte(esp_colors[color][2])

  710.         write_byte(brightness) // brightness)

  711.         write_byte(0) // scroll speed in 0.1's

  712.         message_end()

  713. }

  714.  

  715. public make_TE_BEAMENTPOINT(id,Float:target_origin[3],width,target_team){

  716.         message_begin(MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,{0,0,0},id)

  717.         write_byte(1)

  718.         write_short(id)

  719.         write_coord(floatround(target_origin[0]))

  720.         write_coord(floatround(target_origin[1]))

  721.         write_coord(floatround(target_origin[2]))

  722.         write_short(laser)

  723.         write_byte(1)          

  724.         write_byte(1)

  725.         write_byte(floatround(get_cvar_float("esp_timer")*10))

  726.         write_byte(width)

  727.         write_byte(0)

  728.         write_byte(team_colors[target_team][0])

  729.         write_byte(team_colors[target_team][1])

  730.         write_byte(team_colors[target_team][2])

  731.         write_byte(255)

  732.         write_byte(0)

  733.         message_end()

  734. }

  735.  


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése: Rendezés 
Új téma nyitása Hozzászólás a témához  [11 hozzászólás ]  Oldal12Következő


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 10 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole