Approved Zombie classes

Gameplay Addons
User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 512
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 42 times
Age: 18
Contact:

Zombie classes

#1

Post by Jack GamePlay » 4 Months Ago

|Description:
  • This plugin allows you to zombie classes with different speed, health & gravity.

|Note:
  1. Say /zm to open zombie classes menu.
  2. Open your zombie_escape.txt & add at the end of it:

    Code: Select all

    MENU_ZCLASS = \rChoose Zombie Class \d|
    NO_ZCLASSES = !tThere aren't classes available!y.
    ZOMBIE_SELECT = Your next zombie class is going to be
    ZOMBIE_HEALTH = Health
    ZOMBIE_SPEED = Speed
    ZOMBIE_GRAVITY = Gravity

|Guide:
  • This plugin doesn't support different models for each class like ZP so if you want models use Special Models.

|Code:
  1. ze_zombie_class.sma
    1. #include <zombie_escape>
    2. #include <ze_zombie_class_const>
    3.  
    4. new const ZE_ZOMBIECLASSES_FILE[] = "ze_zombieclasses.ini"
    5.  
    6. #define ZOMBIES_DEFAULT_NAME "Zombie"
    7. #define ZOMBIES_DEFAULT_DESCRIPTION "Classic"
    8. #define ZOMBIES_DEFAULT_HEALTH 1800
    9. #define ZOMBIES_DEFAULT_SPEED 315
    10. #define ZOMBIES_DEFAULT_GRAVITY 800
    11.  
    12. const OFFSET_CSMENUCODE = 205
    13.  
    14. // For class list menu handlers
    15. #define MENU_PAGE_CLASS g_menu_data[id]
    16. new g_menu_data[33]
    17.  
    18. enum _:TOTAL_FORWARDS
    19. {
    20.     FW_SELECT_CLASS_PRE = 0,
    21.     FW_SELECT_CLASS_POST
    22. }
    23. new g_iForwards[TOTAL_FORWARDS], g_iForwardResult
    24.  
    25. new Array:g_szZombieClassRealName,
    26.     Array:g_szZombieClassName,
    27.     Array:g_szZombieClassDesc,
    28.     Array:g_iZombieClassHealth,
    29.     Array:g_iZombieClassSpeed,
    30.     Array:g_flZombieClassGravity
    31.  
    32. new g_iZombieClass[33], g_iNextZombieClass[33], g_szAdditionalMenuText[32], g_iZombieClassNumber
    33.  
    34. public plugin_natives()
    35. {
    36.     register_native("ze_get_current_zombie_class", "native_ze_get_current_zombie_class", 1)
    37.     register_native("ze_get_next_zombie_class", "native_ze_get_next_zombie_class", 1)
    38.     register_native("ze_set_next_zombie_class", "native_ze_set_next_zombie_class", 1)
    39.     register_native("ze_get_zombie_class_health", "native_ze_get_zombie_class_health", 1)
    40.     register_native("ze_register_zombie_class", "native_ze_register_zombie_class")
    41.     register_native("ze_get_zombie_class_id", "native_ze_get_zombie_class_id", 1)
    42.     register_native("ze_get_zombie_class_name", "native_ze_get_zombie_class_name")
    43.     register_native("ze_get_zombie_class_desc", "native_ze_get_zombie_class_desc")
    44.     register_native("ze_get_zombie_class_number", "native_ze_get_zombie_class_number", 1)
    45.     register_native("ze_open_zombie_classes_menu", "native_ze_open_zombie_classes_menu", 1)
    46.     register_native("ze_add_zombie_class_menu_text", "native_ze_add_zombie_class_menu_text", 1)
    47.  
    48.     g_szZombieClassRealName = ArrayCreate(32, 1)
    49.     g_szZombieClassName = ArrayCreate(32, 1)
    50.     g_szZombieClassDesc = ArrayCreate(32, 1)
    51.     g_iZombieClassHealth = ArrayCreate(1, 1)
    52.     g_iZombieClassSpeed = ArrayCreate(1, 1)
    53.     g_flZombieClassGravity = ArrayCreate(1, 1)
    54. }
    55.  
    56. public plugin_init()
    57. {
    58.     register_plugin("[ZE] Addons: Zombie Classes", "1.0", "Jack GamePlay")
    59.  
    60.     register_clcmd("say /zm", "Show_Zombie_Classes_Menu")
    61.    
    62.     g_iForwards[FW_SELECT_CLASS_PRE] = CreateMultiForward("ze_select_zombie_class_pre", ET_CONTINUE, FP_CELL, FP_CELL)
    63.     g_iForwards[FW_SELECT_CLASS_POST] = CreateMultiForward("ze_select_zombie_class_post", ET_CONTINUE, FP_CELL, FP_CELL)
    64. }
    65.  
    66. public plugin_cfg()
    67. {
    68.     if (g_iZombieClassNumber < 1)
    69.     {
    70.         ArrayPushString(g_szZombieClassRealName, ZOMBIES_DEFAULT_NAME)
    71.         ArrayPushString(g_szZombieClassName, ZOMBIES_DEFAULT_NAME)
    72.         ArrayPushString(g_szZombieClassDesc, ZOMBIES_DEFAULT_DESCRIPTION)
    73.         ArrayPushCell(g_iZombieClassHealth, ZOMBIES_DEFAULT_HEALTH)
    74.         ArrayPushCell(g_iZombieClassSpeed, ZOMBIES_DEFAULT_SPEED)
    75.         ArrayPushCell(g_flZombieClassGravity, ZOMBIES_DEFAULT_GRAVITY)
    76.         g_iZombieClassNumber++
    77.     }
    78. }
    79.  
    80. public client_putinserver(id)
    81. {
    82.     g_iZombieClass[id] = ZE_WRONG_ZOMBIE_CLASS
    83.     g_iNextZombieClass[id] = ZE_WRONG_ZOMBIE_CLASS
    84. }
    85.  
    86. public client_disconnected(id)
    87. {
    88.     MENU_PAGE_CLASS = 0
    89. }
    90.  
    91. public Show_Zombie_Classes_Menu(id)
    92. {
    93.     static szMenu[128], szClassName[32], szClassDesc[32]
    94.     new iMenuID, iItemData[2], iIndex
    95.    
    96.     formatex(szMenu, charsmax(szMenu), "%L", LANG_PLAYER, "MENU_ZCLASS")
    97.     iMenuID = menu_create(szMenu, "ZombieClassesMenuHandler")
    98.    
    99.     for (iIndex = 0; iIndex < g_iZombieClassNumber; iIndex++)
    100.     {
    101.         // Additional text to display
    102.         g_szAdditionalMenuText[0] = 0
    103.        
    104.         // Execute class select attempt forward
    105.         ExecuteForward(g_iForwards[FW_SELECT_CLASS_PRE], g_iForwardResult, id, iIndex)
    106.        
    107.         // Show class to player?
    108.         if (g_iForwardResult >= ZE_CLASS_DONT_SHOW)
    109.             continue
    110.        
    111.         ArrayGetString(g_szZombieClassName, iIndex, szClassName, charsmax(szClassName))
    112.         ArrayGetString(g_szZombieClassDesc, iIndex, szClassDesc, charsmax(szClassDesc))
    113.        
    114.         // Class available to player?
    115.         if (g_iForwardResult >= ZE_CLASS_UNAVAILABLE)
    116.             formatex(szMenu, charsmax(szMenu), "\d%s | %s | %s", szClassName, szClassDesc, g_szAdditionalMenuText)
    117.         // Class is current class?
    118.         else if (iIndex == g_iNextZombieClass[id])
    119.             formatex(szMenu, charsmax(szMenu), "\w%s \d| \y%s \d[\yCurrent\d] \r%s", szClassName, szClassDesc, g_szAdditionalMenuText)
    120.         else
    121.             formatex(szMenu, charsmax(szMenu), "\y%s \d| \w%s \r%s", szClassName, szClassDesc, g_szAdditionalMenuText)
    122.        
    123.         iItemData[0] = iIndex
    124.         iItemData[1] = 0
    125.         menu_additem(iMenuID, szMenu, iItemData)
    126.     }
    127.    
    128.     // No classes to display?
    129.     if (menu_items(iMenuID) <= 0)
    130.     {
    131.         ze_colored_print(id, "%L", LANG_PLAYER, "NO_ZCLASSES")
    132.         menu_destroy(iMenuID)
    133.         return
    134.     }
    135.    
    136.     // Back - Next - Exit
    137.     formatex(szMenu, charsmax(szMenu), "%L", LANG_PLAYER, "BACK")
    138.     menu_setprop(iMenuID, MPROP_BACKNAME, szMenu)
    139.     formatex(szMenu, charsmax(szMenu), "%L", LANG_PLAYER, "NEXT")
    140.     menu_setprop(iMenuID, MPROP_NEXTNAME, szMenu)
    141.     formatex(szMenu, charsmax(szMenu), "%L", LANG_PLAYER, "EXIT")
    142.     menu_setprop(iMenuID, MPROP_EXITNAME, szMenu)
    143.    
    144.     MENU_PAGE_CLASS = min(MENU_PAGE_CLASS, menu_pages(iMenuID) - 1)
    145.    
    146.     set_pdata_int(id, OFFSET_CSMENUCODE, 0)
    147.     menu_display(id, iMenuID, MENU_PAGE_CLASS)
    148. }
    149.  
    150. public ZombieClassesMenuHandler(id, iMenuID, iItemID)
    151. {
    152.     // Menu was closed
    153.     if (iItemID == MENU_EXIT)
    154.     {
    155.         MENU_PAGE_CLASS = 0
    156.         menu_destroy(iMenuID)
    157.         return PLUGIN_HANDLED
    158.     }
    159.    
    160.     // Remember class menu page
    161.     MENU_PAGE_CLASS = iItemID / 7
    162.    
    163.     // Retrieve class index
    164.     new iItemData[2], iDummy, iIndex
    165.     menu_item_getinfo(iMenuID, iItemID, iDummy, iItemData, charsmax(iItemData), _, _, iDummy)
    166.     iIndex = iItemData[0]
    167.    
    168.     // Execute class select attempt forward
    169.     ExecuteForward(g_iForwards[FW_SELECT_CLASS_PRE], g_iForwardResult, id, iIndex)
    170.    
    171.     // Class available to player?
    172.     if (g_iForwardResult >= ZE_CLASS_UNAVAILABLE)
    173.     {
    174.         menu_destroy(iMenuID)
    175.         return PLUGIN_HANDLED
    176.     }
    177.    
    178.     // Make selected class next class for player
    179.     g_iNextZombieClass[id] = iIndex
    180.    
    181.     new szClassName[32]
    182.     ArrayGetString(g_szZombieClassName, g_iNextZombieClass[id], szClassName, charsmax(szClassName))
    183.    
    184.     ze_colored_print(id, "!t%L!y: !g%s", LANG_PLAYER, "ZOMBIE_SELECT", szClassName)
    185.     ze_colored_print(id, "!t%L!y: !g%i !y- !t%L!y: !g%i !y- !t%L!y: !g%i", LANG_PLAYER, "ZOMBIE_HEALTH", ArrayGetCell(g_iZombieClassHealth, g_iNextZombieClass[id]), LANG_PLAYER, "ZOMBIE_SPEED", ArrayGetCell(g_iZombieClassSpeed, g_iNextZombieClass[id]), LANG_PLAYER, "ZOMBIE_GRAVITY", ArrayGetCell(g_flZombieClassGravity, g_iNextZombieClass[id]))
    186.    
    187.     // Execute class select post forward
    188.     ExecuteForward(g_iForwards[FW_SELECT_CLASS_POST], g_iForwardResult, id, iIndex)
    189.    
    190.     menu_destroy(iMenuID)
    191.     return PLUGIN_HANDLED
    192. }
    193.  
    194. public ze_user_infected(id)
    195. {
    196.     // Show zombie class menu if they haven't chosen any (e.g. just connected)
    197.     if (g_iNextZombieClass[id] == ZE_WRONG_ZOMBIE_CLASS)
    198.     {
    199.         if (g_iZombieClassNumber > 1)
    200.             Show_Zombie_Classes_Menu(id)
    201.         else // If only one class is registered, choose it automatically
    202.             g_iNextZombieClass[id] = 0
    203.     }
    204.    
    205.     // Bots pick class automatically
    206.     if (is_user_bot(id))
    207.     {
    208.         // Try choosing class
    209.         new iIndex, iStart_Index = random_num(0, g_iZombieClassNumber - 1)
    210.         for (iIndex = iStart_Index + 1; /* no condition */; iIndex++)
    211.         {
    212.             // Start over when we reach the end
    213.             if (iIndex >= g_iZombieClassNumber)
    214.                 iIndex = 0
    215.            
    216.             // Execute class select attempt forward
    217.             ExecuteForward(g_iForwards[FW_SELECT_CLASS_PRE], g_iForwardResult, id, iIndex)
    218.            
    219.             // Class available to player?
    220.             if (g_iForwardResult < ZE_CLASS_UNAVAILABLE)
    221.             {
    222.                 g_iNextZombieClass[id] = iIndex
    223.                 break
    224.             }
    225.            
    226.             // Loop completed, no class could be chosen
    227.             if (iIndex == iStart_Index)
    228.                 break
    229.         }
    230.     }
    231.    
    232.     // Set selected zombie class. If none selected yet, use the first one
    233.     g_iZombieClass[id] = g_iNextZombieClass[id]
    234.     if (g_iZombieClass[id] == ZE_WRONG_ZOMBIE_CLASS)
    235.             g_iZombieClass[id] = 0
    236.    
    237.     // Apply zombie attributes
    238.     set_entvar(id, var_health, float(ArrayGetCell(g_iZombieClassHealth, g_iZombieClass[id])))
    239.     set_entvar(id, var_gravity, float(ArrayGetCell(g_flZombieClassGravity, g_iZombieClass[id])) / 800)
    240.     ze_set_zombie_speed(id, ArrayGetCell(g_iZombieClassSpeed, g_iZombieClass[id]))
    241. }
    242.  
    243. public native_ze_get_current_zombie_class(id)
    244. {
    245.     if (!is_user_connected(id))
    246.     {
    247.         log_error(AMX_ERR_NATIVE, "[ZE] Invalid Player (%d)", id)
    248.         return ZE_WRONG_ZOMBIE_CLASS
    249.     }
    250.    
    251.     return g_iZombieClass[id]
    252. }
    253.  
    254. public native_ze_get_next_zombie_class(id)
    255. {
    256.     if (!is_user_connected(id))
    257.     {
    258.         log_error(AMX_ERR_NATIVE, "[ZE] Invalid Player (%d)", id)
    259.         return ZE_WRONG_ZOMBIE_CLASS
    260.     }
    261.    
    262.     return g_iNextZombieClass[id]
    263. }
    264.  
    265. public native_ze_set_next_zombie_class(id, iClassID)
    266. {
    267.     if (!is_user_connected(id))
    268.     {
    269.         log_error(AMX_ERR_NATIVE, "[ZE] Invalid Player (%d)", id)
    270.         return false
    271.     }
    272.    
    273.     if (0 > iClassID >= g_iZombieClassNumber)
    274.     {
    275.         log_error(AMX_ERR_NATIVE, "[ZE] Invalid zombie class id (%d)", iClassID)
    276.         return false
    277.     }
    278.    
    279.     g_iNextZombieClass[id] = iClassID
    280.     return true
    281. }
    282.  
    283. public native_ze_get_zombie_class_health(id, iClassID)
    284. {
    285.     if (!is_user_connected(id))
    286.     {
    287.         log_error(AMX_ERR_NATIVE, "[ZE] Invalid Player (%d)", id)
    288.         return -1
    289.     }
    290.    
    291.     if (0 > iClassID >= g_iZombieClassNumber)
    292.     {
    293.         log_error(AMX_ERR_NATIVE, "[ZE] Invalid zombie class id (%d)", iClassID)
    294.         return -1
    295.     }
    296.    
    297.     return ArrayGetCell(g_iZombieClassHealth, iClassID)
    298. }
    299.  
    300. public native_ze_register_zombie_class(plugin_id, num_params)
    301. {
    302.     new szName[32]
    303.     get_string(1, szName, charsmax(szName))
    304.    
    305.     if (strlen(szName) < 1)
    306.     {
    307.         log_error(AMX_ERR_NATIVE, "[ZE] Can't register zombie class with an empty name")
    308.         return ZE_WRONG_ZOMBIE_CLASS
    309.     }
    310.    
    311.     new iIndex, szZombieClassName[32]
    312.     for (iIndex = 0; iIndex < g_iZombieClassNumber; iIndex++)
    313.     {
    314.         ArrayGetString(g_szZombieClassRealName, iIndex, szZombieClassName, charsmax(szZombieClassName))
    315.         if (equali(szName, szZombieClassName))
    316.         {
    317.             log_error(AMX_ERR_NATIVE, "[ZE] Zombie class already registered (%s)", szName)
    318.             return ZE_WRONG_ZOMBIE_CLASS
    319.         }
    320.     }
    321.    
    322.     new szDesc[32]
    323.     get_string(2, szDesc, charsmax(szDesc))
    324.     new iHealth = get_param(3)
    325.     new iSpeed = get_param(4)
    326.     new flGravity = get_param(5)
    327.  
    328.     // Load settings from zombie classes file
    329.     new szRealName[32]
    330.     copy(szRealName, charsmax(szRealName), szName)
    331.     ArrayPushString(g_szZombieClassRealName, szRealName)
    332.  
    333.     // Name
    334.     if (!amx_load_setting_string(ZE_ZOMBIECLASSES_FILE, szRealName, "NAME", szName, charsmax(szName)))
    335.         amx_save_setting_string(ZE_ZOMBIECLASSES_FILE, szRealName, "NAME", szName)
    336.     ArrayPushString(g_szZombieClassName, szName)
    337.    
    338.     // Description
    339.     if (!amx_load_setting_string(ZE_ZOMBIECLASSES_FILE, szRealName, "INFO", szDesc, charsmax(szDesc)))
    340.         amx_save_setting_string(ZE_ZOMBIECLASSES_FILE, szRealName, "INFO", szDesc)
    341.     ArrayPushString(g_szZombieClassDesc, szDesc)
    342.    
    343.     // Health
    344.     if (!amx_load_setting_int(ZE_ZOMBIECLASSES_FILE, szRealName, "HEALTH", iHealth))
    345.         amx_save_setting_int(ZE_ZOMBIECLASSES_FILE, szRealName, "HEALTH", iHealth)
    346.     ArrayPushCell(g_iZombieClassHealth, iHealth)
    347.    
    348.     // Speed
    349.     if (!amx_load_setting_int(ZE_ZOMBIECLASSES_FILE, szRealName, "SPEED", iSpeed))
    350.         amx_save_setting_int(ZE_ZOMBIECLASSES_FILE, szRealName, "SPEED", iSpeed)
    351.     ArrayPushCell(g_iZombieClassSpeed, iSpeed)
    352.    
    353.     // Gravity
    354.     if (!amx_load_setting_int(ZE_ZOMBIECLASSES_FILE, szRealName, "GRAVITY", flGravity))
    355.         amx_load_setting_int(ZE_ZOMBIECLASSES_FILE, szRealName, "GRAVITY", flGravity)
    356.     ArrayPushCell(g_flZombieClassGravity, flGravity)
    357.    
    358.     g_iZombieClassNumber++
    359.     return g_iZombieClassNumber - 1
    360. }
    361.  
    362. public native_ze_get_zombie_class_id(const szName[])
    363. {
    364.     new iIndex, szZombieClassName[32]
    365.     for (iIndex = 0; iIndex < g_iZombieClassNumber; iIndex++)
    366.     {
    367.         ArrayGetString(g_szZombieClassRealName, iIndex, szZombieClassName, charsmax(szZombieClassName))
    368.         if (equali(szName, szZombieClassName))
    369.             return iIndex
    370.     }
    371.    
    372.     return ZE_WRONG_ZOMBIE_CLASS
    373. }
    374.  
    375. public native_ze_get_zombie_class_name(plugin_id, num_params)
    376. {
    377.     new iClassID = get_param(1)
    378.    
    379.     if (0 > iClassID >= g_iZombieClassNumber)
    380.     {
    381.         log_error(AMX_ERR_NATIVE, "[ZE] Invalid zombie class id (%d)", iClassID)
    382.         return false
    383.     }
    384.    
    385.     new szName[32]
    386.     ArrayGetString(g_szZombieClassName, iClassID, szName, charsmax(szName))
    387.    
    388.     new iLen = get_param(3)
    389.     set_string(2, szName, iLen)
    390.     return true
    391. }
    392.  
    393. public native_ze_get_zombie_class_desc(plugin_id, num_params)
    394. {
    395.     new iClassID = get_param(1)
    396.    
    397.     if (0 > iClassID >= g_iZombieClassNumber)
    398.     {
    399.         log_error(AMX_ERR_NATIVE, "[ZE] Invalid zombie class id (%d)", iClassID)
    400.         return false
    401.     }
    402.    
    403.     new szDesc[32]
    404.     ArrayGetString(g_szZombieClassDesc, iClassID, szDesc, charsmax(szDesc))
    405.    
    406.     new iLen = get_param(3)
    407.     set_string(2, szDesc, iLen)
    408.     return true
    409. }
    410.  
    411. public native_ze_get_zombie_class_number()
    412. {
    413.     return g_iZombieClassNumber
    414. }
    415.  
    416. public native_ze_open_zombie_classes_menu(id)
    417. {
    418.     if (!is_user_connected(id))
    419.     {
    420.         log_error(AMX_ERR_NATIVE, "[ZE] Invalid Player (%d)", id)
    421.         return false
    422.     }
    423.    
    424.     Show_Zombie_Classes_Menu(id)
    425.     return true
    426. }
    427.  
    428. public native_ze_add_zombie_class_menu_text(const text[])
    429. {
    430.     format(g_szAdditionalMenuText, charsmax(g_szAdditionalMenuText), "%s%s", g_szAdditionalMenuText, text)
    431. }
  2. ze_zombie_class.inc
    1. #include <ze_zombie_class_const>
    2.  
    3. /*****************************************/
    4. /************   FORWARDS    **************/
    5. /*****************************************/
    6.  
    7. /**
    8.  * Called when determining whether a class should be available to a player.
    9.  *
    10.  * Possible return values are:
    11.  *  - ZE_CLASS_AVAILABLE (show in menu, allow selection)
    12.  *  - ZE_CLASS_UNAVAILABLE (show in menu, don't allow selection)
    13.  *  - ZE_CLASS_DONT_SHOW (don't show in menu, don't allow selection)
    14.  *
    15.  * @param id            Player index.
    16.  * @param classid       Internal zombie class ID.
    17.  */
    18. forward ze_select_zombie_class_pre(id, classid)
    19.  
    20. /**
    21.  * Called right after a player selects a class from the menu.
    22.  *
    23.  * @param id            Player index.
    24.  * @param classid       Internal zombie class ID.
    25.  */
    26. forward ze_select_zombie_class_post(id, classid)
    27.  
    28. /*****************************************/
    29. /************** NATIVES ******************/
    30. /*****************************************/
    31.  
    32. /**
    33.  * Returns a player's current zombie class ID.
    34.  *
    35.  * @param id        Player index.
    36.  * @return          Internal zombie class ID, or ZE_WRONG_ZOMBIE_CLASS if not yet chosen.
    37.  */
    38. native ze_get_current_zombie_class(id)
    39.  
    40. /**
    41.  * Returns a player's next zombie class ID (for the next infection).
    42.  *
    43.  * @param id        Player index.
    44.  * @return          Internal zombie class ID, or ZE_WRONG_ZOMBIE_CLASS if not yet chosen.
    45.  */
    46. native ze_get_next_zombie_class(id)
    47.  
    48. /**
    49.  * Sets a player's next zombie class ID (for the next infection).
    50.  *
    51.  * @param id        Player index.
    52.  * @param classid   A valid zombie class ID.
    53.  * @return          True on success, false otherwise.
    54.  */
    55. native ze_set_next_zombie_class(id, classid)
    56.  
    57. /**
    58.  * Returns the default maximum health for a specific zombie class.
    59.  *
    60.  * Note: does not take into account any kind of HP multipliers.
    61.  *
    62.  * @param id        Player index.
    63.  * @param classid   A valid zombie class ID.
    64.  * @return          Maximum amount of health points, -1 on error.
    65.  */
    66. native ze_get_zombie_class_health(id, classid)
    67.  
    68. /**
    69.  * Registers a custom class which will be added to the zombie classes menu of ZP.
    70.  *
    71.  * Note: The returned zombie class ID can be later used to identify
    72.  * the class when calling the zp_get_user_zombie_class() natives.
    73.  *
    74.  * @param name          Caption to display on the menu.
    75.  * @param description   Brief description of the class.
    76.  * @param health        Class health.
    77.  * @param speed         Class maxspeed (can be a multiplier).
    78.  * @param gravity       Class gravity multiplier.
    79.  * @return              An internal zombie class ID, or ZE_WRONG_ZOMBIE_CLASS on failure.
    80.  */
    81. native ze_register_zombie_class(const name[], const description[], health, speed, gravity)
    82.  
    83. /**
    84.  * Returns a zombie class' ID.
    85.  *
    86.  * @param name      Class name to look for.
    87.  * @return          Internal zombie class ID, or ZE_WRONG_ZOMBIE_CLASS if not found.
    88.  */
    89. native ze_get_zombie_class_id(const real_name[])
    90.  
    91. /**
    92.  * Returns a zombie class' name.
    93.  *
    94.  * @param classid   A valid zombie class ID.
    95.  * @param name      The buffer to store the string in.
    96.  * @param len       Character size of the output buffer.
    97.  * @return          True on success, false otherwise.
    98.  */
    99. native ze_get_zombie_class_name(classid, name[], len)
    100.  
    101. /**
    102.  * Returns a zombie class' description.
    103.  *
    104.  * @param classid       A valid zombie class ID.
    105.  * @param description   The buffer to store the string in.
    106.  * @param len           Character size of the output buffer.
    107.  * @return              True on success, false otherwise.
    108.  */
    109. native ze_get_zombie_class_desc(classid, description[], len)
    110.  
    111. /**
    112.  * Returns number of registered zombie classes.
    113.  *
    114.  * @return          Zombie class count.
    115.  */
    116. native ze_get_zombie_class_number()
    117.  
    118. /**
    119.  * Shows menu with available zombie classes to a player.
    120.  *
    121.  * @param id        Player index.
    122.  */
    123. native ze_open_zombie_classes_menu(id)
    124.  
    125. /**
    126.  * Appends text to a class being displayed on the zombie classes menu.
    127.  * Use this on the class select pre forward.
    128.  *
    129.  * @param text      Additional text to display.
    130.  */
    131. native ze_add_zombie_class_menu_text(const text[])
  3. ze_zombie_class_const.inc
    1. /* Zombie Class ID constants */
    2. #define ZE_WRONG_ZOMBIE_CLASS -1
    3.  
    4. /* Class selection constants */
    5. #define ZE_CLASS_AVAILABLE 0
    6. #define ZE_CLASS_UNAVAILABLE 1
    7. #define ZE_CLASS_DONT_SHOW 2
