hlmod.hu
https://hlmod.hu/

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

Szerző:  Tokione [2013.08.18. 20:06 ]
Hozzászólás témája:  Modell

Az lenne kérdésem hogy kell modelt be és ki rakni (admin modellt!)
Aki segít megy a GOMB!

Szerző:  Vinnice [2013.08.18. 20:16 ]
Hozzászólás témája:  Re: Modell

Így van.
Ha a játékos nem admin akkor nem állítja be a modelljét.
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4.  
  5. new const PLUGIN[] = "Admin Model";
  6. new const VERSION[] = "1.0";
  7. new const AUTHOR[] = "author";
  8.  
  9. new const modellct[] ="CT_Modell_neve"
  10. new const modellte[] ="TE_Modell_neve"
  11.  
  12. new formatted[191],formattedd[191]
  13.  
  14. public plugin_init()
  15. {
  16. register_plugin(PLUGIN, VERSION, AUTHOR);
  17. register_event("ResetHUD", "resetModel", "b");
  18. return PLUGIN_CONTINUE;
  19. }
  20.  
  21. public plugin_precache()
  22. {
  23. new formatted[191],formattedd[191]
  24. format(formatted,190,"models/player/%s/%s.mdl",modellct)
  25. format(formattedd, 190, "models/player/%s/%s.mdl",modellte)
  26.  
  27. precache_model(formatted);
  28. precache_model(formattedd);
  29. return PLUGIN_CONTINUE;
  30. }
  31.  
  32. public resetModel(id, level, cid)
  33. {
  34. new CsTeams:userTeam = cs_get_user_team(id);
  35.  
  36. if (is_user_admin(id)) //ha admin
  37. {
  38. if (userTeam == CS_TEAM_T)
  39. {
  40. cs_set_user_model(id, formattedd); //beallítjuk a Te admin modelljét
  41. }
  42. else if(userTeam == CS_TEAM_CT)
  43. {
  44. cs_set_user_model(id, formatted); //beallítjuk a CT admin modelljét
  45. }
  46. else
  47. {
  48. cs_reset_user_model(id);
  49. }
  50. }
  51. return PLUGIN_CONTINUE;
  52. }

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