hlmod.hu
https://hlmod.hu/

Hud
https://hlmod.hu/viewtopic.php?f=9&t=3855
Oldal: 1 / 1

Szerző:  fuck604 [2012.03.25. 17:00 ]
Hozzászólás témája:  Hud

Kód:
set_hudmessage(get_pcvar_num(pcvar_color[red]), get_pcvar_num(pcvar_color[green]), get_pcvar_num(pcvar_color[blue]), -1.0, 0.01, get_pcvar_num(pcvar_effect), 1.0, 1.5, 0.0, 0.0, 1)
ShowSyncHudMsg(0, nMSGS, "> T: %d | CT: %d <^n > %s <^n%d/%d^n", nT, nCT, iTime, "get_players(33),get_maxplayers(32)", nR)
 

Ezt a részt:
Kód:
^n%d/%d^n   //(, "get_players(33),get_maxplayers(32)")
//így mutatja
103/0
//ez miért van?  

Szerző:  kiki [2012.03.25. 17:37 ]
Hozzászólás témája:  Re: Hud

de miez? get_players(33), meg get_maxplayers(32) , ilyen nem létezik!

Szerző:  fuck604 [2012.03.25. 18:05 ]
Hozzászólás témája:  Re: Hud

Kód:
#include <amxmodx>

public plugin_init(){
  
register_plugin("asd","1","asd")
}

public 
sayPlayers(){
   
set_hudmessage(422552550.340.006.01)
   
show_hudmessage(0"Slot : %d/%d","get_players(),get_maxplayers()")
   
   return 
PLUGIN_HANDLED

Innen szedtem a 32,33 csak a próbálkozás miatt volt.

Szerző:  VirTuaL ~` [2012.03.25. 18:05 ]
Hozzászólás témája:  Re: Hud

De ebben nincs ott a 33,32 :)

Szerző:  Silent [2012.03.25. 20:03 ]
Hozzászólás témája:  Re: Hud

Tess:
Kód:

#include <amxmodx>

#define MAX_PL 32 //ird amenyire akarod
new bool:update;


public plugin_init (){
register_plugin ( "OnlinePlayers" , "1.0" , "Silent" );
}
public client_PreThink(id){
if(
update)
{
new p[32], n;
get_players(p, n);
set_hudmessage ( 42 , 255 , 255 , 0.34 , 0.0 , 0 , 6.0 , 1 );
show_hudmessage (id , "Slot :%d/MAX_PL", n);
update false;
}
else
{
set_hudmessage ( 42 , 255 , 255 , 0.34 , 0.0 , 0 , 6.0 , 1 );
show_hudmessage(id, "Slot: %d/MAX_PL", n);
}
}
public client_connect(id)
    
update = true;
public 
client_disconnect(id)
    
update true;


Szerző:  fuck604 [2012.03.25. 21:13 ]
Hozzászólás témája:  Re: Hud

fuck604 írta:
Innen szedtem a 32,33 csak a próbálkozás miatt volt.

Ezt olvastad virtual?

Ebbe mi a hiba?

[code=c++]
  1. #include <amxmodx>

  2. #include <amxmisc>

  3. #define MAX_PL 32 //ird amenyire akarod

  4.  

  5. new pcvar_effect

  6. enum rgb {

  7.     red,

  8.     green,

  9.     blue

  10. new nMSGS, nCT, nT, nR

  11. new bool:update;

  12.  

  13. public plugin_init() 

  14. {

  15.    //niceteamscore

  16.    register_plugin("Huds""1.0""pe7rik")

  17.    register_event("SendAudio""nice_team_score_ct""a""2&%!MRAD_ctwin") 

  18.    register_event("SendAudio""nice_team_score_t""a""2&%!MRAD_terwin")

  19.    register_logevent("nice_team_score_round"2"1=Round_End")

  20.    register_logevent("nice_team_score_reset"2"1&Restart_Round_""1=Game_Commencing")

  21.    nMSGS = CreateHudSyncObj()

  22.    set_task(3.0"client_PreThink", _, _, _, "b")

  23.    

  24.    

  25.    g_hudmsg2 = CreateHudSyncObj()

  26. }

  27. public client_PreThink(id){

  28. new iTime[9]

  29. get_time("%H:%M:%S",iTime,8)

  30. if(update)

  31. {

  32. new p[32], n;

  33. get_players(p, n);

  34. set_hudmessage(get_pcvar_num(pcvar_color[red]), get_pcvar_num(pcvar_color[green]), get_pcvar_num(pcvar_color[blue])-1.00.01, get_pcvar_num(pcvar_effect)1.01.50.00.01)

  35. ShowSyncHudMsg (id, nMSGS, "> T: %d | CT: %d <^n > %s <^n%d/MAX_PL^n", nT, nCT, iTime, n, nR);

  36. update = false;

  37. }

  38. else

  39. {

  40. set_hudmessage(get_pcvar_num(pcvar_color[red]), get_pcvar_num(pcvar_color[green]), get_pcvar_num(pcvar_color[blue])-1.00.01, get_pcvar_num(pcvar_effect)1.01.50.00.01)

  41. ShowSyncHudMsg (id, nMSGS, "> T: %d | CT: %d <^n > %s <^n%d/MAX_PL^n", nT, nCT, iTime, n, nR);

  42. }

  43. }

  44. public client_connect(id)

  45.     update = true;

  46. public client_disconnect(id)

  47.     update = true;

  48.  

  49.  

  50. public nice_team_score_ct()

  51. {

  52.    nCT++

  53. }

  54.  

  55. public nice_team_score_t()

  56. {

  57.    nT++

  58. }

  59.  

  60. public nice_team_score_round()

  61. {

  62.    nR++

  63. }

  64.  

  65. public nice_team_score_reset()

  66. {

  67.    nCT = 0

  68.    

  69.    nT = 0

  70.    

  71.    nR = 0

  72. }

  73.  
[/code]


Hiba:
Kód:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

files/6482861/6482861.sma(10) : error 001: expected token: "}", but found "new"
files/6482861/6482861.sma(25) : error 017: undefined symbol "g_hudmsg2"
files/6482861/6482861.sma(34) : error 017: undefined symbol "pcvar_color"
files/6482861/6482861.sma(34) : warning 215: expression has no effect
files/6482861/6482861.sma(34) : error 001: expected token: ";", but found "]"
files/6482861/6482861.sma(34) : error 029: invalid expression, assumed zero
files/6482861/6482861.sma(34) : fatal error 107: too many error messages on one line

Compilation aborted.
6 Errors.

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