hlmod.hu
https://hlmod.hu/

Csapattárs élet HUD
https://hlmod.hu/viewtopic.php?f=10&t=13950
Oldal: 1 / 1

Szerző:  Bruti [ 2014.01.23. 18:17 ]
Hozzászólás témája:  Csapattárs élet HUD

Sziasztok!
Alapul véve egy plugint (show_teammates_money.amxx) elkezdtem gondolkozni, miért ne lehet életet mutatni vele.
Szóval elkezdtem átírni, de elakadtam..
amx logból ezt szedtem ki:
L 01/23/2014 - 18:04:44: [CSTRIKE] Player out of range (0)
L 01/23/2014 - 18:04:44: [AMXX] Displaying debug trace (plugin "csapattars_elet.amxx")
L 01/23/2014 - 18:04:44: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 01/23/2014 - 18:04:44: [AMXX] [0] show_teammates_health.sma::show_health (line 42)


!!! L 01/23/2014 - 18:04:44: [AMXX] [0] show_teammates_health.sma::show_health (line 42) NEM 42, hanem 39!


Itt pedig a forrás..
SMA Forráskód: [ Mindet kijelol ]
  1.  
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <cstrike>
  5.  
  6. #define NAME "Csapattársak élete"
  7. #define VERSION "1.0"
  8. #define AUTHOR "nobe"
  9.  
  10. new g_max_players, g_sync_creat_list
  11.  
  12. new bool:g_teammate[33]
  13.  
  14. public plugin_init()
  15. {
  16. register_plugin(NAME, VERSION, AUTHOR)
  17.  
  18. g_max_players = get_maxplayers()
  19. g_sync_creat_list = CreateHudSyncObj()
  20. set_task(1.0, "show_health", 0, "", 0, "b")
  21. }
  22.  
  23. public show_health(client)
  24. {
  25. static message[1024];
  26. static name[32];
  27.  
  28. new health, id, len;
  29. new red = 50, blue = 50
  30.  
  31. if (cs_get_user_team(client) == CS_TEAM_T)
  32. red = 255
  33. else if(cs_get_user_team(client) == CS_TEAM_CT)
  34. blue = 255
  35.  
  36. len = format(message, charsmax(message), "Csapattársak élete:^n");
  37. for (id = 1; id <= g_max_players; id++)
  38. {
  39. if (id != client && is_user_connected(id) && cs_get_user_team(id) == cs_get_user_team(client))
  40. {
  41. health = get_user_health(id);
  42. get_user_name(id, name, 31);
  43. len += format(message[len], charsmax(message) - len, "%-22.22s: %d^n", name, health);
  44. }
  45. }
  46. set_hudmessage(red, 50, blue, 0.05, 0.35, 0, 0.02, 5.0, 0.1, 0.2, 2);
  47. ShowSyncHudMsg(client, g_sync_creat_list, message);
  48. }
  49.  
  50. public set_team(id)
  51. g_teammate[id] = bool:(read_data(2) == 1);
  52.  
  53.  
  54. public client_disconnect(client)
  55. {
  56. remove_task(client)
  57. }
  58.  

Szerző:  Nexd [ 2014.01.23. 19:13 ]
Hozzászólás témája:  Re: Csapattárs élet HUD

a 42. sorhoz írja a hibát de, amit ír hibának nincsis ott.
Debug nélkül indítsd.

Szerző:  White#Angel [ 2014.01.23. 20:11 ]
Hozzászólás témája:  Re: Csapattárs élet HUD

Nekem lefordította(Pawn Studio, AMXX Studio). Nem tudom mi lehet a gondxd

Szerző:  Bruti [ 2014.01.25. 14:22 ]
Hozzászólás témája:  Re: Csapattárs élet HUD

Rossz logot másoltam kI! :s
39. soron van a hiba!

Szerző:  kiki [ 2014.01.27. 20:14 ]
Hozzászólás témája:  Re: Csapattárs élet HUD

public show_health(client)

ennek nincs paramétere, szal ne is írd oda.

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/