hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.06.17. 00:38



Jelenlévő felhasználók

Jelenleg 449 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 448 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Bing [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 6 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Fejlett VIP
HozzászólásElküldve: 2012.08.21. 13:43 
Offline
Beavatott

Csatlakozott: 2012.07.04. 13:41
Hozzászólások: 66
Megköszönt másnak: 9 alkalommal
Sziasztok! :D

Kéne egy kis segítség!
Ebből a VIP pluginból kéne olyat csinálni amit alúl legfogok írni:

Kód:

Kód:
  1.     #include <amxmodx>

  2.     #include <amxmisc>

  3.     #include <fun>

  4.     #include <cstrike>

  5.      

  6.     #define max_vips 64

  7.      

  8.     new bool:vip[32];

  9.      

  10.     public login(id)

  11.     {

  12.             new usercfg[64]

  13.             new arguser[32], argpass[32], username[32], password[32]

  14.             new line = 0

  15.             new linetext[255], linetextlength

  16.      

  17.             read_argv(1,arguser,31)

  18.             read_argv(2,argpass,31)

  19.      

  20.             if((arguser[0] > 0)&&(argpass[0] > 0))

  21.             {      

  22.                     get_customdir(usercfg, 63)

  23.                     format(usercfg, 63, "%s/amx_login_vip/login_vip.ini", usercfg)

  24.      

  25.                     if (file_exists(usercfg))

  26.                     {

  27.                             while ((line = read_file(usercfg, line, linetext, 256, linetextlength)))

  28.                             {

  29.                                     if(linetext[0] == ';')

  30.                                     {

  31.                                             continue

  32.                                     }              

  33.                                     parse(linetext, username, 31, password, 31)

  34.      

  35.                                     if((equal(username, arguser))&&(equal(password, argpass)))

  36.                                     {

  37.                                             vip[id] = true;

  38.                                             new text[128]

  39.                                             format(text, 128, "[INFO] Sikeresen bejelentkeztel")

  40.                                             client_print(id, print_console, text)

  41.                                             return PLUGIN_HANDLED

  42.                                     }

  43.                             }

  44.                             client_print(id, print_console, "[INFO] Rossz felhasznalo vagy jelszo.")

  45.                     }

  46.             }

  47.             return PLUGIN_HANDLED

  48.     }

  49.     public logout(id)

  50.     {

  51.             vip[id] = false;

  52.             client_print(id, print_console, "[INFO] Kijelentkeztel a VIP-bol.")

  53.             return PLUGIN_HANDLED

  54.     }

  55.     public plugin_init()

  56.     {

  57.             register_plugin("VIP","1.0","James Romeril & Silent");

  58.             register_clcmd("amx_login_vip","login",-1,"");

  59.             register_clcmd("amx_logout_vip","logout",-1,"");

  60.             register_logevent("RoundStart", 2, "1=Round_Start");

  61.             register_cvar("hs_mode","ab")

  62.             register_event("DeathMsg", "eDeath", "a", "1>0");

  63.     }

  64.      

  65.     public client_connect(id)

  66.     {

  67.             vip[id] = false;

  68.     }

  69.      

  70.     public client_disconnect(id)

  71.     {

  72.             vip[id] = false;

  73.     }

  74.      

  75.     public eDeath()

  76.     {

  77.             new killer = read_data(1);

  78.             new hsmode[4]

  79.             get_cvar_string("hs_mode",hsmode,4)

  80.             new hsmode_bit = read_flags(hsmode)

  81.             if (hsmode_bit & 1)

  82.             {

  83.                     cs_set_user_money(killer, cs_get_user_money(killer) + 100);

  84.             }

  85.             if(vip[killer] && hsmode_bit & 1)

  86.             {

  87.                     cs_set_user_money(killer, cs_get_user_money(killer) + 100);

  88.             }

  89.            

  90.     }

  91.      

  92.     public RoundStart()

  93.     {

  94.             new players[32], iNum;

  95.             get_players(players, iNum);

  96.             for(new i=0; i<iNum; i++)

  97.             {

  98.                     new pId = players[i];

  99.                     if(vip[pId])

  100.                     {

  101.                             cs_set_user_vip (pId, 1, 0, 1)

  102.                             give_item(pId, "weapon_hegrenade");

  103.                             give_item(pId, "weapon_hegrenade");

  104.                             give_item(pId, "weapon_smokegrenade");

  105.                             give_item(pId, "weapon_smokegrenade");

  106.                             give_item(pId, "weapon_flashbang");

  107.                             give_item(pId, "weapon_flashbang");

  108.                     }

  109.             }

  110.     }


Csak át kell alakítani:

- VIP színesen írjon
- Arany m4
- Fejlövés : +30hp
- Ölés : +15 hp
- VIP Modell

Segítsetek!

Köszi!

_________________
Plugin készítést vállalok! -> PM


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Fejlett VIP
HozzászólásElküldve: 2012.08.21. 13:51 
Offline
Félisten

Csatlakozott: 2012.01.07. 21:10
Hozzászólások: 850
Megköszönt másnak: 9 alkalommal
Megköszönték neki: 154 alkalommal
Áthelyezve.

_________________
Megköszönni nem szégyen!
Csak kattints a Kép jelre. --->


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Fejlett VIP
HozzászólásElküldve: 2012.08.21. 15:34 
Offline
Őskövület
Avatar

Csatlakozott: 2013.01.01. 17:48
Hozzászólások: 2441
Megköszönt másnak: 18 alkalommal
Megköszönték neki: 21 alkalommal
Nekem ezt a plugint még talán Silent küldte, de nem túl jó, mert ha T vagy, ct kezdőre bedob, mer ugyebár ott van a vipnek a spawnja... és teljes vip jogokat ad, nem csak kiírja a fragjeid elé azt h VIP (gondolom neked így kéne.)


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Fejlett VIP
HozzászólásElküldve: 2012.08.21. 15:35 
Offline
Beavatott

Csatlakozott: 2012.07.04. 13:41
Hozzászólások: 66
Megköszönt másnak: 9 alkalommal
Scoreboardra nem kell kiírni semmit csak a plugin kéne.

_________________
Plugin készítést vállalok! -> PM


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Fejlett VIP
HozzászólásElküldve: 2012.08.21. 18:10 
Offline
Developer
Avatar

Csatlakozott: 2011.06.01. 21:11
Hozzászólások: 7965
Megköszönt másnak: 295 alkalommal
Megköszönték neki: 537 alkalommal
Kód:
  1. #include <amxmodx>

  2. #include <amxmisc>

  3. #include <fun>

  4. #include <hamsandwich>

  5. #include <cstrike>

  6. #include <fakemeta>

  7.  

  8. #define max_vips 64

  9. #define ACCESS_LEVEL    ADMIN_CHAT

  10. #define ADMIN_LISTEN    ADMIN_BAN

  11. #define is_valid_player(%1) (1 <= %1 <= 32)

  12.  

  13. new bool:vip[33];

  14. new message[192]

  15. new sayText

  16. new teamInfo

  17. new maxPlayers

  18.  

  19. new g_MessageColor

  20. new g_NameColor

  21. new g_AdminListen

  22.  

  23. new strName[191]

  24. new strText[191]

  25. new alive[11]

  26.  

  27. new AK_V_MODEL[64] = "models/v_blockspotm4/v_blockspotm4.mdl"

  28. new AK_P_MODEL[64] = "models/p_blockspotm4/p_blockspotm4.mdl"

  29.  

  30. new cvar_dmgmultiplier, cvar_goldbullets,  cvar_custommodel, cvar_uclip

  31.  

  32. new bool:g_HasAk[33]

  33.  

  34. new g_hasZoom[ 33 ]

  35. new bullets[ 33 ]

  36.  

  37. new m_spriteTexture

  38.  

  39. const Wep_ak47 = ((1<<CSW_M4A1))

  40.  

  41. public login(id)

  42. {

  43.         new usercfg[64]

  44.         new arguser[32], argpass[32], username[32], password[32]

  45.         new line = 0

  46.         new linetext[255], linetextlength

  47.        

  48.         read_argv(1,arguser,31)

  49.         read_argv(2,argpass,31)

  50.        

  51.         if((arguser[0] > 0)&&(argpass[0] > 0))

  52.         {      

  53.                 get_customdir(usercfg, 63)

  54.                 format(usercfg, 63, "%s/amx_login_vip/login_vip.ini", usercfg)

  55.                

  56.                 if (file_exists(usercfg))

  57.                 {

  58.                         while ((line = read_file(usercfg, line, linetext, 256, linetextlength)))

  59.                         {

  60.                                 if(linetext[0] == ';')

  61.                                 {

  62.                                         continue

  63.                                 }              

  64.                                 parse(linetext, username, 31, password, 31)

  65.                                

  66.                                 if((equal(username, arguser))&&(equal(password, argpass)))

  67.                                 {

  68.                                         vip[id] = true;

  69.                                         new text[128]

  70.                                         format(text, 128, "[INFO] Sikeresen bejelentkeztel")

  71.                                         client_print(id, print_console, text)

  72.                                         return PLUGIN_HANDLED

  73.                                 }

  74.                         }

  75.                         client_print(id, print_console, "[INFO] Rossz felhasznalo vagy jelszo.")

  76.                 }

  77.         }

  78.         return PLUGIN_HANDLED

  79. }

  80. public logout(id)

  81. {

  82.         vip[id] = false;

  83.         client_print(id, print_console, "[INFO] Kijelentkeztel a VIP-bol.")

  84.         return PLUGIN_HANDLED

  85. }

  86. public plugin_init()

  87. {

  88.         register_plugin("VIP","1.0","James Romeril & Silent");

  89.         register_clcmd("amx_login_vip","login",-1,"");

  90.         register_clcmd("amx_logout_vip","logout",-1,"");

  91.         register_logevent("RoundStart", 2, "1=Round_Start");

  92.         register_cvar("hs_mode","ab")

  93.         register_event("DeathMsg", "eDeath", "a", "1>0");

  94.        

  95.         g_MessageColor = register_cvar ("amx_color", "2") // Message colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red

  96.  

  97.         g_NameColor = register_cvar ("amx_namecolor", "6") // Name colors: [1] Default Yellow, [2] Green, [3] White, [4] Blue, [5] Red, [6] Team-color

  98.        

  99.         g_AdminListen = register_cvar ("amx_listen", "1") // Set whether admins see or not all messages (Alive, dead and team-only)

  100.        

  101.        

  102.         sayText = get_user_msgid ("SayText")

  103.         teamInfo = get_user_msgid ("TeamInfo")

  104.         maxPlayers = get_maxplayers()

  105.        

  106.        

  107.         register_message (sayText, "avoid_duplicated")

  108.        

  109.         register_clcmd ("amx_color", "set_color", ACCESS_LEVEL, "<color>")

  110.         register_clcmd ("amx_namecolor", "set_name_color", ACCESS_LEVEL, "<color>")

  111.         register_clcmd ("amx_listen", "set_listen", ACCESS_LEVEL, "<1 | 0>")

  112.        

  113.         register_clcmd ("say", "hook_say")

  114.         register_clcmd ("say_team", "hook_teamsay")

  115.         register_event("ResetHUD", "resetModel", "b")

  116.        

  117.        

  118.         cvar_dmgmultiplier = register_cvar("goldenak_dmg_multiplier", "5")

  119.         cvar_custommodel = register_cvar("goldenak_custom_model", "1")

  120.         cvar_goldbullets = register_cvar("goldenak_gold_bullets", "1")

  121.         cvar_uclip = register_cvar("goldenak_unlimited_clip", "1")

  122.        

  123.         register_clcmd("say /aranym4", "CmdBuyAk")

  124.         register_clcmd("say_team /aranym4", "CmdBuyAk")

  125.         register_event("WeapPickup","checkModel","b","1=19")

  126.         register_event("CurWeapon","checkWeapon","be","1=1")

  127.         register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")

  128.         RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")

  129.         register_forward( FM_CmdStart, "fw_CmdStart" )

  130.         RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)

  131. }

  132.  

  133.  

  134. public plugin_precache() {

  135.         precache_model("models/player/bs_vip_ct/bs_vip_ct.mdl")

  136.         precache_model("models/player/bs_vips_t/bs_vips_t.mdl")

  137.                 precache_model(AK_V_MODEL)

  138.                 precache_model(AK_P_MODEL)

  139.                 m_spriteTexture = precache_model("sprites/dot.spr")

  140.                 precache_sound("weapons/zoom.wav")

  141.  

  142.         return PLUGIN_CONTINUE

  143. }

  144.  

  145. public resetModel(id, level, cid) {

  146.         if (vip[id] == true) {

  147.                 new CsTeams:userTeam = cs_get_user_team(id)

  148.                 if (userTeam == CS_TEAM_T) {

  149.                         cs_set_user_model(id, "bs_vips_t")

  150.                 }

  151.                 else if(userTeam == CS_TEAM_CT) {

  152.                         cs_set_user_model(id, "bs_vips_ct")

  153.                 }

  154.                 else {

  155.                         cs_reset_user_model(id)

  156.                 }

  157.         }

  158.  

  159.         return PLUGIN_CONTINUE

  160. }

  161.  

  162. public client_connect(id)

  163. {

  164.         vip[id] = false;

  165.         g_HasAk[id] = false

  166. }

  167.  

  168. public client_disconnect(id)

  169. {

  170.         vip[id] = false;

  171.         g_HasAk[id] = false

  172. }

  173.  

  174. public fwHamPlayerSpawnPost(id)

  175. {

  176.         g_HasAk[id] = false

  177. }

  178.  

  179. public eDeath()

  180. {

  181.         new killer = read_data(1);

  182.         new Victim = read_data(2)

  183.         new Headshot = read_data(3);

  184.         g_HasAk[Victim] = false

  185.         if(Headshot && vip[killer])

  186.     {

  187.          set_user_health(killer, get_user_health(killer) + 30)

  188.     }

  189.         if(killer != Victim && vip[killer] && !Headshot)

  190.     {

  191.          set_user_health(killer, get_user_health(killer) + 15)

  192.     }

  193.         new hsmode[4]

  194.         get_cvar_string("hs_mode",hsmode,4)

  195.         new hsmode_bit = read_flags(hsmode)

  196.         if (hsmode_bit & 1)

  197.         {

  198.                 cs_set_user_money(killer, cs_get_user_money(killer) + 100);

  199.         }

  200.         if(vip[killer] && hsmode_bit & 1)

  201.         {

  202.                 cs_set_user_money(killer, cs_get_user_money(killer) + 100);

  203.         }

  204.        

  205. }

  206.  

  207. public RoundStart()

  208. {

  209.         new players[32], iNum;

  210.         get_players(players, iNum);

  211.         for(new i=0; i<iNum; i++)

  212.         {

  213.                 new pId = players[i];

  214.                 if(vip[pId])

  215.                 {

  216.                         cs_set_user_vip (pId, 1, 0, 1)

  217.                         give_item(pId, "weapon_hegrenade");

  218.                         give_item(pId, "weapon_hegrenade");

  219.                         give_item(pId, "weapon_smokegrenade");

  220.                         give_item(pId, "weapon_smokegrenade");

  221.                         give_item(pId, "weapon_flashbang");

  222.                         give_item(pId, "weapon_flashbang");

  223.                 }

  224.         }

  225. }      

  226.  

  227. public avoid_duplicated (msgId, msgDest, receiver)

  228. {

  229.         return PLUGIN_HANDLED

  230. }

  231.  

  232.  

  233. public hook_say(id)

  234. {

  235.         read_args (message, 191)

  236.         remove_quotes (message)

  237.        

  238.         if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,

  239.                                                                                                // Gungame commands and empty messages

  240.                 return PLUGIN_CONTINUE

  241.  

  242.                

  243.         new name[32]

  244.         get_user_name (id, name, 31)

  245.        

  246.         new bool:admin = false

  247.        

  248.         if (get_user_flags(id) & ACCESS_LEVEL || vip[id] == true)

  249.                 admin = true

  250.                

  251.        

  252.         new isAlive

  253.        

  254.         if (is_user_alive (id))

  255.                 {

  256.                         isAlive = 1

  257.                         alive = "^x01"

  258.                 }

  259.         else

  260.                 {

  261.                         isAlive = 0

  262.                         alive = "^x01*DEAD* "

  263.                 }

  264.        

  265.         static color[10]

  266.        

  267.  

  268.        

  269.         if (admin)

  270.                 {

  271.                         // Name

  272.                         switch (get_pcvar_num (g_NameColor))

  273.                                 {

  274.                                         case 1:

  275.                                                 format (strName, 191, "%s%s", alive, name)

  276.  

  277.                                         case 2:

  278.                                                 format (strName, 191, "%s^x04%s", alive, name)

  279.                                                

  280.                                         case 3:

  281.                                                 {

  282.                                                         color = "SPECTATOR"

  283.                                                         format (strName, 191, "%s^x03%s", alive, name)

  284.                                                 }

  285.                                                

  286.                                         case 4:

  287.                                                 {

  288.                                                         color = "CT"

  289.                                                         format (strName, 191, "%s^x03%s", alive, name)

  290.                                                 }

  291.  

  292.                                         case 5:

  293.                                                 {

  294.                                                         color = "TERRORIST"

  295.                                                         format (strName, 191, "%s^x03%s", alive, name)

  296.                                                 }

  297.                                        

  298.                                         case 6:

  299.                                                 {

  300.                                                         get_user_team (id, color, 9)

  301.                                                                

  302.                                                         format (strName, 191, "%s^x03%s", alive, name)

  303.                                                 }

  304.                                 }

  305.                        

  306.                        

  307.                         // Message

  308.                         switch (get_pcvar_num (g_MessageColor))

  309.                                 {

  310.                                         case 1: // Yellow

  311.                                                 format (strText, 191, "%s", message)

  312.                                                

  313.                                         case 2: // Green

  314.                                                 format (strText, 191, "^x04%s", message)

  315.                                                

  316.                                         case 3: // White

  317.                                                 {

  318.                                                         copy (color, 9, "SPECTATOR")

  319.                                                         format (strText, 191, "^x03%s", message)

  320.                                                 }

  321.  

  322.                                         case 4: // Blue

  323.                                                 {

  324.                                                         copy (color, 9, "CT")

  325.                                                         format (strText, 191, "^x03%s", message)

  326.                                                 }

  327.                                                

  328.                                         case 5: // Red

  329.                                                 {

  330.                                                         copy (color, 9, "TERRORIST")

  331.                                                         format (strText, 191, "^x03%s", message)

  332.                                                 }

  333.                                 }

  334.                 }

  335.        

  336.         else    // Player is not admin. Team-color name : Yellow message

  337.                 {

  338.                         get_user_team (id, color, 9)

  339.                        

  340.                         format (strName, 191, "%s^x03%s", alive, name)

  341.                        

  342.                         format (strText, 191, "%s", message)

  343.                 }

  344.  

  345.         format (message, 191, "%s^x01 :  %s", strName, strText)

  346.                        

  347.         sendMessage (color, isAlive)    // Sends the colored message

  348.        

  349.         return PLUGIN_CONTINUE

  350. }

  351.  

  352.  

  353. public hook_teamsay(id)

  354. {

  355.         new playerTeam = get_user_team(id)

  356.         new playerTeamName[19]

  357.        

  358.         switch (playerTeam) // Team names which appear on team-only messages

  359.                 {

  360.                         case 1:

  361.                                 copy (playerTeamName, 11, "Terrorists")

  362.                                

  363.                         case 2:

  364.                                 copy (playerTeamName, 18, "Counter-Terrorists")

  365.                                

  366.                         default:

  367.                                 copy (playerTeamName, 9, "Spectator")

  368.                 }

  369.                

  370.         read_args (message, 191)

  371.         remove_quotes (message)

  372.        

  373.         if (message[0] == '@' || message[0] == '/' || message[0] == '!' || equal (message, "")) // Ignores Admin Hud Messages, Admin Slash commands,

  374.                                                                                                // Gungame commands and empty messages

  375.                 return PLUGIN_CONTINUE

  376.  

  377.                

  378.         new name[32]

  379.         get_user_name (id, name, 31)

  380.        

  381.         new bool:admin = false

  382.        

  383.         if (get_user_flags(id) & ACCESS_LEVEL || vip[id] == true)

  384.                 admin = true

  385.                

  386.        

  387.         new isAlive

  388.        

  389.         if (is_user_alive (id))

  390.                 {

  391.                         isAlive = 1

  392.                         alive = "^x01"

  393.                 }

  394.         else

  395.                 {

  396.                         isAlive = 0

  397.                         alive = "^x01*DEAD* "

  398.                 }

  399.        

  400.         static color[10]

  401.        

  402.  

  403.        

  404.         if (admin)

  405.                 {

  406.                         // Name

  407.                         switch (get_pcvar_num (g_NameColor))

  408.                                 {

  409.                                         case 1:

  410.                                                 format (strName, 191, "%s(%s) %s", alive, playerTeamName, name)

  411.  

  412.                                         case 2:

  413.                                                 format (strName, 191, "%s(%s) ^x04%s", alive, playerTeamName, name)

  414.                                                

  415.                                         case 3:

  416.                                                 {

  417.                                                         color = "SPECTATOR"

  418.                                                         format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)

  419.                                                 }

  420.                                                

  421.                                         case 4:

  422.                                                 {

  423.                                                         color = "CT"

  424.                                                         format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)

  425.                                                 }

  426.  

  427.                                         case 5:

  428.                                                 {

  429.                                                         color = "TERRORIST"

  430.                                                         format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)

  431.                                                 }

  432.                                        

  433.                                         case 6:

  434.                                                 {

  435.                                                         get_user_team (id, color, 9)

  436.                                                                

  437.                                                         format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)

  438.                                                 }

  439.                                 }

  440.                        

  441.                        

  442.                         // Message

  443.                         switch (get_pcvar_num (g_MessageColor))

  444.                                 {

  445.                                         case 1: // Yellow

  446.                                                 format (strText, 191, "%s", message)

  447.                                                

  448.                                         case 2: // Green

  449.                                                 format (strText, 191, "^x04%s", message)

  450.                                                

  451.                                         case 3: // White

  452.                                                 {

  453.                                                         copy (color, 9, "SPECTATOR")

  454.                                                         format (strText, 191, "^x03%s", message)

  455.                                                 }

  456.  

  457.                                         case 4: // Blue

  458.                                                 {

  459.                                                         copy (color, 9, "CT")

  460.                                                         format (strText, 191, "^x03%s", message)

  461.                                                 }

  462.                                                

  463.                                         case 5: // Red

  464.                                                 {

  465.                                                         copy (color, 9, "TERRORIST")

  466.                                                         format (strText, 191, "^x03%s", message)

  467.                                                 }

  468.                                 }

  469.                 }

  470.        

  471.         else    // Player is not admin. Team-color name : Yellow message

  472.                 {

  473.                         get_user_team (id, color, 9)

  474.                        

  475.                         format (strName, 191, "%s(%s) ^x03%s", alive, playerTeamName, name)

  476.                        

  477.                         format (strText, 191, "%s", message)

  478.                 }

  479.        

  480.         format (message, 191, "%s ^x01:  %s", strName, strText)

  481.        

  482.         sendTeamMessage (color, isAlive, playerTeam)    // Sends the colored message

  483.        

  484.         return PLUGIN_CONTINUE 

  485. }

  486.  

  487.  

  488. public set_color (id, level, cid)

  489. {

  490.         if (!cmd_access(id, level, cid, 2))

  491.                 return PLUGIN_HANDLED

  492.                

  493.         new arg[1], newColor

  494.         read_argv (1, arg, 1)

  495.        

  496.         newColor = str_to_num (arg)

  497.        

  498.         if (newColor >= 1 && newColor <= 5)

  499.                 {

  500.                         set_cvar_num ("amx_color", newColor)

  501.                         set_pcvar_num (g_MessageColor, newColor)

  502.        

  503.                         if (get_pcvar_num (g_NameColor) != 1 &&

  504.                                ((newColor == 3 &&  get_pcvar_num (g_NameColor) != 3)

  505.                              || (newColor == 4 &&  get_pcvar_num (g_NameColor) != 4)

  506.                              || (newColor == 5 &&  get_pcvar_num (g_NameColor) != 5)))

  507.                                 {

  508.                                         set_cvar_num ("amx_namecolor", 2)

  509.                                         set_pcvar_num (g_NameColor, 2)

  510.                                 }

  511.                 }

  512.                

  513.         return PLUGIN_HANDLED

  514. }

  515.  

  516.  

  517. public set_name_color (id, level, cid)

  518. {

  519.         if (!cmd_access(id, level, cid, 2))

  520.                 return PLUGIN_HANDLED

  521.                

  522.         new arg[1], newColor

  523.         read_argv (1, arg, 1)

  524.        

  525.         newColor = str_to_num (arg)

  526.        

  527.         if (newColor >= 1 && newColor <= 6)

  528.                 {

  529.                         set_cvar_num ("amx_namecolor", newColor)

  530.                         set_pcvar_num (g_NameColor, newColor)

  531.                        

  532.                         if ((get_pcvar_num (g_MessageColor) != 1

  533.                             && ((newColor == 3 &&  get_pcvar_num (g_MessageColor) != 3)

  534.                              || (newColor == 4 &&  get_pcvar_num (g_MessageColor) != 4)

  535.                              || (newColor == 5 &&  get_pcvar_num (g_MessageColor) != 5)))

  536.                              || get_pcvar_num (g_NameColor) == 6)

  537.                                 {

  538.                                         set_cvar_num ("amx_color", 2)

  539.                                         set_pcvar_num (g_MessageColor, 2)

  540.                                 }

  541.                 }

  542.        

  543.         return PLUGIN_HANDLED

  544. }

  545.  

  546.  

  547. public set_listen (id, level, cid)

  548. {

  549.         if (!cmd_access(id, level, cid, 2))

  550.                 return PLUGIN_HANDLED

  551.                

  552.         new arg[1], newListen

  553.         read_argv(1, arg, 1)

  554.        

  555.         newListen = str_to_num (arg)

  556.        

  557.         set_cvar_num ("amx_listen", newListen)

  558.         set_pcvar_num (g_AdminListen, newListen)

  559.        

  560.         return PLUGIN_HANDLED

  561. }

  562.  

  563.  

  564. public sendMessage (color[], alive)

  565. {

  566.         new teamName[10]

  567.        

  568.         for (new player = 1; player < maxPlayers; player++)

  569.                 {

  570.                         if (!is_user_connected(player))

  571.                                 continue

  572.  

  573.                         if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)

  574.                                 {

  575.                                         get_user_team (player, teamName, 9)     // Stores user's team name to change back after sending the message

  576.                                        

  577.                                         changeTeamInfo (player, color)          // Changes user's team according to color choosen

  578.                                        

  579.                                         writeMessage (player, message)          // Writes the message on player's chat

  580.                                        

  581.                                         changeTeamInfo (player, teamName)       // Changes user's team back to original

  582.                                 }

  583.                 }

  584. }

  585.  

  586.  

  587. public sendTeamMessage (color[], alive, playerTeam)

  588. {

  589.         new teamName[10]

  590.        

  591.         for (new player = 1; player < maxPlayers; player++)

  592.                 {

  593.                         if (!is_user_connected(player))

  594.                                 continue

  595.  

  596.                         if (get_user_team(player) == playerTeam || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)

  597.                                 {

  598.                                         if (alive && is_user_alive(player) || !alive && !is_user_alive(player) || get_pcvar_num(g_AdminListen) && get_user_flags(player) & ADMIN_LISTEN)

  599.                                                 {

  600.                                                         get_user_team (player, teamName, 9)     // Stores user's team name to change back after sending the message

  601.                                                        

  602.                                                         changeTeamInfo (player, color)          // Changes user's team according to color choosen

  603.                                                        

  604.                                                         writeMessage (player, message)          // Writes the message on player's chat

  605.                                                        

  606.                                                         changeTeamInfo (player, teamName)       // Changes user's team back to original

  607.                                                 }

  608.                                 }

  609.                 }

  610. }

  611.  

  612.  

  613. public changeTeamInfo (player, team[])

  614. {

  615.         message_begin (MSG_ONE, teamInfo, _, player)    // Tells to to modify teamInfo (Which is responsable for which time player is)

  616.         write_byte (player)                             // Write byte needed

  617.         write_string (team)                             // Changes player's team

  618.         message_end()                                   // Also Needed

  619. }

  620.  

  621.  

  622. public writeMessage (player, message[])

  623. {

  624.         message_begin (MSG_ONE, sayText, {0, 0, 0}, player)     // Tells to modify sayText (Which is responsable for writing colored messages)

  625.         write_byte (player)                                     // Write byte needed

  626.         write_string (message)                                  // Effectively write the message, finally, afterall

  627.         message_end ()

  628. }

  629.  

  630.  

  631. public checkModel(id)

  632. {

  633.         if ( !g_HasAk[id] )

  634.                 return PLUGIN_HANDLED

  635.        

  636.         new szWeapID = read_data(2)

  637.        

  638.         if ( szWeapID == CSW_M4A1 && g_HasAk[id] == true && get_pcvar_num(cvar_custommodel) )

  639.         {

  640.                 set_pev(id, pev_viewmodel2, AK_V_MODEL)

  641.                 set_pev(id, pev_weaponmodel2, AK_P_MODEL)

  642.         }

  643.         return PLUGIN_HANDLED

  644. }

  645.  

  646. public checkWeapon(id)

  647. {

  648.         new plrClip, plrAmmo, plrWeap[32]

  649.         new plrWeapId

  650.        

  651.         plrWeapId = get_user_weapon(id, plrClip , plrAmmo)

  652.        

  653.         if (plrWeapId == CSW_M4A1 && g_HasAk[id])

  654.         {

  655.                 checkModel(id)

  656.         }

  657.         else

  658.         {

  659.                 return PLUGIN_CONTINUE

  660.         }

  661.        

  662.         if (plrClip == 0 && get_pcvar_num(cvar_uclip))

  663.         {

  664.                 // If the user is out of ammo..

  665.                 get_weaponname(plrWeapId, plrWeap, 31)

  666.                 // Get the name of their weapon

  667.                 give_item(id, plrWeap)

  668.                 engclient_cmd(id, plrWeap)

  669.                 engclient_cmd(id, plrWeap)

  670.                 engclient_cmd(id, plrWeap)

  671.         }

  672.         return PLUGIN_HANDLED

  673. }

  674.  

  675.  

  676.  

  677. public fw_TakeDamage(victim, inflictor, attacker, Float:damage)

  678. {

  679.         if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_M4A1 && g_HasAk[attacker] )

  680.         {

  681.                 SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )

  682.         }

  683. }

  684.  

  685. public fw_CmdStart( id, uc_handle, seed )

  686. {

  687.         if( !is_user_alive( id ) )

  688.                 return PLUGIN_HANDLED

  689.        

  690.         if( ( get_uc( uc_handle, UC_Buttons ) & IN_ATTACK2 ) && !( pev( id, pev_oldbuttons ) & IN_ATTACK2 ) )

  691.         {

  692.                 new szClip, szAmmo

  693.                 new szWeapID = get_user_weapon( id, szClip, szAmmo )

  694.                

  695.                 if( szWeapID == CSW_M4A1 && g_HasAk[id] == true && !g_hasZoom[id] == true)

  696.                 {

  697.                         g_hasZoom[id] = true

  698.                         cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 0 )

  699.                         emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )

  700.                 }

  701.                

  702.                 else if ( szWeapID == CSW_M4A1 && g_HasAk[id] == true && g_hasZoom[id])

  703.                 {

  704.                         g_hasZoom[ id ] = false

  705.                         cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )

  706.                        

  707.                 }

  708.                

  709.         }

  710.         return PLUGIN_HANDLED

  711. }

  712.  

  713.  

  714. public make_tracer(id)

  715. {

  716.         if (get_pcvar_num(cvar_goldbullets))

  717.         {

  718.                 new clip,ammo

  719.                 new wpnid = get_user_weapon(id,clip,ammo)

  720.                 new pteam[16]

  721.                

  722.                 get_user_team(id, pteam, 15)

  723.                

  724.                 if ((bullets[id] > clip) && (wpnid == CSW_M4A1) && g_HasAk[id])

  725.                 {

  726.                         new vec1[3], vec2[3]

  727.                         get_user_origin(id, vec1, 1) // origin; your camera point.

  728.                         get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)

  729.                        

  730.                        

  731.                         //BEAMENTPOINTS

  732.                         message_begin( MSG_BROADCAST,SVC_TEMPENTITY)

  733.                         write_byte (0)     //TE_BEAMENTPOINTS 0

  734.                         write_coord(vec1[0])

  735.                         write_coord(vec1[1])

  736.                         write_coord(vec1[2])

  737.                         write_coord(vec2[0])

  738.                         write_coord(vec2[1])

  739.                         write_coord(vec2[2])

  740.                         write_short( m_spriteTexture )

  741.                         write_byte(1) // framestart

  742.                         write_byte(5) // framerate

  743.                         write_byte(2) // life

  744.                         write_byte(10) // width

  745.                         write_byte(0) // noise

  746.                         write_byte( 255 )     // r, g, b

  747.                         write_byte( 215 )       // r, g, b

  748.                         write_byte( 0 )       // r, g, b

  749.                         write_byte(200) // brightness

  750.                         write_byte(150) // speed

  751.                         message_end()

  752.                 }

  753.                

  754.                 bullets[id] = clip

  755.         }

  756.        

  757. }

  758.  

  759. public CmdBuyAk(id)

  760. {

  761.         if ( !is_user_alive(id) )

  762.         {

  763.                 client_print(id,print_chat, "Nem elsz, igy nem kapsz arany m4et!")

  764.                 return PLUGIN_HANDLED

  765.         }

  766.        

  767.         if (vip[id])

  768.         {

  769.                 give_item(id, "weapon_m4a1")

  770.                 g_HasAk[id] = true

  771.         }

  772.        

  773.         return PLUGIN_HANDLED

  774. }

  775.  

  776. stock drop_prim(id)

  777. {

  778.         new weapons[32], num

  779.         get_user_weapons(id, weapons, num)

  780.         for (new i = 0; i < num; i++) {

  781.                 if (Wep_ak47 & (1<<weapons[i]))

  782.                 {

  783.                         static wname[32]

  784.                         get_weaponname(weapons[i], wname, sizeof wname - 1)

  785.                         engclient_cmd(id, "drop", wname)

  786.                 }

  787.         }

  788. }

_________________
http://www.easyrankup.eu


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Fejlett VIP
HozzászólásElküldve: 2012.08.23. 15:06 
Offline
Beavatott

Csatlakozott: 2012.07.04. 13:41
Hozzászólások: 66
Megköszönt másnak: 9 alkalommal
Nem működik amúgy a plugin.
Beírom : amx_login_vip asd asd
és Unknown Command. ://

_________________
Plugin készítést vállalok! -> PM


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 6 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 30 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole