Solved VIP skin models modified and problem..

Coding Help/Re-API Supported
Post Reply
neverminddw
Member
Member
Posts: 32
Joined: 6 years ago
Contact:

VIP skin models modified and problem..

#1

Post by neverminddw » 5 years ago

Where have I messed up here? (not compiling).

Code: Select all

#include <zombie_escape>
#include <ze_vip>

// Setting File
new const ZE_SETTING_RESOURCES[] = "zombie_escape.ini"

// Defines
#define MODEL_MAX_LENGTH 64
#define PLAYERMODEL_MAX_LENGTH 32
#define ACCESS_MAX_LENGTH 32

// Default Models
new const szAdminHumanModel[][] = 
{
	"vip_human"
}

new const szAdminZombieModel[][] = 
{
	"vip_zombie"
}

new const szVipHumanModel[][] =
{
	"vip_human2"
}

new const v_szAdminHumanKnifeModel[][] = 
{
	"models/zombie_escape/v_knife_vip.mdl"
}

new const v_szAdminZombieKnifeModel[][] = 
{
	"models/zombie_escape/v_knife_zombie.mdl"
}

// Dynamic Arrays: Models
new Array:g_szAdminHumanModel, Array:g_szAdminZombieModel, Array: g_szVipHumanModel, Array:g_v_szAdminHumanKnifeModel, Array:g_v_szAdminZombieKnifeModel

public plugin_init()
{
	register_plugin("[ZE] Vip Model", ZE_VERSION, AUTHORS)
}

public plugin_precache()
{
	// Initialize Arrays
	g_szAdminHumanModel = ArrayCreate(PLAYERMODEL_MAX_LENGTH, 1)
	g_szAdminZombieModel = ArrayCreate(PLAYERMODEL_MAX_LENGTH, 1)
	g_szVipHumanModel = ArrayCreate(PLAYERMODEL_MAX_LENGTH, 1)
	g_v_szAdminHumanKnifeModel = ArrayCreate(MODEL_MAX_LENGTH, 1) // Enable to set knife model human vip
	g_v_szAdminZombieKnifeModel = ArrayCreate(MODEL_MAX_LENGTH, 1) // Enable to set knife model zombies vip
	
	// Load From External File
	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "ASSASSIN VIP", g_szAdminHumanModel)
	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "ZOMBIE VIP", g_szAdminZombieModel)
	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "SUBZERO_VIP", g_szVipHumanModel)
	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE HUMAN VIP", g_v_szAdminHumanKnifeModel)
	amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE ZOMBIE VIP", g_v_szAdminZombieKnifeModel)
	
	// Load our Default Values
	new iIndex
	
	if(ArraySize(g_szAdminHumanModel) == 0)
	{
		for(iIndex = 0; iIndex < sizeof szAdminHumanModel; iIndex++)
			ArrayPushString(g_szAdminHumanModel, szAdminHumanModel[iIndex])
		
		// Save to external file
		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "ASSASSIN VIP", g_szAdminHumanModel)
	}
	
	if(ArraySize(g_szAdminZombieModel) == 0)
	{
		for(iIndex = 0; iIndex < sizeof szAdminZombieModel; iIndex++)
			ArrayPushString(g_szAdminZombieModel, szAdminZombieModel[iIndex])
		
		// Save to external file
		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "ZOMBIE VIP", g_szAdminZombieModel)
	}
	
	if(ArraySize(g_szVipHumanModel) == 0) // MINE I CREATED
	{
		for(iIndex = 0; iIndex < sizeof szVipHumanModel; iIndex++)
			ArrayPushString(g_szVipHumanModel, szAdminZombieModel[iIndex])
			
		// Save to external file
		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "SUBZERO VIP", g_szVipHumanModel)
	}
	
	if(ArraySize(g_v_szAdminHumanKnifeModel) == 1) // AND MAYBE THIS TO CHANGE TO 0
	{
		for(iIndex = 0; iIndex < sizeof v_szAdminHumanKnifeModel; iIndex++)
			ArrayPushString(g_v_szAdminHumanKnifeModel, v_szAdminHumanKnifeModel[iIndex])
		
		// Save to external file
		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE HUMAN VIP", g_v_szAdminHumanKnifeModel)
	}
	
	if(ArraySize(g_v_szAdminZombieKnifeModel) == 0)
	{
		for(iIndex = 0; iIndex < sizeof v_szAdminZombieKnifeModel; iIndex++)
			ArrayPushString(g_v_szAdminZombieKnifeModel, v_szAdminZombieKnifeModel[iIndex])
		
		// Save to external file
		amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE ZOMBIE VIP", g_v_szAdminZombieKnifeModel)
	}
	
	// Precache
	new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH], szModelPath[128]
	
	for (iIndex = 0; iIndex < ArraySize(g_szAdminHumanModel); iIndex++)
	{
		ArrayGetString(g_szAdminHumanModel, iIndex, szPlayerModel, charsmax(szPlayerModel))
		formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szPlayerModel, szPlayerModel)
		precache_model(szModelPath)
	}
	
	for (iIndex = 0; iIndex < ArraySize(g_szAdminZombieModel); iIndex++)
	{
		ArrayGetString(g_szAdminZombieModel, iIndex, szPlayerModel, charsmax(szPlayerModel))
		formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szPlayerModel, szPlayerModel)
		precache_model(szModelPath)
	}
	
	for (iIndex = 0; iIndex < ArraySize(g_szVipHumanModel); iIndex++)
	{
		ArrayGetString(g_szVipHumanModel, iIndex, szPlayerModel, charsmax(szPlayerModel))
		formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szPlayerModel, szPlayerModel)
		precache_model(szModelPath)
	}
	
	
	for (iIndex = 0; iIndex < ArraySize(g_v_szAdminHumanKnifeModel); iIndex++)
	{
		ArrayGetString(g_v_szAdminHumanKnifeModel, iIndex, szModel, charsmax(szModel))
		precache_model(szModel)
	}
	
	for (iIndex = 0; iIndex < ArraySize(g_v_szAdminZombieKnifeModel); iIndex++)
	{
		ArrayGetString(g_v_szAdminZombieKnifeModel, iIndex, szModel, charsmax(szModel))
		precache_model(szModel)
	}
}

public ze_user_humanized(id)
{
	if(ze_is_user_zombie(id) || !is_user_alive(id))
		return
		
	new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH]

	// Player Admin?
	if (ze_get_vip_flags(id) & VIP_F) // F flag for vip model 1
	{
		// Set Admin Human Model
		ArrayGetString(g_szAdminHumanModel, random_num(0, ArraySize(g_szAdminHumanModel) - 1), szPlayerModel, charsmax(szPlayerModel))
		rg_set_user_model(id, szPlayerModel)
		
		// Set Admin Human Knife Model
		ArrayGetString(g_v_szAdminHumanKnifeModel, random_num(0, ArraySize(g_v_szAdminHumanKnifeModel) - 0), szModel, charsmax(szModel))
		cs_set_player_view_model(id, CSW_KNIFE, szModel)
	}
	else {
		if (ze_get_vip_flags(id) & VIP_G) // G flag for vip model 2
	{
		// Set Admin Human Model
		ArrayGetString(g_szVipHumanModel, random_num(0, ArraySize(g_szVipHumanModel) - 1), szPlayerModel, charsmax(szPlayerModel))
		rg_set_user_model(id, szPlayerModel)
		
		// Set Admin Human Knife Model
		ArrayGetString(g_v_szAdminHumanKnifeModel, random_num(0, ArraySize(g_v_szAdminHumanKnifeModel) - 0), szModel, charsmax(szModel))
		cs_set_player_view_model(id, CSW_KNIFE, szModel)
	}
}

public ze_user_infected(iVictim, iInfector)
{
	if(!is_user_alive(iVictim))
		return
		
	// Set Zombie Models
	new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH]
	
	// Player Admin?
	if (ze_get_vip_flags(iVictim) & VIP_F & VIP_G)
	{
		// Set Zombie Admin Model
		ArrayGetString(g_szAdminZombieModel, random_num(0, ArraySize(g_szAdminZombieModel) - 1), szPlayerModel, charsmax(szPlayerModel))
		rg_set_user_model(iVictim, szPlayerModel)
		
		// Set Admin Zombie Knife Model
		ArrayGetString(g_v_szAdminZombieKnifeModel, random_num(0, ArraySize(g_v_szAdminZombieKnifeModel) - 1), szModel, charsmax(szModel))
		cs_set_player_view_model(iVictim, CSW_KNIFE, szModel)
		cs_set_player_weap_model(iVictim, CSW_KNIFE, "") // Leave Blank so knife not appear with zombies
	}
}
And here

Code: Select all

if (ze_get_vip_flags(iVictim) & VIP_F & VIP_G)
I wanted the function to be "if ze_get_vip_flags(iVictim) & VIP_F (or) VIP_G (both flags will work) to set zombie vip model. So if user has VIP_F will get "vip_zombie" model when zombie. Or if user has VIP_G will get "vip_zombie" when zombie.

Is it right?

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

#2

Post by Raheem » 5 years ago

  1. if ((ze_get_vip_flags(iVictim) & VIP_F) || (ze_get_vip_flags(iVictim) & VIP_G))

This means if iVictim has VIP_F or has VIP_G. The or symbol is represented by: ||
He who fails to plan is planning to fail

neverminddw
Member
Member
Posts: 32
Joined: 6 years ago
Contact:

#3

Post by neverminddw » 5 years ago

Tho I precached the model, have no idea where I did the mistake.

Warning: Symbol is never used: "szVipHumanModel" on line 26
Header size: 1028 bytes
Code size: 5880 bytes
Data size: 2620 bytes
Stack/heap size: 16384 bytes
Total requirements: 25912 bytes

1 Warning.
Done.
  1. #include <zombie_escape>
  2. #include <ze_vip>
  3.  
  4. // Setting File
  5. new const ZE_SETTING_RESOURCES[] = "zombie_escape.ini"
  6.  
  7. // Defines
  8. #define MODEL_MAX_LENGTH 64
  9. #define PLAYERMODEL_MAX_LENGTH 32
  10. #define ACCESS_MAX_LENGTH 32
  11.  
  12. // Default Models
  13. new const szAdminHumanModel[][] =
  14. {
  15.     "vip_human"
  16. }
  17.  
  18. new const szAdminZombieModel[][] =
  19. {
  20.     "vip_zombie"
  21. }
  22.  
  23. new const szVipHumanModel[][] =
  24. {
  25.     "vip_human2"
  26. }
  27.  
  28. new const v_szAdminHumanKnifeModel[][] =
  29. {
  30.     "models/zombie_escape/v_knife_vip.mdl"
  31. }
  32.  
  33. new const v_szAdminZombieKnifeModel[][] =
  34. {
  35.     "models/zombie_escape/v_knife_zombie.mdl"
  36. }
  37.  
  38. // Dynamic Arrays: Models
  39. new Array:g_szAdminHumanModel, Array:g_szAdminZombieModel, Array:g_szVipHumanModel, Array:g_v_szAdminHumanKnifeModel, Array:g_v_szAdminZombieKnifeModel
  40.  
  41. public plugin_init()
  42. {
  43.     register_plugin("[ZE] Vip Model", ZE_VERSION, AUTHORS)
  44. }
  45.  
  46. public plugin_precache()
  47. {
  48.     // Initialize Arrays
  49.     g_szAdminHumanModel = ArrayCreate(PLAYERMODEL_MAX_LENGTH, 1)
  50.     g_szAdminZombieModel = ArrayCreate(PLAYERMODEL_MAX_LENGTH, 1)
  51.     g_szVipHumanModel = ArrayCreate(PLAYERMODEL_MAX_LENGTH, 1)
  52.     g_v_szAdminHumanKnifeModel = ArrayCreate(MODEL_MAX_LENGTH, 1) // Enable to set knife model human vip
  53.     g_v_szAdminZombieKnifeModel = ArrayCreate(MODEL_MAX_LENGTH, 1) // Enable to set knife model zombies vip
  54.    
  55.     // Load From External File
  56.     amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "ASSASSIN VIP", g_szAdminHumanModel)
  57.     amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "ZOMBIE VIP", g_szAdminZombieModel)
  58.     amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "SUBZERO VIP", g_szVipHumanModel)
  59.     amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE HUMAN VIP", g_v_szAdminHumanKnifeModel)
  60.     amx_load_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE ZOMBIE VIP", g_v_szAdminZombieKnifeModel)
  61.    
  62.     // Load our Default Values
  63.     new iIndex
  64.    
  65.     if(ArraySize(g_szAdminHumanModel) == 0)
  66.     {
  67.         for(iIndex = 0; iIndex < sizeof szAdminHumanModel; iIndex++)
  68.             ArrayPushString(g_szAdminHumanModel, szAdminHumanModel[iIndex])
  69.        
  70.         // Save to external file
  71.         amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "ASSASSIN VIP", g_szAdminHumanModel)
  72.     }
  73.    
  74.     if(ArraySize(g_szAdminZombieModel) == 0)
  75.     {
  76.         for(iIndex = 0; iIndex < sizeof szAdminZombieModel; iIndex++)
  77.             ArrayPushString(g_szAdminZombieModel, szAdminZombieModel[iIndex])
  78.        
  79.         // Save to external file
  80.         amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "ZOMBIE VIP", g_szAdminZombieModel)
  81.     }
  82.    
  83.     if(ArraySize(g_szVipHumanModel) == 0) // MINE I ADDED
  84.     {
  85.         for(iIndex = 0; iIndex < sizeof szVipHumanModel; iIndex++)
  86.             ArrayPushString(g_szVipHumanModel, szAdminZombieModel[iIndex])
  87.            
  88.         // Save to external file
  89.         amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "SUBZERO VIP", g_szVipHumanModel)
  90.     }
  91.    
  92.     if(ArraySize(g_v_szAdminHumanKnifeModel) == 0)
  93.     {
  94.         for(iIndex = 0; iIndex < sizeof v_szAdminHumanKnifeModel; iIndex++)
  95.             ArrayPushString(g_v_szAdminHumanKnifeModel, v_szAdminHumanKnifeModel[iIndex])
  96.        
  97.         // Save to external file
  98.         amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE HUMAN VIP", g_v_szAdminHumanKnifeModel)
  99.     }
  100.    
  101.     if(ArraySize(g_v_szAdminZombieKnifeModel) == 0)
  102.     {
  103.         for(iIndex = 0; iIndex < sizeof v_szAdminZombieKnifeModel; iIndex++)
  104.             ArrayPushString(g_v_szAdminZombieKnifeModel, v_szAdminZombieKnifeModel[iIndex])
  105.        
  106.         // Save to external file
  107.         amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Weapon Models", "V_KNIFE ZOMBIE VIP", g_v_szAdminZombieKnifeModel)
  108.     }
  109.    
  110.     // Precache
  111.     new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH], szModelPath[128]
  112.    
  113.     for (iIndex = 0; iIndex < ArraySize(g_szAdminHumanModel); iIndex++)
  114.     {
  115.         ArrayGetString(g_szAdminHumanModel, iIndex, szPlayerModel, charsmax(szPlayerModel))
  116.         formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szPlayerModel, szPlayerModel)
  117.         precache_model(szModelPath)
  118.     }
  119.    
  120.     for (iIndex = 0; iIndex < ArraySize(g_szAdminZombieModel); iIndex++)
  121.     {
  122.         ArrayGetString(g_szAdminZombieModel, iIndex, szPlayerModel, charsmax(szPlayerModel))
  123.         formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szPlayerModel, szPlayerModel)
  124.         precache_model(szModelPath)
  125.     }
  126.    
  127.     for (iIndex = 0; iIndex < ArraySize(g_szVipHumanModel); iIndex++)
  128.     {
  129.         ArrayGetString(g_szVipHumanModel, iIndex, szPlayerModel, charsmax(szPlayerModel))
  130.         formatex(szModelPath, charsmax(szModelPath), "models/player/%s/%s.mdl", szPlayerModel, szPlayerModel)
  131.         precache_model(szModelPath)
  132.     }
  133.    
  134.    
  135.     for (iIndex = 0; iIndex < ArraySize(g_v_szAdminHumanKnifeModel); iIndex++)
  136.     {
  137.         ArrayGetString(g_v_szAdminHumanKnifeModel, iIndex, szModel, charsmax(szModel))
  138.         precache_model(szModel)
  139.     }
  140.    
  141.     for (iIndex = 0; iIndex < ArraySize(g_v_szAdminZombieKnifeModel); iIndex++)
  142.     {
  143.         ArrayGetString(g_v_szAdminZombieKnifeModel, iIndex, szModel, charsmax(szModel))
  144.         precache_model(szModel)
  145.     }
  146. }
  147.  
  148. public ze_user_humanized(id)
  149. {
  150.     if(ze_is_user_zombie(id) || !is_user_alive(id))
  151.         return
  152.        
  153.     new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH]
  154.  
  155.     // Player Admin?
  156.     if (ze_get_vip_flags(id) & VIP_F) // F flag for vip model 1
  157.     {
  158.         // Set Admin Human Model
  159.         ArrayGetString(g_szAdminHumanModel, random_num(0, ArraySize(g_szAdminHumanModel) - 1), szPlayerModel, charsmax(szPlayerModel))
  160.         rg_set_user_model(id, szPlayerModel)
  161.        
  162.         // Set Admin Human Knife Model
  163.         ArrayGetString(g_v_szAdminHumanKnifeModel, random_num(0, ArraySize(g_v_szAdminHumanKnifeModel) - 0), szModel, charsmax(szModel))
  164.         cs_set_player_view_model(id, CSW_KNIFE, szModel)
  165.     }
  166.     else if (ze_get_vip_flags(id) & VIP_G) // G flag for vip model 2
  167.     {
  168.         // Set Admin Human Model
  169.         ArrayGetString(g_szVipHumanModel, random_num(0, ArraySize(g_szVipHumanModel) - 1), szPlayerModel, charsmax(szPlayerModel))
  170.         rg_set_user_model(id, szPlayerModel)
  171.        
  172.         // Set Admin Human Knife Model
  173.         ArrayGetString(g_v_szAdminHumanKnifeModel, random_num(0, ArraySize(g_v_szAdminHumanKnifeModel) - 0), szModel, charsmax(szModel))
  174.         cs_set_player_view_model(id, CSW_KNIFE, szModel)
  175.     }
  176. }
  177.  
  178. public ze_user_infected(iVictim, iInfector)
  179. {
  180.     if(!is_user_alive(iVictim))
  181.         return
  182.        
  183.     // Set Zombie Models
  184.     new szPlayerModel[PLAYERMODEL_MAX_LENGTH], szModel[MODEL_MAX_LENGTH]
  185.    
  186.     // Player Admin?
  187.     if ((ze_get_vip_flags(iVictim) & VIP_F) || (ze_get_vip_flags(iVictim) & VIP_G))
  188.     {
  189.         // Set Zombie Admin Model
  190.         ArrayGetString(g_szAdminZombieModel, random_num(0, ArraySize(g_szAdminZombieModel) - 1), szPlayerModel, charsmax(szPlayerModel))
  191.         rg_set_user_model(iVictim, szPlayerModel)
  192.        
  193.         // Set Admin Zombie Knife Model
  194.         ArrayGetString(g_v_szAdminZombieKnifeModel, random_num(0, ArraySize(g_v_szAdminZombieKnifeModel) - 1), szModel, charsmax(szModel))
  195.         cs_set_player_view_model(iVictim, CSW_KNIFE, szModel)
  196.         cs_set_player_weap_model(iVictim, CSW_KNIFE, "") // Leave Blank so knife not appear with zombies
  197.     }
  198. }
Now shows this Warning: Symbol is never used: "szVipHumanModel" on line 26.

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

#4

Post by Raheem » 5 years ago

Change:
    1.     if(ArraySize(g_szVipHumanModel) == 0) // MINE I ADDED
    2.     {
    3.         for(iIndex = 0; iIndex < sizeof szVipHumanModel; iIndex++)
    4.             ArrayPushString(g_szVipHumanModel, szAdminZombieModel[iIndex])
    5.            
    6.         // Save to external file
    7.         amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "SUBZERO VIP", g_szVipHumanModel)
    8.     }
TO:
    1.     if(ArraySize(g_szVipHumanModel) == 0) // MINE I ADDED
    2.     {
    3.         for(iIndex = 0; iIndex < sizeof szVipHumanModel; iIndex++)
    4.             ArrayPushString(g_szVipHumanModel, szVipHumanModel[iIndex])
    5.            
    6.         // Save to external file
    7.         amx_save_setting_string_arr(ZE_SETTING_RESOURCES, "Player Models", "SUBZERO VIP", g_szVipHumanModel)
    8.     }
He who fails to plan is planning to fail

User avatar
Null
Member
Member
Saudi Arabia
Posts: 28
Joined: 3 years ago
Location: Saudi Arabia, Riyadh
Contact:

#5

Post by Null » 2 years ago

Can give me the include ?
C:\Games\Counter-Strike\cstrike\addons\amxmodx\scripting\include\zombie_escape.inc(2) : fatal error 100: cannot read from file: "reapi"

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 6 guests