hlmod.hu
https://hlmod.hu/

Random játékos
https://hlmod.hu/viewtopic.php?f=9&t=7244
Oldal: 1 / 1

Szerző:  Cyber [2013.01.23. 15:03 ]
Hozzászólás témája:  Random játékos

Hello!

Segítséget szeretnék kérni abban hogy, hogyan tudnék lefuttatni egy random választást játékosok között, de mondjuk csak a CT -k közül válasszon.

Előre is köszönöm :)

Szerző:  small [2013.01.23. 16:12 ]
Hozzászólás témája:  Re: Random játékos

http://hlmod.hu/viewtopic.php?f=14&t=3519

Szerző:  IrOn [2013.01.23. 16:37 ]
Hozzászólás témája:  Re: Random játékos

ha nem érted a működését írj
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PLUGIN "New Plug-In"
  5. #define VERSION "1.0"
  6. #define AUTHOR "IrOn"
  7.  
  8.  
  9. new randomjatekosidje;
  10.  
  11. public plugin_init() {
  12. register_plugin(PLUGIN, VERSION, AUTHOR)
  13.  
  14. randomjatekosidje = randomplayer(0) // 0=összes csapat, 1=terror, 2=ct
  15. client_print(0,print_chat,"A kivalasztott ID: %d", randomjatekosidje)
  16. }
  17.  
  18. randomplayer(csapat)
  19. {
  20. new players[32], pnum, randomp,team
  21. get_players(players, pnum)
  22. randomp = players[random(pnum)]
  23. team = get_user_team(randomp)
  24. if(csapat == 1)
  25. {
  26. while(team != 1)
  27. {
  28. randomp = players[random(pnum)]
  29. team = get_user_team(randomp)
  30. }
  31. }
  32. else if(csapat == 2)
  33. {
  34. while(team != 2)
  35. {
  36. randomp = players[random(pnum)]
  37. team = get_user_team(randomp)
  38. }
  39. }
  40. return randomp;
  41. }

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