hlmod.hu
https://hlmod.hu/

Admin model
https://hlmod.hu/viewtopic.php?f=29&t=10308
Oldal: 1 / 1

Szerző:  misu88 [2013.08.19. 15:02 ]
Hozzászólás témája:  Admin model

Hello, egy olyan plugint szeretnék, hogy jogra van admin model.
A modelt csak akkor adja be ha ct-ben áll.
Legyen egy model: ADMIN_LEVEL_H-ra.
A masik: ADMIN_LEVEL_B-re legyen.

Midengy mit irsz mapanak, majd en atirom. Csak fontos hogy Ct-ben mukodjon csak. Kösz

Szerző:  Maxi [2013.08.19. 15:51 ]
Hozzászólás témája:  Re: Admin model

SMA Forráskód: [ Mindet kijelol ]
  1. /* AMX Mod Plugin
  2. *
  3. * (c) Copyright 2013, maxx
  4. * This file is provided as is (no warranties).
  5. *
  6. */
  7.  
  8. #include <amxmodx>
  9. #include <amxmisc>
  10. #include <cstrike>
  11.  
  12. public plugin_init() {
  13. register_plugin("Admin Model", "1.1.1", "maxi")
  14. register_event("ResetHUD", "resetModel", "b")
  15. return PLUGIN_CONTINUE
  16. }
  17.  
  18. public plugin_precache() {
  19. precache_model("models/player/admin_ct/1.mdl")
  20. precache_model("models/player/admin_ct/2.mdl")
  21.  
  22. return PLUGIN_CONTINUE
  23. }
  24. public resetModel(id, level, cid) {
  25. if(cs_get_user_team(id) == CS_TEAM_CT)
  26. {
  27. if(get_user_flags(id) && ADMIN_LEVEL_B)
  28. {
  29. cs_set_user_model(id, "1.mdl")
  30. }
  31. else if(get_user_flags(id) && ADMIN_LEVEL_H)
  32. {
  33. cs_set_user_model(id, "2.mdl")
  34. }
  35. }
  36. return PLUGIN_CONTINUE
  37. }

Szerző:  fear_ezmegmi [2013.08.19. 17:58 ]
Hozzászólás témája:  Re: Admin model

Ez így nem fog működni...

Szerző:  CrB [2013.08.19. 18:05 ]
Hozzászólás témája:  Re: Admin model

Javítva
SMA Forráskód: [ Mindet kijelol ]
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <amxmisc>
  5. #include <hamsandwich>
  6. #include <cstrike>
  7.  
  8. #define PLUGIN "New Plugin"
  9. #define VERSION "1.0"
  10. #define AUTHOR "qKKKJ"
  11.  
  12.  
  13. public plugin_init() {
  14. register_plugin(PLUGIN, VERSION, AUTHOR)
  15.  
  16. RegisterHam(Ham_Spawn, "player", "eledes")
  17. }
  18. public plugin_precache()
  19. {
  20. precache_model("models/player/one/one.mdl")
  21. precache_model("models/player/two/two.mdl")
  22. }
  23. public eledes(id)
  24. {
  25. if(cs_get_user_team(id) == CS_TEAM_CT)
  26. {
  27. if(get_user_flags(id) & ADMIN_LEVEL_B)
  28. {
  29. cs_set_user_model(id, "one")
  30. }
  31. if(get_user_flags(id) & ADMIN_LEVEL_H)
  32. {
  33. cs_set_user_model(id, "two")
  34. }
  35. }
  36. }

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