hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.24. 12:36



Jelenlévő felhasználók

Jelenleg 312 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 311 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: 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  [ 9 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Sebességmérő.
HozzászólásElküldve: 2014.07.23. 17:55 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.07.22. 17:59
Hozzászólások: 667
Megköszönt másnak: 49 alkalommal
Megköszönték neki: 36 alkalommal
Üdv.Valaki megcsinálná eszt a sebességmérőt,hogy pl ha 500-al mész akkor igy írja:
500 Sebességed
^.[R]eloa|D:.


Alá csak anyi legyen, hogy ^.[R]eloa|D:.
Itt a sebességmérő
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2.  
  3. #include <fakemeta>
  4.  
  5.  
  6.  
  7. #define PLUGIN "Speedometer"
  8.  
  9. #define VERSION "1.2"
  10.  
  11. #define AUTHOR "AciD"
  12.  
  13.  
  14.  
  15. #define FREQ 0.1
  16.  
  17.  
  18.  
  19. new bool:plrSpeed[33]
  20.  
  21.  
  22.  
  23. new TaskEnt,SyncHud,showspeed, maxplayers
  24.  
  25.  
  26.  
  27. public plugin_init() {
  28.  
  29. register_plugin(PLUGIN, VERSION, AUTHOR)
  30.  
  31. register_cvar("AcidoX", "Speedometer 1.1", FCVAR_SERVER)
  32.  
  33. register_forward(FM_Think, "Think")
  34.  
  35.  
  36.  
  37. TaskEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  38.  
  39. set_pev(TaskEnt, pev_classname, "speedometer_think")
  40.  
  41. set_pev(TaskEnt, pev_nextthink, get_gametime() + 1.01)
  42.  
  43.  
  44.  
  45. register_clcmd("say /speed", "toogleSpeed")
  46.  
  47.  
  48.  
  49. showspeed = register_cvar("showspeed", "1")
  50.  
  51.  
  52.  
  53. SyncHud = CreateHudSyncObj()
  54.  
  55.  
  56.  
  57. maxplayers = get_maxplayers()
  58.  
  59. }
  60.  
  61.  
  62.  
  63. public Think(ent)
  64.  
  65. {
  66.  
  67. if(ent == TaskEnt)
  68.  
  69. {
  70.  
  71. SpeedTask()
  72.  
  73. set_pev(ent, pev_nextthink, get_gametime() + FREQ)
  74.  
  75. }
  76.  
  77. }
  78.  
  79.  
  80.  
  81. public client_putinserver(id)
  82.  
  83. {
  84.  
  85. plrSpeed[id] = showspeed > 0 ? true : false
  86.  
  87. }
  88.  
  89.  
  90.  
  91. public toogleSpeed(id)
  92.  
  93. {
  94.  
  95. plrSpeed[id] = plrSpeed[id] ? false : true
  96.  
  97. return PLUGIN_HANDLED
  98.  
  99. }
  100.  
  101.  
  102.  
  103. SpeedTask()
  104.  
  105. {
  106.  
  107. static i, target
  108.  
  109. static Float:velocity[3]
  110.  
  111. static Float:speed, Float:speedh
  112.  
  113.  
  114.  
  115. for(i=1; i<=maxplayers; i++)
  116.  
  117. {
  118.  
  119. if(!is_user_connected(i)) continue
  120.  
  121. if(!plrSpeed[i]) continue
  122.  
  123.  
  124.  
  125. target = pev(i, pev_iuser1) == 4 ? pev(i, pev_iuser2) : i
  126.  
  127. pev(target, pev_velocity, velocity)
  128.  
  129.  
  130.  
  131. speed = vector_length(velocity)
  132.  
  133. speedh = floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0))
  134.  
  135.  
  136.  
  137. set_hudmessage(random(256), random(256), random(256), -1.0, 0.7, 0, 0.0, FREQ, 0.01, 0.0)
  138.  
  139. ShowSyncHudMsg(i, SyncHud, "%3.2f Masodperc^n%3.2f Sebesseg", speed, speedh)
  140.  
  141. }
  142.  
  143. }
  144.  
  145. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  146.  
  147.   *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  148.  
  149.   */

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebességmérő.
HozzászólásElküldve: 2014.07.23. 19:00 
Offline
Félisten
Avatar