These users thanked the author Jack GamePlay for the post (total 2):
Raheem (4 Months Ago) • shady101852 (2 Months Ago)
Image

Rain1153
Senior Member
Senior Member
India
Posts: 270
Joined: 11 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 18
Contact:

#2

Post by Rain1153 » 4 Months Ago

So u mean the classes are limited only to speed,gravity and health....what if we want to install custom classes
LOL

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 512
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 42 times
Age: 18
Contact:

#3

Post by Jack GamePlay » 4 Months Ago

Rain1153 wrote:
4 Months Ago
So u mean the classes are limited only to speed,gravity and health....what if we want to install custom classes
You can use ZP classes by converting them. It's the same as ZP but no models or claw models as they are available in special models as i said.
Image

Rain1153
Senior Member
Senior Member
India
Posts: 270
Joined: 11 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 18
Contact:

#4

Post by Rain1153 » 4 Months Ago

and why is there no zombie classes.ini?
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 270
Joined: 11 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 18
Contact:

#5

Post by Rain1153 » 4 Months Ago

i wanted to add custom classes by changing the values of speed gravity and stuff but i cant becz there is no classes.ini file
LOL

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 512
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 42 times
Age: 18
Contact:

#6

Post by Jack GamePlay » 4 Months Ago

Rain1153 wrote:
4 Months Ago
and why is there no zombie classes.ini?
There is but it's automatically added.
Image

Rain1153
Senior Member
Senior Member
India
Posts: 270
Joined: 11 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 18
Contact:

#7

Post by Rain1153 » 4 Months Ago

It didnt add in the server config folder
LOL

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 512
Joined: 1 Year Ago
Location: Egypt
Has thanked: 31 times
Been thanked: 42 times
Age: 18
Contact:

#8

Post by Jack GamePlay » 4 Months Ago

Rain1153 wrote:
4 Months Ago
It didnt add in the server config folder
It will be added once you add zombie classes.
Image

Rain1153
Senior Member
Senior Member
India
Posts: 270
Joined: 11 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 18
Contact:

#9

Post by Rain1153 » 4 Months Ago

but it didn't come :/
LOL

Rain1153
Senior Member
Senior Member
India
Posts: 270
Joined: 11 Months Ago
Has thanked: 2 times
Been thanked: 1 time
Age: 18
Contact:

#10

Post by Rain1153 » 4 Months Ago

please find a way to add other zm classes
LOL

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest