Approved Stealth

Zombies/Humans Extra-Items
User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

Stealth

#1

Post by Mark » 5 years ago

Stealth
Description:
  • New Extra Item for Both Zombie and Humans Stealth!
  • By default its set to 16secs you can change this in the sma #define STEALTH 16.0



Code:
  1. #include <zombie_escape>
  2. #include <fun>
  3.  
  4. #define PLUGIN   "Stealth"
  5. #define VERSION  "1.0"
  6. #define AUTHOR   "Mark"
  7.  
  8. #define STEALTH  16.0
  9.  
  10. new g_iItemStealth, g_szName[32]
  11.  
  12. new const sound_stealth[] =
  13. {
  14.     "zombie_escape/blinkarrival.wav"
  15. }
  16.  
  17. public plugin_init()
  18. {
  19.       register_plugin(PLUGIN,VERSION,AUTHOR)
  20.  
  21.       g_iItemStealth = ze_register_item("Stealth \w[ \r16 sec.\w]", 60, 1)
  22. }
  23.  
  24. public plugin_precache()
  25. {
  26.       precache_sound(sound_stealth)
  27. }
  28.  
  29. public ze_select_item_pre(id, itemid)
  30. {
  31.     if (itemid != g_iItemStealth)
  32.         return ZE_ITEM_AVAILABLE
  33.    
  34.     if (!is_user_alive(id))
  35.         return ZE_ITEM_DONT_SHOW
  36.        
  37.     return ZE_ITEM_AVAILABLE
  38. }
  39.  
  40. public ze_select_item_post(id, itemid)
  41. {
  42.     if  (itemid == g_iItemStealth)
  43.     {
  44.         Set_Rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0)
  45.         set_user_footsteps(id, 1)
  46.  
  47.         get_user_name(id, g_szName, 31)
  48.         ze_colored_print(0, "!g%s !tis now invisible!y!", g_szName)
  49.         PlaySound(id, sound_stealth)
  50.         set_task( STEALTH , "remove_stealth", id)
  51.     }
  52. }
  53.  
  54. public remove_stealth(id)
  55. {
  56.     get_user_name(id, g_szName, 31)
  57.     Set_Rendering(id)
  58.     set_user_footsteps(id, 0)
  59.     ze_colored_print(0, "!g%s !tis not invisible any more!y!", g_szName)
  60.     PlaySound(id, sound_stealth)
  61. }


Download:
Last edited by Mark 5 years ago, edited 1 time in total.

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 5 years ago

  1. #include <zombie_escape>
  2. #include <fun>
  3.  
  4. #define PLUGIN   "Stealth"
  5. #define VERSION  "1.0"
  6. #define AUTHOR   "Mark"
  7.  
  8. #define STEALTH  16.0
  9.  
  10. new g_iItemStealth, g_szName[32]
  11.  
  12. new const sound_stealth[] =
  13. {
  14.     "zombie_escape/blinkarrival.wav"
  15. }
  16.  
  17. public plugin_init()
  18. {
  19.       register_plugin(PLUGIN,VERSION,AUTHOR)
  20.  
  21.       g_iItemStealth = ze_register_item("Stealth \w[ \r16 sec.\w]", 60, 1)
  22. }
  23.  
  24. public plugin_precache()
  25. {
  26.       precache_sound(sound_stealth)
  27. }
  28.  
  29. public ze_select_item_pre(id, itemid)
  30. {
  31.     if (itemid != g_iItemStealth)
  32.         return ZE_ITEM_AVAILABLE
  33.    
  34.     if (!is_user_alive(id))
  35.         return ZE_ITEM_DONT_SHOW
  36.        
  37.     return ZE_ITEM_AVAILABLE
  38. }
  39.  
  40. public ze_select_item_post(id, itemid)
  41. {
  42.     if  (itemid == g_iItemStealth)
  43.     {
  44.         Set_Rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0)
  45.         set_user_footsteps(id, 1)
  46.  
  47.         get_user_name(id, g_szName, 31)
  48.         ze_colored_print(0, "!g%s !tis now invisible!y!", g_szName)
  49.         PlaySound(id, sound_stealth)
  50.         set_task( STEALTH , "remove_stealth", id)
  51.     }
  52. }
  53.  
  54. public remove_stealth(id)
  55. {
  56.     get_user_name(id, g_szName, 31)
  57.     Set_Rendering(id)
  58.     set_user_footsteps(id, 0)
  59.     ze_colored_print(0, "!g%s !tis not invisible any more!y!", g_szName)
  60.     PlaySound(id, sound_stealth)
  61. }
He who fails to plan is planning to fail

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#3

Post by Mark » 5 years ago

Raheem wrote: 5 years ago
  1. #include <zombie_escape>
  2. #include <fun>
  3.  
  4. #define PLUGIN   "Stealth"
  5. #define VERSION  "1.0"
  6. #define AUTHOR   "Mark"
  7.  
  8. #define STEALTH  16.0
  9.  
  10. new g_iItemStealth, g_szName[32]
  11.  
  12. new const sound_stealth[] =
  13. {
  14.     "zombie_escape/blinkarrival.wav"
  15. }
  16.  
  17. public plugin_init()
  18. {
  19.       register_plugin(PLUGIN,VERSION,AUTHOR)
  20.  
  21.       g_iItemStealth = ze_register_item("Stealth \w[ \r16 sec.\w]", 60, 1)
  22. }
  23.  
  24. public plugin_precache()
  25. {
  26.       precache_sound(sound_stealth)
  27. }
  28.  
  29. public ze_select_item_pre(id, itemid)
  30. {
  31.     if (itemid != g_iItemStealth)
  32.         return ZE_ITEM_AVAILABLE
  33.    
  34.     if (!is_user_alive(id))
  35.         return ZE_ITEM_DONT_SHOW
  36.        
  37.     return ZE_ITEM_AVAILABLE
  38. }
  39.  
  40. public ze_select_item_post(id, itemid)
  41. {
  42.     if  (itemid == g_iItemStealth)
  43.     {
  44.         Set_Rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0)
  45.         set_user_footsteps(id, 1)
  46.  
  47.         get_user_name(id, g_szName, 31)
  48.         ze_colored_print(0, "!g%s !tis now invisible!y!", g_szName)
  49.         PlaySound(id, sound_stealth)
  50.         set_task( STEALTH , "remove_stealth", id)
  51.     }
  52. }
  53.  
  54. public remove_stealth(id)
  55. {
  56.     get_user_name(id, g_szName, 31)
  57.     Set_Rendering(id)
  58.     set_user_footsteps(id, 0)
  59.     ze_colored_print(0, "!g%s !tis not invisible any more!y!", g_szName)
  60.     PlaySound(id, sound_stealth)
  61. }
Updated thanks!

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#4

Post by czirimbolo » 5 years ago

Its doesnt work, players can easily infect me
Image

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#5

Post by Mark » 5 years ago

czirimbolo wrote: 5 years ago Its doesnt work, players can easily infect me
Use this code and tell me.
  1. #include <zombie_escape>
  2. #include <engine>
  3. #include <fun>
  4.  
  5. #define PLUGIN   "Stealth"
  6. #define VERSION  "1.0"
  7. #define AUTHOR   "Mark"
  8.  
  9. #define STEALTH  16.0
  10.  
  11. new g_iItemStealth, g_szName[32]
  12.  
  13. new const sound_stealth[] =
  14. {
  15.     "zombie_escape/blinkarrival.wav"
  16. }
  17.  
  18. public plugin_init()
  19. {
  20.       register_plugin(PLUGIN,VERSION,AUTHOR)
  21.  
  22.       g_iItemStealth = ze_register_item("Stealth \w[ \r16 sec.\w]", 60, 1)
  23. }
  24.  
  25. public plugin_precache()
  26. {
  27.       precache_sound(sound_stealth)
  28. }
  29.  
  30. public ze_select_item_pre(id, itemid)
  31. {
  32.     if (itemid != g_iItemStealth)
  33.         return ZE_ITEM_AVAILABLE
  34.    
  35.     if (!is_user_alive(id))
  36.         return ZE_ITEM_DONT_SHOW
  37.        
  38.     return ZE_ITEM_AVAILABLE
  39. }
  40.  
  41. public ze_select_item_post(id, itemid)
  42. {
  43.     if  (itemid == g_iItemStealth)
  44.     {
  45.         set_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0)
  46.         set_user_footsteps(id, 1)
  47.  
  48.         get_user_name(id, g_szName, 31)
  49.         ze_colored_print(0, "!g%s !tis now invisible!y!", g_szName)
  50.         PlaySound(id, sound_stealth)
  51.         set_task( STEALTH , "remove_stealth", id)
  52.     }
  53. }
  54.  
  55. public remove_stealth(id)
  56. {
  57.     get_user_name(id, g_szName, 31)
  58.     set_rendering(id)
  59.     set_user_footsteps(id, 0)
  60.     ze_colored_print(0, "!g%s !tis not invisible any more!y!", g_szName)
  61.     PlaySound(id, sound_stealth)
  62. }

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#6

Post by Raheem » 5 years ago

[mention]Mark[/mention] , it's working for you :shock:?

OK, there is issue with Mod itself. Mod is setting the rendering every 0.3 seconds to set glow for the escape leader and to reset glow for others. So this will need a native to stop this if player bought stealth.

So setting rendring not easy with our Mod, but i'll introduce a function that will make things simpler. I'll add it to github if you reported it's working well.

First you will need to update your ze_effects_messages.sma to:
    1. #include <zombie_escape>
    2.  
    3. // You can change this if you need
    4. static szNone[] = "None"
    5.  
    6. enum
    7. {
    8.     RANK_NONE = 0,
    9.     RANK_FIRST,
    10.     RANK_SECOND,
    11.     RANK_THIRD
    12. }
    13.  
    14. // Colors
    15. enum
    16. {
    17.     Red = 0,
    18.     Green,
    19.     Blue
    20. }
    21.  
    22. // Variables
    23. new g_iMaxClients,
    24.     g_iSpeedRank,
    25.     g_iInfectionMsg,
    26.     g_iEscapePoints[33],
    27.     g_iEscapeRank[4],
    28.     bool:g_bStopRendering[33]
    29.  
    30. // Cvars
    31. new g_pCvarInfectNotice,
    32.     g_pCvarInfectColors[3],
    33.     g_pCvarMode,
    34.     g_pCvarRankColors[3],
    35.     g_pCvarLeaderGlow,
    36.     g_pCvarLeaderGlowColors[3],
    37.     g_pCvarLeaderGlowRandom
    38.  
    39. public plugin_init()
    40. {
    41.     register_plugin("[ZE] Messages", ZE_VERSION, AUTHORS)
    42.    
    43.     // Hook Chains
    44.     RegisterHookChain(RG_CBasePlayer_Spawn, "Fw_PlayerSpawn_Post", 1)
    45.    
    46.     // Cvars
    47.     g_pCvarInfectNotice = register_cvar("ze_enable_infect_notice", "1")
    48.     g_pCvarInfectColors[Red] = register_cvar("ze_infect_notice_red", "255")
    49.     g_pCvarInfectColors[Green] = register_cvar("ze_infect_notice_green", "0")
    50.     g_pCvarInfectColors[Blue] = register_cvar("ze_infect_notice_blue", "0")
    51.     g_pCvarMode = register_cvar("ze_speed_rank_mode", "1")
    52.     g_pCvarRankColors[Red] = register_cvar("ze_speed_rank_red", "0")
    53.     g_pCvarRankColors[Green] = register_cvar("ze_speed_rank_green", "255")
    54.     g_pCvarRankColors[Blue] = register_cvar("ze_speed_rank_blue", "0")
    55.     g_pCvarLeaderGlow = register_cvar("ze_leader_glow", "1")
    56.     g_pCvarLeaderGlowColors[Red] = register_cvar("ze_leader_glow_red", "255")
    57.     g_pCvarLeaderGlowColors[Green] = register_cvar("ze_leader_glow_green", "0")
    58.     g_pCvarLeaderGlowColors[Blue] = register_cvar("ze_leader_glow_blue", "0")
    59.     g_pCvarLeaderGlowRandom = register_cvar("ze_leader_random_color", "1")
    60.    
    61.     // Messages
    62.     g_iSpeedRank = CreateHudSyncObj()
    63.     g_iInfectionMsg = CreateHudSyncObj()
    64.    
    65.     // Others
    66.     g_iMaxClients = get_member_game(m_nMaxPlayers)
    67.    
    68.     // Tasks
    69.     set_task(0.3, "Show_Message", _, _, _, "b") // 0.3 Is Enough Delay
    70. }
    71.  
    72. public plugin_natives()
    73. {
    74.     register_native("ze_get_escape_leader_id", "native_ze_get_escape_leader_id", 1)
    75.     register_native("ze_stop_mod_rendering", "native_ze_stop_mod_rendering", 1)
    76. }
    77.  
    78. public ze_user_infected(iVictim, iInfector)
    79. {
    80.     if (get_pcvar_num(g_pCvarInfectNotice) != 0)
    81.     {
    82.         if (iInfector == 0) // Server ID
    83.             return
    84.        
    85.         static szVictimName[32], szAttackerName[32]
    86.         get_user_name(iVictim, szVictimName, charsmax(szVictimName))
    87.         get_user_name(iInfector, szAttackerName, charsmax(szAttackerName))
    88.         set_hudmessage(get_pcvar_num(g_pCvarInfectColors[Red]), get_pcvar_num(g_pCvarInfectColors[Green]), get_pcvar_num(g_pCvarInfectColors[Blue]), 0.05, 0.45, 1, 0.0, 6.0, 0.0, 0.0)
    89.         ShowSyncHudMsg(0, g_iInfectionMsg, "%L", LANG_PLAYER, "INFECTION_NOTICE", szAttackerName, szVictimName)
    90.     }
    91. }
    92.  
    93. public Show_Message()
    94. {
    95.     for(new id = 1; id <= g_iMaxClients; id++)
    96.     {
    97.         if (!is_user_alive(id))
    98.             continue
    99.    
    100.         // Add Point for Who is Running Fast
    101.         if(!ze_is_user_zombie(id))
    102.         {
    103.             static Float:fVelocity[3], iSpeed
    104.            
    105.             get_entvar(id, var_velocity, fVelocity)
    106.             iSpeed = floatround(vector_length(fVelocity))
    107.            
    108.             switch(iSpeed)
    109.             {
    110.                 // Starting From Lowest Weapon speed, Finishing at Highest speed (Player maybe have more than 500)
    111.                 case 210..229: g_iEscapePoints[id] += 1
    112.                 case 230..249: g_iEscapePoints[id] += 2
    113.                 case 250..300: g_iEscapePoints[id] += 3
    114.                 case 301..350: g_iEscapePoints[id] += 4
    115.                 case 351..400: g_iEscapePoints[id] += 5
    116.                 case 401..450: g_iEscapePoints[id] += 6
    117.                 case 451..500: g_iEscapePoints[id] += 7
    118.             }
    119.         }
    120.    
    121.         if (get_pcvar_num(g_pCvarLeaderGlow) != 0)
    122.         {
    123.             // Set Glow For Escape Leader
    124.             for (new i = 1; i <= g_iMaxClients; i++)
    125.             {
    126.                 if (!is_user_alive(i) || g_bStopRendering[i])
    127.                     continue
    128.            
    129.                 if (g_iEscapeRank[RANK_FIRST] == i) // The Leader id
    130.                 {
    131.                     if (get_pcvar_num(g_pCvarLeaderGlowRandom) == 0)
    132.                     {
    133.                         Set_Rendering(i, kRenderFxGlowShell, get_pcvar_num(g_pCvarLeaderGlowColors[Red]), get_pcvar_num(g_pCvarLeaderGlowColors[Green]), get_pcvar_num(g_pCvarLeaderGlowColors[Blue]), kRenderNormal, 40)
    134.                     }
    135.                     else
    136.                     {
    137.                         Set_Rendering(i, kRenderFxGlowShell, random(256), random(256), random(256), kRenderNormal, 40)
    138.                     }
    139.                    
    140.                 }
    141.                 else
    142.                 {
    143.                     Set_Rendering(i)
    144.                 }
    145.             }
    146.         }
    147.        
    148.         Show_Speed_Message(id)
    149.     }
    150. }
    151.  
    152. public Fw_PlayerSpawn_Post(id)
    153. {
    154.     g_iEscapePoints[id] = 0
    155. }
    156.  
    157. public Show_Speed_Message(id)
    158. {
    159.     if (get_pcvar_num(g_pCvarMode) == 0 || get_member_game(m_bFreezePeriod) == true) // Disabled
    160.         return
    161.    
    162.     if (get_pcvar_num(g_pCvarMode) == 1) // Leader Mode
    163.     {
    164.         Speed_Stats()
    165.         new iLeaderID; iLeaderID = g_iEscapeRank[RANK_FIRST]
    166.        
    167.         if (is_user_alive(iLeaderID) && !ze_is_user_zombie(iLeaderID) && g_iEscapePoints[iLeaderID] != 0)
    168.         {
    169.             new szLeader[32]
    170.             get_user_name(iLeaderID, szLeader, charsmax(szLeader))
    171.            
    172.             set_hudmessage(get_pcvar_num(g_pCvarRankColors[Red]), get_pcvar_num(g_pCvarRankColors[Green]), get_pcvar_num(g_pCvarRankColors[Blue]), 0.015,  0.18, 0, 0.2, 0.4, 0.09, 0.09)
    173.             ShowSyncHudMsg(id, g_iSpeedRank, "%L", LANG_PLAYER, "RANK_INFO_LEADER", szLeader)
    174.         }
    175.         else
    176.         {
    177.             set_hudmessage(get_pcvar_num(g_pCvarRankColors[Red]), get_pcvar_num(g_pCvarRankColors[Green]), get_pcvar_num(g_pCvarRankColors[Blue]), 0.015,  0.18, 0, 0.2, 0.4, 0.09, 0.09)
    178.             ShowSyncHudMsg(id, g_iSpeedRank, "%L", LANG_PLAYER, "RANK_INFO_LEADER", szNone)
    179.         }
    180.     }
    181.    
    182.     if (get_pcvar_num(g_pCvarMode) == 2) // Rank Mode
    183.     {
    184.         Speed_Stats()
    185.        
    186.         new szFirst[32], szSecond[32], szThird[32]
    187.         new iFirstID, iSecondID, iThirdID
    188.        
    189.         iFirstID = g_iEscapeRank[RANK_FIRST]
    190.         iSecondID = g_iEscapeRank[RANK_SECOND]
    191.         iThirdID = g_iEscapeRank[RANK_THIRD]
    192.        
    193.         if (is_user_alive(iFirstID) && !ze_is_user_zombie(iFirstID) && g_iEscapePoints[iFirstID] != 0)
    194.         {
    195.             get_user_name(iFirstID, szFirst, charsmax(szFirst))
    196.         }
    197.         else
    198.         {
    199.             szFirst = szNone
    200.         }
    201.        
    202.         if (is_user_alive(iSecondID) && !ze_is_user_zombie(iSecondID) && g_iEscapePoints[iSecondID] != 0)
    203.         {
    204.             get_user_name(iSecondID, szSecond, charsmax(szSecond))
    205.         }
    206.         else
    207.         {
    208.             szSecond = szNone
    209.         }
    210.        
    211.         if (is_user_alive(iThirdID) && !ze_is_user_zombie(iThirdID) && g_iEscapePoints[iThirdID] != 0)
    212.         {
    213.             get_user_name(iThirdID, szThird, charsmax(szThird))    
    214.         }
    215.         else
    216.         {
    217.             szThird = szNone
    218.         }
    219.        
    220.         set_hudmessage(get_pcvar_num(g_pCvarRankColors[Red]), get_pcvar_num(g_pCvarRankColors[Green]), get_pcvar_num(g_pCvarRankColors[Blue]), 0.015,  0.18, 0, 0.2, 0.4, 0.09, 0.09)
    221.         ShowSyncHudMsg(id, g_iSpeedRank, "%L", LANG_PLAYER, "RANK_INFO", szFirst, szSecond, szThird)
    222.     }
    223. }
    224.  
    225. public Speed_Stats()
    226. {
    227.     static iHighest, iCurrentID
    228.    
    229.     // Rank First
    230.     iHighest = 0; iCurrentID = 0
    231.    
    232.     for(new id = 1; id <= g_iMaxClients; id++)
    233.     {
    234.         if(!is_user_alive(id) || ze_is_user_zombie(id))
    235.             continue
    236.            
    237.         if(g_iEscapePoints[id] > iHighest)
    238.         {
    239.             iCurrentID = id
    240.             iHighest = g_iEscapePoints[id]
    241.         }
    242.     }
    243.    
    244.     g_iEscapeRank[RANK_FIRST] = iCurrentID
    245.    
    246.     // Rank Second
    247.     iHighest = 0; iCurrentID = 0
    248.    
    249.     for(new id = 1; id <= g_iMaxClients; id++)
    250.     {
    251.         if(!is_user_alive(id) || ze_is_user_zombie(id))
    252.             continue
    253.        
    254.         if (g_iEscapeRank[RANK_FIRST] == id)
    255.             continue
    256.            
    257.         if(g_iEscapePoints[id] > iHighest)
    258.         {
    259.             iCurrentID = id
    260.             iHighest = g_iEscapePoints[id]
    261.         }
    262.     }
    263.    
    264.     g_iEscapeRank[RANK_SECOND] = iCurrentID    
    265.    
    266.     // Rank Third
    267.     iHighest = 0; iCurrentID = 0
    268.    
    269.     for(new id = 1; id <= g_iMaxClients; id++)
    270.     {
    271.         if(!is_user_alive(id) || ze_is_user_zombie(id))
    272.             continue
    273.        
    274.         if(g_iEscapeRank[RANK_FIRST] == id || g_iEscapeRank[RANK_SECOND] == id)
    275.             continue
    276.            
    277.         if(g_iEscapePoints[id] > iHighest)
    278.         {
    279.             iCurrentID = id
    280.             iHighest = g_iEscapePoints[id]
    281.         }
    282.     }
    283.    
    284.     g_iEscapeRank[RANK_THIRD] = iCurrentID 
    285. }
    286.  
    287. public native_ze_get_escape_leader_id()
    288. {
    289.     return g_iEscapeRank[RANK_FIRST]
    290. }
    291.  
    292. public native_ze_stop_mod_rendering(id, bool:bSet)
    293. {
    294.     if (is_user_connected(id))
    295.     {
    296.         g_bStopRendering[id] = bSet
    297.         return true
    298.     }
    299.    
    300.     return false
    301. }
And the stealth code:
    1. #include <zombie_escape>
    2. #include <fun>
    3.  
    4. native ze_stop_mod_rendering(id, bool:bSet);
    5.  
    6. #define PLUGIN   "Stealth"
    7. #define VERSION  "1.0"
    8. #define AUTHOR   "Mark"
    9.  
    10. #define STEALTH  16.0
    11.  
    12. new g_iItemStealth, g_szName[32]
    13.  
    14. new const sound_stealth[] =
    15. {
    16.     "zombie_escape/blinkarrival.wav"
    17. }
    18.  
    19. public plugin_init()
    20. {
    21.       register_plugin(PLUGIN,VERSION,AUTHOR)
    22.  
    23.       g_iItemStealth = ze_register_item("Stealth \w[ \r16 sec.\w]", 60, 1)
    24. }
    25.  
    26. public plugin_precache()
    27. {
    28.       precache_sound(sound_stealth)
    29. }
    30.  
    31. public ze_select_item_pre(id, itemid)
    32. {
    33.     if (itemid != g_iItemStealth)
    34.         return ZE_ITEM_AVAILABLE
    35.    
    36.     if (!is_user_alive(id))
    37.         return ZE_ITEM_DONT_SHOW
    38.        
    39.     return ZE_ITEM_AVAILABLE
    40. }
    41.  
    42. public ze_select_item_post(id, itemid)
    43. {
    44.     if  (itemid == g_iItemStealth)
    45.     {
    46.         ze_stop_mod_rendering(id, true) // This means don't set any other rendering from ze_effects_messages.sma
    47.         Set_Rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0)
    48.         set_user_footsteps(id, 1)
    49.  
    50.         get_user_name(id, g_szName, 31)
    51.         ze_colored_print(0, "!g%s !tis now invisible!y!", g_szName)
    52.         PlaySound(id, sound_stealth)
    53.         set_task( STEALTH , "remove_stealth", id)
    54.     }
    55. }
    56.  
    57. public remove_stealth(id)
    58. {
    59.     get_user_name(id, g_szName, 31)
    60.     ze_stop_mod_rendering(id, false) // Again set the rendering from ze_effects_messages.sma
    61.     set_user_footsteps(id, 0)
    62.     ze_colored_print(0, "!g%s !tis not invisible any more!y!", g_szName)
    63.     PlaySound(id, sound_stealth)
    64. }
Screenshot:
  • stealth.png
Last edited by Raheem 5 years ago, edited 1 time in total.
Reason: Updated.
He who fails to plan is planning to fail

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#7

Post by czirimbolo » 5 years ago

I am using this: ze_leader_glow 0

So in that case do I need to change ze_effect_messages code?

Edit:

I updated this 2 plugins but still does not work
Image

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#8

Post by Raheem » 5 years ago

With default plugin and with this cvar set to zero, the plugin works?

If yes so u will not need this edit.
If no then use the edit.

Also this edit became official in github and will be avialable in next version 1.4
He who fails to plan is planning to fail

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#9

Post by czirimbolo » 5 years ago

I have error in stealth plugin with default ze_effect_messages

Load fails: Plugin uses an unknown function (name "ze_stop_mod_rendering") - check your modules.ini.
Image

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#10

Post by Raheem » 5 years ago

Use code from first post: viewtopic.php?p=8594#p8594
He who fails to plan is planning to fail

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#11

Post by czirimbolo » 5 years ago

But in the first code there is a small bug. When someone is aiming at me, he can see me. Can you fix this ?
Image

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#12

Post by Rain1153 » 5 years ago

Told ya ive tried the whole render thing which just won't work for me! Does it work for u btw?
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#13

Post by Raheem » 5 years ago