Csatlakozott: 2013.12.30. 12:26
Hozzászólások: 987
Megköszönt másnak: 34 alkalommal
Megköszönték neki: 133 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2.  
  3. #include <fakemeta>
  4.  
  5.  
  6.  
  7. #define PLUGIN "Speedometer"
  8.  
  9. #define VERSION "1.2"
  10.  
  11. #define AUTHOR "AciD"
  12.  
  13.  
  14.  
  15. #define FREQ 0.1
  16.  
  17.  
  18.  
  19. new bool:plrSpeed[33]
  20.  
  21.  
  22.  
  23. new TaskEnt,SyncHud,showspeed, maxplayers
  24.  
  25.  
  26.  
  27. public plugin_init() {
  28.  
  29. register_plugin(PLUGIN, VERSION, AUTHOR)
  30.  
  31. register_cvar("AcidoX", "Speedometer 1.1", FCVAR_SERVER)
  32.  
  33. register_forward(FM_Think, "Think")
  34.  
  35.  
  36.  
  37. TaskEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  38.  
  39. set_pev(TaskEnt, pev_classname, "speedometer_think")
  40.  
  41. set_pev(TaskEnt, pev_nextthink, get_gametime() + 1.01)
  42.  
  43.  
  44.  
  45. register_clcmd("say /speed", "toogleSpeed")
  46.  
  47.  
  48.  
  49. showspeed = register_cvar("showspeed", "1")
  50.  
  51.  
  52.  
  53. SyncHud = CreateHudSyncObj()
  54.  
  55.  
  56.  
  57. maxplayers = get_maxplayers()
  58.  
  59. }
  60.  
  61.  
  62.  
  63. public Think(ent)
  64.  
  65. {
  66.  
  67. if(ent == TaskEnt)
  68.  
  69. {
  70.  
  71. SpeedTask()
  72.  
  73. set_pev(ent, pev_nextthink, get_gametime() + FREQ)
  74.  
  75. }
  76.  
  77. }
  78.  
  79.  
  80.  
  81. public client_putinserver(id)
  82.  
  83. {
  84.  
  85. plrSpeed[id] = showspeed > 0 ? true : false
  86.  
  87. }
  88.  
  89.  
  90.  
  91. public toogleSpeed(id)
  92.  
  93. {
  94.  
  95. plrSpeed[id] = plrSpeed[id] ? false : true
  96.  
  97. return PLUGIN_HANDLED
  98.  
  99. }
  100.  
  101.  
  102.  
  103. SpeedTask()
  104.  
  105. {
  106.  
  107. static i, target
  108.  
  109. static Float:velocity[3]
  110.  
  111. static Float:speed, Float:speedh
  112.  
  113.  
  114.  
  115. for(i=1; i<=maxplayers; i++)
  116.  
  117. {
  118.  
  119. if(!is_user_connected(i)) continue
  120.  
  121. if(!plrSpeed[i]) continue
  122.  
  123.  
  124.  
  125. target = pev(i, pev_iuser1) == 4 ? pev(i, pev_iuser2) : i
  126.  
  127. pev(target, pev_velocity, velocity)
  128.  
  129.  
  130.  
  131. speed = vector_length(velocity)
  132.  
  133. speedh = floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0))
  134.  
  135.  
  136.  
  137. set_hudmessage(random(256), random(256), random(256), -1.0, 0.7, 0, 0.0, FREQ, 0.01, 0.0)
  138.  
  139. ShowSyncHudMsg(i, SyncHud, "%3.2f Sebesseged^n^.[R]eloa|D:.", speedh)
  140.  
  141. }
  142.  
  143. }
  144.  
  145. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  146.  
  147.   *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  148.  
  149.   */

_________________
Kép
Pár pluginom:
LCAW Frag Bolt
S E C R E T (78%...)
KépKép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebességmérő.
HozzászólásElküldve: 2014.07.23. 19:48 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.07.22. 17:59
Hozzászólások: 667
Megköszönt másnak: 49 alkalommal
Megköszönték neki: 36 alkalommal
Ez valamiért nem jó, nem engedi amxx-re alakitani errort ír.

Ezeket az errorokat írja:
sebessegmero.sma(137 -- 139) : error 027: invalid character constant
sebessegmero.sma(139) : error 027: invalid character constant
sebessegmero.sma(143) : warning 204: symbol is assigned a value that is never used: "speed"

2 Errors.
Could not locate output file sebessegmero.amx (compile failed).

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebességmérő.
HozzászólásElküldve: 2014.07.23. 20:22 
Offline
Nagyúr
Avatar

Csatlakozott: 2013.09.04. 15:21
Hozzászólások: 635
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 141 alkalommal
"^" ezt nem engedi
De amúgy itt van 1 egyszerübb :)
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fakemeta>
  3.  
  4. #define PLUGIN "Egyszeru sebessegmero"
  5. #define VERSION "1.0"
  6. #define AUTHOR "DeRoiD"
  7.  
  8. public plugin_init() {
  9. register_plugin(PLUGIN, VERSION, AUTHOR)
  10. set_task(0.1, "kijelzo", 0, _, _, "b")
  11. }
  12.  
  13. public kijelzo(){
  14. static celpont
  15. static Float:velocity[3]
  16. static Float:sebesseg
  17.  
  18. new players[32], szam
  19. get_players(players, szam, "c")
  20. for(new i; i<szam; i++){
  21. i = players[i]
  22. celpont = pev(i, pev_iuser1) == 4 ? pev(i, pev_iuser2) : i
  23. pev(celpont, pev_velocity, velocity)
  24. sebesseg = vector_length(velocity)
  25. set_hudmessage(random(256), random(256), random(256), -1.0, 0.70, 0, 6.0, 12.0)
  26. show_hudmessage(i, "Sebesseg : %3.2f^n.[R]eloa|D:.",sebesseg)
  27. }
  28. }

_________________
My Steam:
KépKép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebességmérő.
HozzászólásElküldve: 2014.07.23. 20:25 
Offline
Beavatott
Avatar

Csatlakozott: 2013.08.31. 14:27
Hozzászólások: 67
Megköszönt másnak: 11 alkalommal
Megköszönték neki: 6 alkalommal
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fakemeta>
  3.  
  4. #define PLUGIN "Speedometer"
  5. #define VERSION "1.2"
  6. #define AUTHOR "AciD"
  7.  
  8. #define FREQ 0.1
  9.  
  10. new bool:plrSpeed[33]
  11.  
  12. new TaskEnt,SyncHud,showspeed,color, maxplayers, r, g, b
  13.  
  14. public plugin_init() {
  15. register_plugin(PLUGIN, VERSION, AUTHOR)
  16. register_cvar("AcidoX", "Speedometer 1.1", FCVAR_SERVER)
  17. register_forward(FM_Think, "Think")
  18.  
  19. TaskEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  20. set_pev(TaskEnt, pev_classname, "speedometer_think")
  21. set_pev(TaskEnt, pev_nextthink, get_gametime() + 1.01)
  22.  
  23. register_clcmd("say /speed", "toogleSpeed")
  24.  
  25. showspeed = register_cvar("showspeed", "1")
  26. color = register_cvar("speed_colors", "255 255 255")
  27.  
  28. SyncHud = CreateHudSyncObj()
  29.  
  30. maxplayers = get_maxplayers()
  31.  
  32. new colors[16], red[4], green[4], blue[4]
  33. get_pcvar_string(color, colors, sizeof colors - 1)
  34. parse(colors, red, 3, green, 3, blue, 3)
  35. r = str_to_num(red)
  36. g = str_to_num(green)
  37. b = str_to_num(blue)
  38. }
  39.  
  40. public Think(ent)
  41. {
  42. if(ent == TaskEnt)
  43. {
  44. SpeedTask()
  45. set_pev(ent, pev_nextthink, get_gametime() + FREQ)
  46. }
  47. }
  48.  
  49. public client_putinserver(id)
  50. {
  51. plrSpeed[id] = showspeed > 0 ? true : false
  52. }
  53.  
  54. public toogleSpeed(id)
  55. {
  56. plrSpeed[id] = plrSpeed[id] ? false : true
  57. return PLUGIN_HANDLED
  58. }
  59.  
  60. SpeedTask()
  61. {
  62. static i, target
  63. static Float:velocity[3]
  64. static Float:speed, Float:speedh
  65.  
  66. for(i=1; i<=maxplayers; i++)
  67. {
  68. if(!is_user_connected(i)) continue
  69. if(!plrSpeed[i]) continue
  70.  
  71. target = pev(i, pev_iuser1) == 4 ? pev(i, pev_iuser2) : i
  72. pev(target, pev_velocity, velocity)
  73.  
  74. speed = vector_length(velocity)
  75. speedh = floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0))
  76.  
  77. set_hudmessage(r, g, b, -1.0, 0.7, 0, 0.0, FREQ, 0.01, 0.0)
  78. ShowSyncHudMsg(i, SyncHud, "%3.2f Sebesseged^n^.[R]eloa|D:.", speed, speedh)
  79. }
  80. }

_________________
______________________________________________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebességmérő.
HozzászólásElküldve: 2014.07.23. 20:52 
Offline
Nagyúr
Avatar

Csatlakozott: 2013.09.04. 15:21
Hozzászólások: 635
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 141 alkalommal
Axion írta:
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fakemeta>
  3.  
  4. #define PLUGIN "Speedometer"
  5. #define VERSION "1.2"
  6. #define AUTHOR "AciD"
  7.  
  8. #define FREQ 0.1
  9.  
  10. new bool:plrSpeed[33]
  11.  
  12. new TaskEnt,SyncHud,showspeed,color, maxplayers, r, g, b
  13.  
  14. public plugin_init() {
  15. register_plugin(PLUGIN, VERSION, AUTHOR)
  16. register_cvar("AcidoX", "Speedometer 1.1", FCVAR_SERVER)
  17. register_forward(FM_Think, "Think")
  18.  
  19. TaskEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  20. set_pev(TaskEnt, pev_classname, "speedometer_think")
  21. set_pev(TaskEnt, pev_nextthink, get_gametime() + 1.01)
  22.  
  23. register_clcmd("say /speed", "toogleSpeed")
  24.  
  25. showspeed = register_cvar("showspeed", "1")
  26. color = register_cvar("speed_colors", "255 255 255")
  27.  
  28. SyncHud = CreateHudSyncObj()
  29.  
  30. maxplayers = get_maxplayers()
  31.  
  32. new colors[16], red[4], green[4], blue[4]
  33. get_pcvar_string(color, colors, sizeof colors - 1)
  34. parse(colors, red, 3, green, 3, blue, 3)
  35. r = str_to_num(red)
  36. g = str_to_num(green)
  37. b = str_to_num(blue)
  38. }
  39.  
  40. public Think(ent)
  41. {
  42. if(ent == TaskEnt)
  43. {
  44. SpeedTask()
  45. set_pev(ent, pev_nextthink, get_gametime() + FREQ)
  46. }
  47. }
  48.  
  49. public client_putinserver(id)
  50. {
  51. plrSpeed[id] = showspeed > 0 ? true : false
  52. }
  53.  
  54. public toogleSpeed(id)
  55. {
  56. plrSpeed[id] = plrSpeed[id] ? false : true
  57. return PLUGIN_HANDLED
  58. }
  59.  
  60. SpeedTask()
  61. {
  62. static i, target
  63. static Float:velocity[3]
  64. static Float:speed, Float:speedh
  65.  
  66. for(i=1; i<=maxplayers; i++)
  67. {
  68. if(!is_user_connected(i)) continue
  69. if(!plrSpeed[i]) continue
  70.  
  71. target = pev(i, pev_iuser1) == 4 ? pev(i, pev_iuser2) : i
  72. pev(target, pev_velocity, velocity)
  73.  
  74. speed = vector_length(velocity)
  75. speedh = floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0))
  76.  
  77. set_hudmessage(r, g, b, -1.0, 0.7, 0, 0.0, FREQ, 0.01, 0.0)
  78. ShowSyncHudMsg(i, SyncHud, "%3.2f Sebesseged^n^.[R]eloa|D:.", speed, speedh)
  79. }
  80. }

Most minek rakod ki ezt??
Ez se jó

_________________
My Steam:
KépKép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebességmérő.
HozzászólásElküldve: 2014.07.23. 22:35 
Offline
Beavatott
Avatar

Csatlakozott: 2013.08.31. 14:27
Hozzászólások: 67
Megköszönt másnak: 11 alkalommal
Megköszönték neki: 6 alkalommal
bocs nem néztem h raktál

_________________
______________________________________________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebességmérő.
HozzászólásElküldve: 2014.07.23. 22:39 
Offline
Nagyúr
Avatar

Csatlakozott: 2013.09.04. 15:21
Hozzászólások: 635
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 141 alkalommal
Axion írta:
bocs nem néztem h raktál

Nem baj :)
Csak az nem jó amit küldtél mert át se fordítja :D

_________________
My Steam:
KépKép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Sebességmérő.
HozzászólásElküldve: 2014.07.24. 10:24 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.07.22. 17:59
Hozzászólások: 667
Megköszönt másnak: 49 alkalommal
Megköszönték neki: 36 alkalommal
Az amit én raktam azért jobb, mert vibrál.

_________________
Kép


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  [ 9 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 47 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