You both try this post: viewtopic.php?p=8642#p8642
He who fails to plan is planning to fail

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#14

Post by Mark » 5 years ago

Raheem wrote: 5 years ago You both try this post: viewtopic.php?p=8642#p8642
Yes does not work

When Human and in 3rd person view i don't turn invis but foot steps are silent.

When i get infected by the mod ze_user_infected and im in 3rd view i can not see myself.

Maybe something in that area is the problem

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#15

Post by Raheem » 5 years ago

You tried the new edit i did for the ze_effects_messages.sma?

It's working for me, check the photo.

Also explain what the problem you face.
He who fails to plan is planning to fail

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#16

Post by Mark » 5 years ago

Raheem wrote: 5 years ago You tried the new edit i did for the ze_effects_messages.sma?

It's working for me, check the photo.

Also explain what the problem you face.
Yes i it sometimes works even with the first code.

What i noticed is when you get infected your invis from the start.

Also if your a human you will not turn invis. Now if a plugin is blocking this i will check?

Rain1153
Senior Member
Senior Member
India
Posts: 278
Joined: 6 years ago
Contact:

#17

Post by Rain1153 » 5 years ago

Another plugin works in ze so well which makes zm/human invisible
LOL

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#18

Post by Raheem » 5 years ago

Issue from Mod is resolved by using the native i added, so try with pure Mod and you will see if it's working right or not.
He who fails to plan is planning to fail

User avatar
Mark
VIP
VIP
United States of America
Posts: 283
Joined: 5 years ago
Location: Des Moines/USA
Contact:

#19

Post by Mark » 5 years ago

Raheem wrote: 5 years ago Issue from Mod is resolved by using the native i added, so try with pure Mod and you will see if it's working right or not.
Same thing

When i join the server i can hear the sound i set to disapear aswell

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#20

Post by Raheem » 5 years ago

You guys confused me, no one tells what the problem. Everyone has problem? And i not.
He who fails to plan is planning to fail

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 5 guests