Solved Run Time Errors

Installation Problems Support
Post Reply
johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

Run Time Errors

#1

Post by johnnysins2000 » 7 years ago

I am Using The Ze VIP system but it is not functioning properly

These are the errors I got from Logs


L 03/17/2017 - 15:16:08: [AMXX] Displaying debug trace (plugin "ze_vip_system.amxx", version "1.0")
L 03/17/2017 - 15:16:08: [AMXX] Run time error 10: native error (native "get_pcvar_num")
L 03/17/2017 - 15:16:08: [AMXX] [0] ze_vip_system.sma::client_putinserver (line 229)


Code is this which is making problem

Code: Select all

public client_putinserver(id)
{
	if (get_user_flags(id) & VIP_ACCESS && get_pcvar_num(cvar_vip_connect_notice) != 0) 
	{
		new szName[32]
		get_user_name(id, szName, charsmax(szName))
		ze_colored_print(0, "!tVIP !g%s !tConnected!y.", szName)
	}
}

Full Code : -

Code: Select all

#include <zombie_escape>
#include <ze_multijump>

// Defines
#define VIP_ACCESS ADMIN_LEVEL_H

// Variables

new const parachute_model[] = "models/parachute.mdl" 

new bool:g_bIsHappyHour
new bool:has_parachute[33]
new para_ent[33]
new g_para_3rd_view

new g_parachute_FallSpeed, g_parachute_Detach 

// Cvars
new cvar_enable_multijump, cvar_enable_happy_hours, cvar_happy_hour_start, cvar_happy_hour_end, cvar_vip_flag,
cvar_enable_scoreboard_attrib, cvar_vip_connect_notice , maxplayers, cvar_vip_damage 

static const COLOR[] = "^x04" //green

public plugin_init()
{
	register_plugin("[ZE] VIP System", "1.0", "Raheem")
	register_message(get_user_msgid("SayText"),"Tekst");  
	register_message(get_user_msgid("SayText"),"Say_Text"); 
	RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG", 1); 
	register_clcmd("say /vip", "show_vip_motd")
	register_clcmd("say", "handle_say")
	
	// Hook Chains
	RegisterHookChain(RG_CBasePlayer_Spawn, "Fw_PlayerSpawn_Post", 1)
	
	// Cvars
	cvar_enable_multijump = register_cvar("ze_give_vip_multijump", "1")
	cvar_enable_happy_hours = register_cvar("ze_enable_happy_hours", "1")
	cvar_enable_scoreboard_attrib = register_cvar("ze_enable_scoreboard_attrib", "1")
	cvar_vip_connect_notice = register_cvar("ze_enable_connect_notice", "1")
	cvar_vip_damage = register_cvar("ze_vip_damage", "3") 
	g_para_3rd_view = register_cvar("ze_3rd_person_view", "1") 
	g_parachute_FallSpeed = register_cvar("ze_vip_parachute_fallspeed", "45")
	g_parachute_Detach = register_cvar("ze_vip_parachute_detach", "1")
	cvar_happy_hour_start = register_cvar("ze_happy_hours_start", "00") 
	cvar_happy_hour_end = register_cvar("ze_happy_hours_end", "12")
	cvar_vip_flag = register_cvar("ze_vip_flag", "t")
	
}

public show_vip_motd(id)
{
    show_motd(id, "vip.txt", "VIP Features")
} 

public plugin_precache()
	engfunc(EngFunc_PrecacheModel, parachute_model) 

public client_connect(id)
{
	parachute_reset(id)
	has_parachute[id] = false
}

public client_disconnect(id)
{
	parachute_reset(id)
	has_parachute[id] = false
}

public death_event()
{
	new i = read_data(2)
	
	parachute_reset(i)
	has_parachute[i] = false 
	set_view(i, CAMERA_NONE) 
} 

parachute_reset(id) 
{
	if (para_ent[id] > 0) 
	{
		if ( pev_valid(para_ent[id]) ) 
			engfunc(EngFunc_RemoveEntity, para_ent[id])
	}

	has_parachute[id] = false
	para_ent[id] = 0
} 

public newSpawn(id)
{
	parachute_reset(id)
} 

public fw_PreThink(id)
{
	//parachute.mdl animation information
	//0 - deploy - 84 frames
	//1 - idle - 39 frames
	//2 - detach - 29 frames
	
	if (!is_user_alive(id) || !has_parachute[id] && (get_user_flags(id) & VIP_ACCESS)) 
		return

	new Float:fallspeed = get_pcvar_float(g_parachute_FallSpeed) * -1.0
	new Float:frame

	new button = pev(id, pev_button)
	new oldbutton = pev(id, pev_oldbuttons)
	new flags = pev(id, pev_flags)

	if (para_ent[id] > 0 && (flags & FL_ONGROUND)) 
	{
		set_view(id, CAMERA_NONE)
		
		if (get_pcvar_num(g_parachute_Detach)) 
		{
			if ( pev(para_ent[id],pev_sequence) != 2 ) 
			{
				set_pev(para_ent[id], pev_sequence, 2)
				set_pev(para_ent[id], pev_gaitsequence, 1)
				set_pev(para_ent[id], pev_frame, 0.0)
				set_pev(para_ent[id], pev_fuser1, 0.0)
				set_pev(para_ent[id], pev_animtime, 0.0)
				return
			}
			
			pev(para_ent[id],pev_fuser1, frame)
			frame += 2.0
			set_pev(para_ent[id],pev_fuser1,frame)
			set_pev(para_ent[id],pev_frame,frame)
			
			if ( frame > 254.0 )
			{
				engfunc(EngFunc_RemoveEntity, para_ent[id])
				para_ent[id] = 0
			}
		}
		else 
		{
			engfunc(EngFunc_RemoveEntity, para_ent[id])
			para_ent[id] = 0
		}
		return
	}

	if (button & IN_USE) 
	{
		new Float:velocity[3]
		pev(id, pev_velocity, velocity)
		
		if (get_pcvar_num(g_para_3rd_view) == 1)
		{
			set_view(id, CAMERA_NONE)
		}
		if (get_pcvar_num(g_para_3rd_view) == 2)
		{
			set_view(id, CAMERA_3RDPERSON)
		}
		
		if (velocity[2] < 0.0) 
		{
			if(para_ent[id] <= 0) 
			{
				para_ent[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
				
				if(para_ent[id] > 0) 
				{
					set_pev(para_ent[id],pev_classname,"parachute")
					set_pev(para_ent[id], pev_aiment, id)
					set_pev(para_ent[id], pev_owner, id)
					set_pev(para_ent[id], pev_movetype, MOVETYPE_FOLLOW)
					engfunc(EngFunc_SetModel, para_ent[id], parachute_model)
					set_pev(para_ent[id], pev_sequence, 0)
					set_pev(para_ent[id], pev_gaitsequence, 1)
					set_pev(para_ent[id], pev_frame, 0.0)
					set_pev(para_ent[id], pev_fuser1, 0.0)
				}
			}
			
			if (para_ent[id] > 0) 
			{
				set_pev(id, pev_sequence, 3)
				set_pev(id, pev_gaitsequence, 1)
				set_pev(id, pev_frame, 1.0)
				set_pev(id, pev_framerate, 1.0)
			
				velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
				set_pev(id, pev_velocity, velocity)
				
				if (pev(para_ent[id],pev_sequence) == 0) 
				{
					pev(para_ent[id],pev_fuser1, frame)
					frame += 1.0
					set_pev(para_ent[id],pev_fuser1,frame)
					set_pev(para_ent[id],pev_frame,frame)
					
					if (frame > 100.0) 
					{
						set_pev(para_ent[id], pev_animtime, 0.0)
						set_pev(para_ent[id], pev_framerate, 0.4)
						set_pev(para_ent[id], pev_sequence, 1)
						set_pev(para_ent[id], pev_gaitsequence, 1)
						set_pev(para_ent[id], pev_frame, 0.0)
						set_pev(para_ent[id], pev_fuser1, 0.0)
					}
				}
			}
		}
		
		else if (para_ent[id] > 0) 
		{
			engfunc(EngFunc_RemoveEntity, para_ent[id])
			para_ent[id] = 0
		}
	}
	
	else if ((oldbutton & IN_USE) && para_ent[id] > 0 ) 
	{
		engfunc(EngFunc_RemoveEntity, para_ent[id])
		para_ent[id] = 0
	}
}

public client_putinserver(id)
{
	if (get_user_flags(id) & VIP_ACCESS && get_pcvar_num(cvar_vip_connect_notice) != 0) 
	{
		new szName[32]
		get_user_name(id, szName, charsmax(szName))
		ze_colored_print(0, "!tVIP !g%s !tConnected!y.", szName)
	}
}

public Fw_Take_DMG(attacker, Inflictor, victim, Float:Damage, bitsDamageType)
{
    if(!is_user_alive(attacker) || !is_user_alive(victim))
        return
       
    if(get_user_flags(attacker) & ADMIN_LEVEL_H) 
    {
    	  SetHamParamFloat(4, Damage * get_pcvar_float(cvar_vip_damage))
     } 
} 

public Fw_PlayerSpawn_Post(id)
{
	Happy_Hours()
	
	if (get_pcvar_num(cvar_enable_multijump) != 0 && (get_user_flags(id) & VIP_ACCESS))
	{
		ze_give_user_multijump(id)
	}
	
	if (g_bIsHappyHour == true && get_pcvar_num(cvar_enable_happy_hours) != 0)
	{
		new szFlags[2]
		get_pcvar_string(cvar_vip_flag, szFlags, charsmax(szFlags))
		set_user_flags(id, read_flags(szFlags))
	}
	
	set_task(0.1, "Update_Attribute", id, _, _, "a", 10)
}

public Update_Attribute(id)
{
	if (get_user_flags(id) & VIP_ACCESS && get_pcvar_num(cvar_enable_scoreboard_attrib) != 0)
	{
		message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
		write_byte(id)
		write_byte(4)
		message_end()
	}
}

stock Happy_Hours()
{
	new szTime[3]
	get_time("%H", szTime, charsmax(szTime))

	if(get_pcvar_num(cvar_happy_hour_end) > str_to_num(szTime) >= get_pcvar_num(cvar_happy_hour_start))
	{
        g_bIsHappyHour = true
	}
	else
	{
		g_bIsHappyHour = false
	}
}

public Tekst(msgId,msgDest,msgEnt){
	new id = get_msg_arg_int(1);
	
	if(!is_user_connected(id))      return PLUGIN_CONTINUE;
	
	if(get_user_flags(id) & ADMIN_LEVEL_H) 
	{
		new szTmp[256],szTmp2[256];
		get_msg_arg_string(2,szTmp, charsmax( szTmp ) )
		
		new szPrefix[64] = "^x04[VIP]";
		
		if(!equal(szTmp,"#Cstrike_Chat_All")){
			add(szTmp2,charsmax(szTmp2),szPrefix);
			add(szTmp2,charsmax(szTmp2)," ");
			add(szTmp2,charsmax(szTmp2),szTmp);
		}
		else{
			add(szTmp2,charsmax(szTmp2),szPrefix);
			add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 :  ^x04%s2");
		}
		
		set_msg_arg_string(2,szTmp2);
	}
	return PLUGIN_CONTINUE;
} 

public PrintText(id)
{
 client_print(id, print_chat, "[VIP] write /wantvip and u will see how get VIP and VIP privilegies.")
} 

public handle_say(id) {
	new said[192]
	read_args(said,192)
	if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
		set_task(0.1,"print_adminlist",id)
	return PLUGIN_CONTINUE
}

public print_adminlist(user) 
{
	new adminnames[33][32]
	new message[256]
	new contactinfo[256], contact[112]
	new id, count, x, len
	
	for(id = 1 ; id <= maxplayers ; id++)
		if(is_user_connected(id))
			if(get_user_flags(id) & ADMIN_LEVEL_H)
				get_user_name(id, adminnames[count++], 31)

	len = format(message, 255, "%s VIP ONLINE: ",COLOR)
	if(count > 0) {
		for(x = 0 ; x < count ; x++) {
			len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
			if(len > 96 ) {
				print_message(user, message)
				len = format(message, 255, "%s ",COLOR)
			}
		}
		print_message(user, message)
	}
	else {
		len += format(message[len], 255-len, "No VIP online.")
		print_message(user, message)
	}
	
	get_cvar_string("amx_contactinfo", contact, 63)
	if(contact[0])  {
		format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
		print_message(user, contactinfo)
	}
}

print_message(id, msg[])
{
    message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
    write_byte(id)
    write_string(msg)
    message_end()
} 
Nobody Is That Busy If They Make Time :roll:

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#2

Post by Night Fury » 7 years ago

Try:
  1. #include <zombie_escape>
  2. #include <ze_multijump>
  3.  
  4. // Defines
  5. #define VIP_ACCESS ADMIN_LEVEL_H
  6.  
  7. // Variables
  8.  
  9. new const parachute_model[] = "models/parachute.mdl"
  10.  
  11. new bool:g_bIsHappyHour
  12. new bool:has_parachute[33]
  13. new para_ent[33]
  14. new g_para_3rd_view
  15.  
  16. new g_parachute_FallSpeed, g_parachute_Detach
  17.  
  18. // Cvars
  19. new cvar_enable_multijump, cvar_enable_happy_hours, cvar_happy_hour_start, cvar_happy_hour_end, cvar_vip_flag,
  20. cvar_enable_scoreboard_attrib, cvar_vip_connect_notice , maxplayers, cvar_vip_damage
  21.  
  22. static const COLOR[] = "^x04" //green
  23.  
  24. public plugin_init()
  25. {
  26.     register_plugin("[ZE] VIP System", "1.0", "Raheem")
  27.     register_message(get_user_msgid("SayText"),"Tekst");  
  28.     register_message(get_user_msgid("SayText"),"Say_Text");
  29.     RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG", 1);
  30.     register_clcmd("say /vip", "show_vip_motd")
  31.     register_clcmd("say", "handle_say")
  32.    
  33.     // Hook Chains
  34.     RegisterHookChain(RG_CBasePlayer_Spawn, "Fw_PlayerSpawn_Post", 1)
  35.    
  36.     // Cvars
  37.     cvar_enable_multijump = register_cvar("ze_give_vip_multijump", "1")
  38.     cvar_enable_happy_hours = register_cvar("ze_enable_happy_hours", "1")
  39.     cvar_enable_scoreboard_attrib = register_cvar("ze_enable_scoreboard_attrib", "1")
  40.     cvar_vip_connect_notice = register_cvar("ze_enable_connect_notice", "1")
  41.     cvar_vip_damage = register_cvar("ze_vip_damage", "3")
  42.     g_para_3rd_view = register_cvar("ze_3rd_person_view", "1")
  43.     g_parachute_FallSpeed = register_cvar("ze_vip_parachute_fallspeed", "45")
  44.     g_parachute_Detach = register_cvar("ze_vip_parachute_detach", "1")
  45.     cvar_happy_hour_start = register_cvar("ze_happy_hours_start", "00")
  46.     cvar_happy_hour_end = register_cvar("ze_happy_hours_end", "12")
  47.     cvar_vip_flag = register_cvar("ze_vip_flag", "t")
  48.    
  49. }
  50.  
  51. public show_vip_motd(id)
  52. {
  53.     show_motd(id, "vip.txt", "VIP Features")
  54. }
  55.  
  56. public plugin_precache()
  57. {
  58.     engfunc(EngFunc_PrecacheModel, parachute_model)
  59. }
  60.  
  61. public client_putinserver(id)
  62. {
  63.     if (get_user_flags(id) & VIP_ACCESS && get_pcvar_num(cvar_vip_connect_notice))
  64.     {
  65.         parachute_reset(id)
  66.         new szName[32]
  67.         get_user_name(id, szName, charsmax(szName))
  68.         ze_colored_print(0, "!tVIP !g%s !tConnected!y.", szName)
  69.     }
  70. }
  71.  
  72. public client_disconnect(id)
  73. {
  74.     parachute_reset(id)
  75. }
  76.  
  77. public death_event()
  78. {
  79.     parachute_reset(read_data(2))
  80.     set_view(read_data(2), CAMERA_NONE)
  81. }
  82.  
  83. parachute_reset(id)
  84. {
  85.     if (para_ent[id] > 0)
  86.     {
  87.         if (pev_valid(para_ent[id]))
  88.         {
  89.             engfunc(EngFunc_RemoveEntity, para_ent[id])
  90.         }
  91.     }
  92.  
  93.     has_parachute[id] = false
  94.     para_ent[id] = 0
  95. }
  96.  
  97. public newSpawn(id)
  98. {
  99.     parachute_reset(id)
  100. }
  101.  
  102. public fw_PreThink(id)
  103. {
  104.     if (!is_user_alive(id) || !has_parachute[id] && (get_user_flags(id) & VIP_ACCESS))
  105.         return
  106.  
  107.     new Float:fallspeed = get_pcvar_float(g_parachute_FallSpeed) * -1.0
  108.     new Float:frame
  109.  
  110.     new button = pev(id, pev_button)
  111.     new oldbutton = pev(id, pev_oldbuttons)
  112.     new flags = pev(id, pev_flags)
  113.  
  114.     if (para_ent[id] > 0 && (flags & FL_ONGROUND))
  115.     {
  116.         set_view(id, CAMERA_NONE)
  117.        
  118.         if (get_pcvar_num(g_parachute_Detach))
  119.         {
  120.             if ( pev(para_ent[id],pev_sequence) != 2 )
  121.             {
  122.                 set_pev(para_ent[id], pev_sequence, 2)
  123.                 set_pev(para_ent[id], pev_gaitsequence, 1)
  124.                 set_pev(para_ent[id], pev_frame, 0.0)
  125.                 set_pev(para_ent[id], pev_fuser1, 0.0)
  126.                 set_pev(para_ent[id], pev_animtime, 0.0)
  127.                 return
  128.             }
  129.            
  130.             pev(para_ent[id],pev_fuser1, frame)
  131.             frame += 2.0
  132.             set_pev(para_ent[id],pev_fuser1,frame)
  133.             set_pev(para_ent[id],pev_frame,frame)
  134.            
  135.             if ( frame > 254.0 )
  136.             {
  137.                 engfunc(EngFunc_RemoveEntity, para_ent[id])
  138.                 para_ent[id] = 0
  139.             }
  140.         }
  141.         else
  142.         {
  143.             engfunc(EngFunc_RemoveEntity, para_ent[id])
  144.             para_ent[id] = 0
  145.         }
  146.         return
  147.     }
  148.  
  149.     if (button & IN_USE)
  150.     {
  151.         new Float:velocity[3]
  152.         pev(id, pev_velocity, velocity)
  153.        
  154.         if (get_pcvar_num(g_para_3rd_view) == 1)
  155.         {
  156.             set_view(id, CAMERA_NONE)
  157.         }
  158.         if (get_pcvar_num(g_para_3rd_view) == 2)
  159.         {
  160.             set_view(id, CAMERA_3RDPERSON)
  161.         }
  162.        
  163.         if (velocity[2] < 0.0)
  164.         {
  165.             if(para_ent[id] <= 0)
  166.             {
  167.                 para_ent[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  168.                
  169.                 if(para_ent[id] > 0)
  170.                 {
  171.                     set_pev(para_ent[id],pev_classname,"parachute")
  172.                     set_pev(para_ent[id], pev_aiment, id)
  173.                     set_pev(para_ent[id], pev_owner, id)
  174.                     set_pev(para_ent[id], pev_movetype, MOVETYPE_FOLLOW)
  175.                     engfunc(EngFunc_SetModel, para_ent[id], parachute_model)
  176.                     set_pev(para_ent[id], pev_sequence, 0)
  177.                     set_pev(para_ent[id], pev_gaitsequence, 1)
  178.                     set_pev(para_ent[id], pev_frame, 0.0)
  179.                     set_pev(para_ent[id], pev_fuser1, 0.0)
  180.                 }
  181.             }
  182.            
  183.             if (para_ent[id] > 0)
  184.             {
  185.                 set_pev(id, pev_sequence, 3)
  186.                 set_pev(id, pev_gaitsequence, 1)
  187.                 set_pev(id, pev_frame, 1.0)
  188.                 set_pev(id, pev_framerate, 1.0)
  189.            
  190.                 velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
  191.                 set_pev(id, pev_velocity, velocity)
  192.                
  193.                 if (pev(para_ent[id],pev_sequence) == 0)
  194.                 {
  195.                     pev(para_ent[id],pev_fuser1, frame)
  196.                     frame += 1.0
  197.                     set_pev(para_ent[id],pev_fuser1,frame)
  198.                     set_pev(para_ent[id],pev_frame,frame)
  199.                    
  200.                     if (frame > 100.0)
  201.                     {
  202.                         set_pev(para_ent[id], pev_animtime, 0.0)
  203.                         set_pev(para_ent[id], pev_framerate, 0.4)
  204.                         set_pev(para_ent[id], pev_sequence, 1)
  205.                         set_pev(para_ent[id], pev_gaitsequence, 1)
  206.                         set_pev(para_ent[id], pev_frame, 0.0)
  207.                         set_pev(para_ent[id], pev_fuser1, 0.0)
  208.                     }
  209.                 }
  210.             }
  211.         }
  212.        
  213.         else if (para_ent[id] > 0)
  214.         {
  215.             engfunc(EngFunc_RemoveEntity, para_ent[id])
  216.             para_ent[id] = 0
  217.         }
  218.     }
  219.    
  220.     else if ((oldbutton & IN_USE) && para_ent[id] > 0 )
  221.     {
  222.         engfunc(EngFunc_RemoveEntity, para_ent[id])
  223.         para_ent[id] = 0
  224.     }
  225. }
  226.  
  227. public Fw_Take_DMG(attacker, Inflictor, victim, Float:Damage, bitsDamageType)
  228. {
  229.     if(!is_user_alive(attacker) || !is_user_alive(victim))
  230.         return
  231.        
  232.     if(get_user_flags(attacker) & ADMIN_LEVEL_H)
  233.     {
  234.           SetHamParamFloat(4, Damage * get_pcvar_float(cvar_vip_damage))
  235.      }
  236. }
  237.  
  238. public Fw_PlayerSpawn_Post(id)
  239. {
  240.     Happy_Hours()
  241.    
  242.     if (get_pcvar_num(cvar_enable_multijump) != 0 && (get_user_flags(id) & VIP_ACCESS))
  243.     {
  244.         ze_give_user_multijump(id)
  245.     }
  246.    
  247.     if (g_bIsHappyHour == true && get_pcvar_num(cvar_enable_happy_hours) != 0)
  248.     {
  249.         new szFlags[2]
  250.         get_pcvar_string(cvar_vip_flag, szFlags, charsmax(szFlags))
  251.         set_user_flags(id, read_flags(szFlags))
  252.     }
  253.    
  254.     set_task(0.1, "Update_Attribute", id, _, _, "a", 10)
  255. }
  256.  
  257. public Update_Attribute(id)
  258. {
  259.     if (get_user_flags(id) & VIP_ACCESS && get_pcvar_num(cvar_enable_scoreboard_attrib) != 0)
  260.     {
  261.         message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
  262.         write_byte(id)
  263.         write_byte(4)
  264.         message_end()
  265.     }
  266. }
  267.  
  268. stock Happy_Hours()
  269. {
  270.     new szTime[3]
  271.     get_time("%H", szTime, charsmax(szTime))
  272.  
  273.     if(get_pcvar_num(cvar_happy_hour_end) > str_to_num(szTime) >= get_pcvar_num(cvar_happy_hour_start))
  274.     {
  275.         g_bIsHappyHour = true
  276.     }
  277.     else
  278.     {
  279.         g_bIsHappyHour = false
  280.     }
  281. }
  282.  
  283. public Tekst(msgId,msgDest,msgEnt){
  284.     new id = get_msg_arg_int(1);
  285.    
  286.     if(!is_user_connected(id))      return PLUGIN_CONTINUE;
  287.    
  288.     if(get_user_flags(id) & ADMIN_LEVEL_H)
  289.     {
  290.         new szTmp[256],szTmp2[256];
  291.         get_msg_arg_string(2,szTmp, charsmax( szTmp ) )
  292.        
  293.         new szPrefix[64] = "^x04[VIP]";
  294.        
  295.         if(!equal(szTmp,"#Cstrike_Chat_All")){
  296.             add(szTmp2,charsmax(szTmp2),szPrefix);
  297.             add(szTmp2,charsmax(szTmp2)," ");
  298.             add(szTmp2,charsmax(szTmp2),szTmp);
  299.         }
  300.         else{
  301.             add(szTmp2,charsmax(szTmp2),szPrefix);
  302.             add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 :  ^x04%s2");
  303.         }
  304.        
  305.         set_msg_arg_string(2,szTmp2);
  306.     }
  307.     return PLUGIN_CONTINUE;
  308. }
  309.  
  310. public PrintText(id)
  311. {
  312.  client_print(id, print_chat, "[VIP] write /wantvip and u will see how get VIP and VIP privilegies.")
  313. }
  314.  
  315. public handle_say(id) {
  316.     new said[192]
  317.     read_args(said,192)
  318.     if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
  319.         set_task(0.1,"print_adminlist",id)
  320.     return PLUGIN_CONTINUE
  321. }
  322.  
  323. public print_adminlist(user)
  324. {
  325.     new adminnames[33][32]
  326.     new message[256]
  327.     new contactinfo[256], contact[112]
  328.     new id, count, x, len
  329.    
  330.     for(id = 1 ; id <= maxplayers ; id++)
  331.         if(is_user_connected(id))
  332.             if(get_user_flags(id) & ADMIN_LEVEL_H)
  333.                 get_user_name(id, adminnames[count++], 31)
  334.  
  335.     len = format(message, 255, "%s VIP ONLINE: ",COLOR)
  336.     if(count > 0) {
  337.         for(x = 0 ; x < count ; x++) {
  338.             len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
  339.             if(len > 96 ) {
  340.                 print_message(user, message)
  341.                 len = format(message, 255, "%s ",COLOR)
  342.             }
  343.         }
  344.         print_message(user, message)
  345.     }
  346.     else {
  347.         len += format(message[len], 255-len, "No VIP online.")
  348.         print_message(user, message)
  349.     }
  350.    
  351.     get_cvar_string("amx_contactinfo", contact, 63)
  352.     if(contact[0])  {
  353.         format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
  354.         print_message(user, contactinfo)
  355.     }
  356. }
  357.  
  358. print_message(id, msg[])
  359. {
  360.     message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
  361.     write_byte(id)
  362.     write_string(msg)
  363.     message_end()
  364. }
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#3

Post by johnnysins2000 » 7 years ago

L 03/17/2017 - 17:15:03: Invalid CVAR pointer
L 03/17/2017 - 17:15:03: [AMXX] Displaying debug trace (plugin "ze_vip_system.amxx", version "1.0")
L 03/17/2017 - 17:15:03: [AMXX] Run time error 10: native error (native "get_pcvar_num")
L 03/17/2017 - 17:15:03: [AMXX] [0] ze_vip_system.sma::client_putinserver (line 63)


Same Error bro
Nobody Is That Busy If They Make Time :roll:

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#4

Post by Night Fury » 7 years ago

  1. #include <zombie_escape>
  2. #include <ze_multijump>
  3.  
  4. // Defines
  5. #define VIP_ACCESS ADMIN_LEVEL_H
  6.  
  7. // Variables
  8.  
  9. new const parachute_model[] = "models/parachute.mdl"
  10.  
  11. new bool:g_bIsHappyHour
  12. new bool:has_parachute[33]
  13. new para_ent[33]
  14. new g_para_3rd_view
  15.  
  16. new g_parachute_FallSpeed, g_parachute_Detach
  17.  
  18. // Cvars
  19. new cvar_enable_multijump, cvar_enable_happy_hours, cvar_happy_hour_start, cvar_happy_hour_end, cvar_vip_flag
  20. new cvar_enable_scoreboard_attrib, cvar_vip_notice , maxplayers, cvar_vip_damage
  21.  
  22. static const COLOR[] = "^x04" //green
  23.  
  24. public plugin_init()
  25. {
  26.     register_plugin("[ZE] VIP System", "1.0", "Raheem")
  27.     register_message(get_user_msgid("SayText"),"Tekst");  
  28.     register_message(get_user_msgid("SayText"),"Say_Text");
  29.     RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG", 1);
  30.     register_clcmd("say /vip", "show_vip_motd")
  31.     register_clcmd("say", "handle_say")
  32.    
  33.     // Hook Chains
  34.     RegisterHookChain(RG_CBasePlayer_Spawn, "Fw_PlayerSpawn_Post", 1)
  35.    
  36.     // Cvars
  37.     cvar_enable_multijump = register_cvar("ze_give_vip_multijump", "1")
  38.     cvar_enable_happy_hours = register_cvar("ze_enable_happy_hours", "1")
  39.     cvar_enable_scoreboard_attrib = register_cvar("ze_enable_scoreboard_attrib", "1")
  40.     cvar_vip_notice = register_cvar("ze_enable_connect_notice", "1")
  41.     cvar_vip_damage = register_cvar("ze_vip_damage", "3")
  42.     g_para_3rd_view = register_cvar("ze_3rd_person_view", "1")
  43.     g_parachute_FallSpeed = register_cvar("ze_vip_parachute_fallspeed", "45")
  44.     g_parachute_Detach = register_cvar("ze_vip_parachute_detach", "1")
  45.     cvar_happy_hour_start = register_cvar("ze_happy_hours_start", "00")
  46.     cvar_happy_hour_end = register_cvar("ze_happy_hours_end", "12")
  47.     cvar_vip_flag = register_cvar("ze_vip_flag", "t")
  48.    
  49. }
  50.  
  51. public show_vip_motd(id)
  52. {
  53.     show_motd(id, "vip.txt", "VIP Features")
  54. }
  55.  
  56. public plugin_precache()
  57. {
  58.     engfunc(EngFunc_PrecacheModel, parachute_model)
  59. }
  60.  
  61. public client_putinserver(id)
  62. {
  63.     if (get_user_flags(id) & VIP_ACCESS && get_pcvar_num(cvar_vip_notice))
  64.     {
  65.         parachute_reset(id)
  66.         new szName[32]
  67.         get_user_name(id, szName, charsmax(szName))
  68.         ze_colored_print(0, "!tVIP !g%s !tConnected!y.", szName)
  69.     }
  70. }
  71.  
  72. public client_disconnect(id)
  73. {
  74.     parachute_reset(id)
  75. }
  76.  
  77. public death_event()
  78. {
  79.     parachute_reset(read_data(2))
  80.     set_view(read_data(2), CAMERA_NONE)
  81. }
  82.  
  83. parachute_reset(id)
  84. {
  85.     if (para_ent[id] > 0)
  86.     {
  87.         if (pev_valid(para_ent[id]))
  88.         {
  89.             engfunc(EngFunc_RemoveEntity, para_ent[id])
  90.         }
  91.     }
  92.  
  93.     has_parachute[id] = false
  94.     para_ent[id] = 0
  95. }
  96.  
  97. public newSpawn(id)
  98. {
  99.     parachute_reset(id)
  100. }
  101.  
  102. public fw_PreThink(id)
  103. {
  104.     if (!is_user_alive(id) || !has_parachute[id] && (get_user_flags(id) & VIP_ACCESS))
  105.         return
  106.  
  107.     new Float:fallspeed = get_pcvar_float(g_parachute_FallSpeed) * -1.0
  108.     new Float:frame
  109.  
  110.     new button = pev(id, pev_button)
  111.     new oldbutton = pev(id, pev_oldbuttons)
  112.     new flags = pev(id, pev_flags)
  113.  
  114.     if (para_ent[id] > 0 && (flags & FL_ONGROUND))
  115.     {
  116.         set_view(id, CAMERA_NONE)
  117.        
  118.         if (get_pcvar_num(g_parachute_Detach))
  119.         {
  120.             if ( pev(para_ent[id],pev_sequence) != 2 )
  121.             {
  122.                 set_pev(para_ent[id], pev_sequence, 2)
  123.                 set_pev(para_ent[id], pev_gaitsequence, 1)
  124.                 set_pev(para_ent[id], pev_frame, 0.0)
  125.                 set_pev(para_ent[id], pev_fuser1, 0.0)
  126.                 set_pev(para_ent[id], pev_animtime, 0.0)
  127.                 return
  128.             }
  129.            
  130.             pev(para_ent[id],pev_fuser1, frame)
  131.             frame += 2.0
  132.             set_pev(para_ent[id],pev_fuser1,frame)
  133.             set_pev(para_ent[id],pev_frame,frame)
  134.            
  135.             if ( frame > 254.0 )
  136.             {
  137.                 engfunc(EngFunc_RemoveEntity, para_ent[id])
  138.                 para_ent[id] = 0
  139.             }
  140.         }
  141.         else
  142.         {
  143.             engfunc(EngFunc_RemoveEntity, para_ent[id])
  144.             para_ent[id] = 0
  145.         }
  146.         return
  147.     }
  148.  
  149.     if (button & IN_USE)
  150.     {
  151.         new Float:velocity[3]
  152.         pev(id, pev_velocity, velocity)
  153.        
  154.         if (get_pcvar_num(g_para_3rd_view) == 1)
  155.         {
  156.             set_view(id, CAMERA_NONE)
  157.         }
  158.         if (get_pcvar_num(g_para_3rd_view) == 2)
  159.         {
  160.             set_view(id, CAMERA_3RDPERSON)
  161.         }
  162.        
  163.         if (velocity[2] < 0.0)
  164.         {
  165.             if(para_ent[id] <= 0)
  166.             {
  167.                 para_ent[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
  168.                
  169.                 if(para_ent[id] > 0)
  170.                 {
  171.                     set_pev(para_ent[id],pev_classname,"parachute")
  172.                     set_pev(para_ent[id], pev_aiment, id)
  173.                     set_pev(para_ent[id], pev_owner, id)
  174.                     set_pev(para_ent[id], pev_movetype, MOVETYPE_FOLLOW)
  175.                     engfunc(EngFunc_SetModel, para_ent[id], parachute_model)
  176.                     set_pev(para_ent[id], pev_sequence, 0)
  177.                     set_pev(para_ent[id], pev_gaitsequence, 1)
  178.                     set_pev(para_ent[id], pev_frame, 0.0)
  179.                     set_pev(para_ent[id], pev_fuser1, 0.0)
  180.                 }
  181.             }
  182.            
  183.             if (para_ent[id] > 0)
  184.             {
  185.                 set_pev(id, pev_sequence, 3)
  186.                 set_pev(id, pev_gaitsequence, 1)
  187.                 set_pev(id, pev_frame, 1.0)
  188.                 set_pev(id, pev_framerate, 1.0)
  189.            
  190.                 velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
  191.                 set_pev(id, pev_velocity, velocity)
  192.                
  193.                 if (pev(para_ent[id],pev_sequence) == 0)
  194.                 {
  195.                     pev(para_ent[id],pev_fuser1, frame)
  196.                     frame += 1.0
  197.                     set_pev(para_ent[id],pev_fuser1,frame)
  198.                     set_pev(para_ent[id],pev_frame,frame)
  199.                    
  200.                     if (frame > 100.0)
  201.                     {
  202.                         set_pev(para_ent[id], pev_animtime, 0.0)
  203.                         set_pev(para_ent[id], pev_framerate, 0.4)
  204.                         set_pev(para_ent[id], pev_sequence, 1)
  205.                         set_pev(para_ent[id], pev_gaitsequence, 1)
  206.                         set_pev(para_ent[id], pev_frame, 0.0)
  207.                         set_pev(para_ent[id], pev_fuser1, 0.0)
  208.                     }
  209.                 }
  210.             }
  211.         }
  212.        
  213.         else if (para_ent[id] > 0)
  214.         {
  215.             engfunc(EngFunc_RemoveEntity, para_ent[id])
  216.             para_ent[id] = 0
  217.         }
  218.     }
  219.    
  220.     else if ((oldbutton & IN_USE) && para_ent[id] > 0 )
  221.     {
  222.         engfunc(EngFunc_RemoveEntity, para_ent[id])
  223.         para_ent[id] = 0
  224.     }
  225. }
  226.  
  227. public Fw_Take_DMG(attacker, Inflictor, victim, Float:Damage, bitsDamageType)
  228. {
  229.     if(!is_user_alive(attacker) || !is_user_alive(victim))
  230.         return
  231.        
  232.     if(get_user_flags(attacker) & ADMIN_LEVEL_H)
  233.     {
  234.           SetHamParamFloat(4, Damage * get_pcvar_float(cvar_vip_damage))
  235.      }
  236. }
  237.  
  238. public Fw_PlayerSpawn_Post(id)
  239. {
  240.     Happy_Hours()
  241.    
  242.     if (get_pcvar_num(cvar_enable_multijump) != 0 && (get_user_flags(id) & VIP_ACCESS))
  243.     {
  244.         ze_give_user_multijump(id)
  245.     }
  246.    
  247.     if (g_bIsHappyHour == true && get_pcvar_num(cvar_enable_happy_hours) != 0)
  248.     {
  249.         new szFlags[2]
  250.         get_pcvar_string(cvar_vip_flag, szFlags, charsmax(szFlags))
  251.         set_user_flags(id, read_flags(szFlags))
  252.     }
  253.    
  254.     set_task(0.1, "Update_Attribute", id, _, _, "a", 10)
  255. }
  256.  
  257. public Update_Attribute(id)
  258. {
  259.     if (get_user_flags(id) & VIP_ACCESS && get_pcvar_num(cvar_enable_scoreboard_attrib) != 0)
  260.     {
  261.         message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
  262.         write_byte(id)
  263.         write_byte(4)
  264.         message_end()
  265.     }
  266. }
  267.  
  268. stock Happy_Hours()
  269. {
  270.     new szTime[3]
  271.     get_time("%H", szTime, charsmax(szTime))
  272.  
  273.     if(get_pcvar_num(cvar_happy_hour_end) > str_to_num(szTime) >= get_pcvar_num(cvar_happy_hour_start))
  274.     {
  275.         g_bIsHappyHour = true
  276.     }
  277.     else
  278.     {
  279.         g_bIsHappyHour = false
  280.     }
  281. }
  282.  
  283. public Tekst(msgId,msgDest,msgEnt){
  284.     new id = get_msg_arg_int(1);
  285.    
  286.     if(!is_user_connected(id))      return PLUGIN_CONTINUE;
  287.    
  288.     if(get_user_flags(id) & ADMIN_LEVEL_H)
  289.     {
  290.         new szTmp[256],szTmp2[256];
  291.         get_msg_arg_string(2,szTmp, charsmax( szTmp ) )
  292.        
  293.         new szPrefix[64] = "^x04[VIP]";
  294.        
  295.         if(!equal(szTmp,"#Cstrike_Chat_All")){
  296.             add(szTmp2,charsmax(szTmp2),szPrefix);
  297.             add(szTmp2,charsmax(szTmp2)," ");
  298.             add(szTmp2,charsmax(szTmp2),szTmp);
  299.         }
  300.         else{
  301.             add(szTmp2,charsmax(szTmp2),szPrefix);
  302.             add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 :  ^x04%s2");
  303.         }
  304.        
  305.         set_msg_arg_string(2,szTmp2);
  306.     }
  307.     return PLUGIN_CONTINUE;
  308. }
  309.  
  310. public PrintText(id)
  311. {
  312.  client_print(id, print_chat, "[VIP] write /wantvip and u will see how get VIP and VIP privilegies.")
  313. }
  314.  
  315. public handle_say(id) {
  316.     new said[192]
  317.     read_args(said,192)
  318.     if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
  319.         set_task(0.1,"print_adminlist",id)
  320.     return PLUGIN_CONTINUE
  321. }
  322.  
  323. public print_adminlist(user)
  324. {
  325.     new adminnames[33][32]
  326.     new message[256]
  327.     new contactinfo[256], contact[112]
  328.     new id, count, x, len
  329.    
  330.     for(id = 1 ; id <= maxplayers ; id++)
  331.         if(is_user_connected(id))
  332.             if(get_user_flags(id) & ADMIN_LEVEL_H)
  333.                 get_user_name(id, adminnames[count++], 31)
  334.  
  335.     len = format(message, 255, "%s VIP ONLINE: ",COLOR)
  336.     if(count > 0) {
  337.         for(x = 0 ; x < count ; x++) {
  338.             len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
  339.             if(len > 96 ) {
  340.                 print_message(user, message)
  341.                 len = format(message, 255, "%s ",COLOR)
  342.             }
  343.         }
  344.         print_message(user, message)
  345.     }
  346.     else {
  347.         len += format(message[len], 255-len, "No VIP online.")
  348.         print_message(user, message)
  349.     }
  350.    
  351.     get_cvar_string("amx_contactinfo", contact, 63)
  352.     if(contact[0])  {
  353.         format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
  354.         print_message(user, contactinfo)
  355.     }
  356. }
  357.  
  358. print_message(id, msg[])
  359. {
  360.     message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
  361.     write_byte(id)
  362.     write_string(msg)
  363.     message_end()
  364. }
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#5

Post by johnnysins2000 » 7 years ago

Still Same
Nobody Is That Busy If They Make Time :roll:

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#6

Post by johnnysins2000 » 7 years ago

I Will Ask Raheem about this

Can SomeBody Tag Raheem Here
Nobody Is That Busy If They Make Time :roll:

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#7

Post by johnnysins2000 » 7 years ago

Ok Guyz I fixed the problem everything is working Fine Except Parachute this is the code :-

Code: Select all

#include <zombie_escape>
#include <ze_multijump>
 
// Defines
#define VIP_ACCESS ADMIN_LEVEL_H
 
// Variables
 
new const parachute_model[] = "models/parachute.mdl"
 
new bool:g_bIsHappyHour
new bool:has_parachute[33]
new para_ent[33]
new g_para_3rd_view
 
new g_parachute_FallSpeed, g_parachute_Detach
 
// Cvars
new cvar_enable_multijump, cvar_enable_happy_hours, cvar_happy_hour_start, cvar_happy_hour_end, cvar_vip_flag
new cvar_enable_scoreboard_attrib, maxplayers, cvar_vip_damage 
 
static const COLOR[] = "^x04" //green
 
public plugin_init()
{
    register_plugin("[ZE] VIP System", "1.0", "Raheem")
    register_message(get_user_msgid("SayText"),"Tekst");  
    RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG", 1);
    register_clcmd("say /vip", "show_vip_motd")
    register_clcmd("say", "handle_say")
   
    // Hook Chains
    RegisterHookChain(RG_CBasePlayer_Spawn, "Fw_PlayerSpawn_Post", 1)
   
    // Cvars
    cvar_enable_multijump = register_cvar("ze_give_vip_multijump", "1")
    cvar_enable_happy_hours = register_cvar("ze_enable_happy_hours", "1")
    cvar_enable_scoreboard_attrib = register_cvar("ze_enable_scoreboard_attrib", "1")
    cvar_vip_damage = register_cvar("ze_vip_damage", "3")
    g_para_3rd_view = register_cvar("ze_3rd_person_view", "1")
    g_parachute_FallSpeed = register_cvar("ze_vip_parachute_fallspeed", "45")
    g_parachute_Detach = register_cvar("ze_vip_parachute_detach", "1")
    cvar_happy_hour_start = register_cvar("ze_happy_hours_start", "00")
    cvar_happy_hour_end = register_cvar("ze_happy_hours_end", "12")
    cvar_vip_flag = register_cvar("ze_vip_flag", "t")
   
}
 
public show_vip_motd(id)
{
    show_motd(id, "vip.txt", "VIP Features")
}
 
public plugin_precache()
{
    engfunc(EngFunc_PrecacheModel, parachute_model)
}
 
public client_putinserver(id) 
{
    if(get_user_flags(id) & VIP_ACCESS) 
    { 
        parachute_reset(id)
        new szName[32] 
        get_user_name(id, szName, charsmax(szName))
        ze_colored_print(0, "!tVIP !g%s !tConnected!y.", szName) 
    }
}
 
public client_disconnect(id)
{
    parachute_reset(id)
}
 
public death_event()
{
    parachute_reset(read_data(2))
    set_view(read_data(2), CAMERA_NONE)
}
 
parachute_reset(id)
{
    if (para_ent[id] > 0)
    {
        if (pev_valid(para_ent[id]))
        {
            engfunc(EngFunc_RemoveEntity, para_ent[id])
        }
    }
 
    has_parachute[id] = false
    para_ent[id] = 0
}
 
public newSpawn(id)
{
    parachute_reset(id)
}
 
public fw_PreThink(id)
{
    if (!is_user_alive(id) || !has_parachute[id] && (get_user_flags(id) & VIP_ACCESS))
        return
 
    new Float:fallspeed = get_pcvar_float(g_parachute_FallSpeed) * -1.0
    new Float:frame
 
    new button = pev(id, pev_button)
    new oldbutton = pev(id, pev_oldbuttons)
    new flags = pev(id, pev_flags)
 
    if (para_ent[id] > 0 && (flags & FL_ONGROUND))
    {
        set_view(id, CAMERA_NONE)
       
        if (get_pcvar_num(g_parachute_Detach))
        {
            if ( pev(para_ent[id],pev_sequence) != 2 )
            {
                set_pev(para_ent[id], pev_sequence, 2)
                set_pev(para_ent[id], pev_gaitsequence, 1)
                set_pev(para_ent[id], pev_frame, 0.0)
                set_pev(para_ent[id], pev_fuser1, 0.0)
                set_pev(para_ent[id], pev_animtime, 0.0)
                return
            }
           
            pev(para_ent[id],pev_fuser1, frame)
            frame += 2.0
            set_pev(para_ent[id],pev_fuser1,frame)
            set_pev(para_ent[id],pev_frame,frame)
           
            if ( frame > 254.0 )
            {
                engfunc(EngFunc_RemoveEntity, para_ent[id])
                para_ent[id] = 0
            }
        }
        else
        {
            engfunc(EngFunc_RemoveEntity, para_ent[id])
            para_ent[id] = 0
        }
        return
    }
 
    if (button & IN_USE)
    {
        new Float:velocity[3]
        pev(id, pev_velocity, velocity)
       
        if (get_pcvar_num(g_para_3rd_view) == 1)
        {
            set_view(id, CAMERA_NONE)
        }
        if (get_pcvar_num(g_para_3rd_view) == 2)
        {
            set_view(id, CAMERA_3RDPERSON)
        }
       
        if (velocity[2] < 0.0)
        {
            if(para_ent[id] <= 0)
            {
                para_ent[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
               
                if(para_ent[id] > 0)
                {
                    set_pev(para_ent[id],pev_classname,"parachute")
                    set_pev(para_ent[id], pev_aiment, id)
                    set_pev(para_ent[id], pev_owner, id)
                    set_pev(para_ent[id], pev_movetype, MOVETYPE_FOLLOW)
                    engfunc(EngFunc_SetModel, para_ent[id], parachute_model)
                    set_pev(para_ent[id], pev_sequence, 0)
                    set_pev(para_ent[id], pev_gaitsequence, 1)
                    set_pev(para_ent[id], pev_frame, 0.0)
                    set_pev(para_ent[id], pev_fuser1, 0.0)
                }
            }
           
            if (para_ent[id] > 0)
            {
                set_pev(id, pev_sequence, 3)
                set_pev(id, pev_gaitsequence, 1)
                set_pev(id, pev_frame, 1.0)
                set_pev(id, pev_framerate, 1.0)
           
                velocity[2] = (velocity[2] + 40.0 < fallspeed) ? velocity[2] + 40.0 : fallspeed
                set_pev(id, pev_velocity, velocity)
               
                if (pev(para_ent[id],pev_sequence) == 0)
                {
                    pev(para_ent[id],pev_fuser1, frame)
                    frame += 1.0
                    set_pev(para_ent[id],pev_fuser1,frame)
                    set_pev(para_ent[id],pev_frame,frame)
                   
                    if (frame > 100.0)
                    {
                        set_pev(para_ent[id], pev_animtime, 0.0)
                        set_pev(para_ent[id], pev_framerate, 0.4)
                        set_pev(para_ent[id], pev_sequence, 1)
                        set_pev(para_ent[id], pev_gaitsequence, 1)
                        set_pev(para_ent[id], pev_frame, 0.0)
                        set_pev(para_ent[id], pev_fuser1, 0.0)
                    }
                }
            }
        }
       
        else if (para_ent[id] > 0)
        {
            engfunc(EngFunc_RemoveEntity, para_ent[id])
            para_ent[id] = 0
        }
    }
   
    else if ((oldbutton & IN_USE) && para_ent[id] > 0 )
    {
        engfunc(EngFunc_RemoveEntity, para_ent[id])
        para_ent[id] = 0
    }
}
 
public Fw_Take_DMG(attacker, Inflictor, victim, Float:Damage, bitsDamageType)
{
    if(!is_user_alive(attacker) || !is_user_alive(victim))
        return
       
    if(get_user_flags(attacker) & ADMIN_LEVEL_H)
    {
          SetHamParamFloat(4, Damage * get_pcvar_float(cvar_vip_damage))
     }
}
 
public Fw_PlayerSpawn_Post(id)
{
    Happy_Hours()
   
    if (get_pcvar_num(cvar_enable_multijump) != 0 && (get_user_flags(id) & VIP_ACCESS))
    {
        ze_give_user_multijump(id)
    }
   
    if (g_bIsHappyHour == true && get_pcvar_num(cvar_enable_happy_hours) != 0)
    {
        new szFlags[2]
        get_pcvar_string(cvar_vip_flag, szFlags, charsmax(szFlags))
        set_user_flags(id, read_flags(szFlags))
    }
   
    set_task(0.1, "Update_Attribute", id, _, _, "a", 10)
}
 
public Update_Attribute(id)
{
    if (get_user_flags(id) & VIP_ACCESS && get_pcvar_num(cvar_enable_scoreboard_attrib) != 0)
    {
        message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
        write_byte(id)
        write_byte(4)
        message_end()
    }
}
 
stock Happy_Hours()
{
    new szTime[3]
    get_time("%H", szTime, charsmax(szTime))
 
    if(get_pcvar_num(cvar_happy_hour_end) > str_to_num(szTime) >= get_pcvar_num(cvar_happy_hour_start))
    {
        g_bIsHappyHour = true
    }
    else
    {
        g_bIsHappyHour = false
    }
}
 
public Tekst(msgId,msgDest,msgEnt){
    new id = get_msg_arg_int(1);
   
    if(!is_user_connected(id))      return PLUGIN_CONTINUE;
   
    if(get_user_flags(id) & ADMIN_LEVEL_H)
    {
        new szTmp[256],szTmp2[256];
        get_msg_arg_string(2,szTmp, charsmax( szTmp ) )
       
        new szPrefix[64] = "^x04[VIP]";
       
        if(!equal(szTmp,"#Cstrike_Chat_All")){
            add(szTmp2,charsmax(szTmp2),szPrefix);
            add(szTmp2,charsmax(szTmp2)," ");
            add(szTmp2,charsmax(szTmp2),szTmp);
        }
        else{
            add(szTmp2,charsmax(szTmp2),szPrefix);
            add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 :  ^x04%s2");
        }
       
        set_msg_arg_string(2,szTmp2);
    }
    return PLUGIN_CONTINUE;
}
 
public PrintText(id)
{
 client_print(id, print_chat, "[VIP] write /wantvip and u will see how get VIP and VIP privilegies.")
}
 
public handle_say(id) {
    new said[192]
    read_args(said,192)
    if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 )
        set_task(0.1,"print_adminlist",id)
    return PLUGIN_CONTINUE
}
 
public print_adminlist(user)
{
    new adminnames[33][32]
    new message[256]
    new contactinfo[256], contact[112]
    new id, count, x, len
   
    for(id = 1 ; id <= maxplayers ; id++)
        if(is_user_connected(id))
            if(get_user_flags(id) & ADMIN_LEVEL_H)
                get_user_name(id, adminnames[count++], 31)
 
    len = format(message, 255, "%s VIP ONLINE: ",COLOR)
    if(count > 0) {
        for(x = 0 ; x < count ; x++) {
            len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
            if(len > 96 ) {
                print_message(user, message)
                len = format(message, 255, "%s ",COLOR)
            }
        }
        print_message(user, message)
    }
    else {
        len += format(message[len], 255-len, "No VIP online.")
        print_message(user, message)
    }
   
    get_cvar_string("amx_contactinfo", contact, 63)
    if(contact[0])  {
        format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
        print_message(user, contactinfo)
    }
}
 
print_message(id, msg[])
{
    message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)
    write_byte(id)
    write_string(msg)
    message_end()
} 

Can Somebody fix it ?
Nobody Is That Busy If They Make Time :roll:

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

#8

Post by Raheem » 7 years ago

You better wait the new parachute version for our mod and then you can include it simply, Just wait.
He who fails to plan is planning to fail

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

#9

Post by Raheem » 7 years ago

Now you simply can use the new native from the Parachute plugin: HERE. Example of how this can be done is:

  1. #include <zombie_escape>
  2. #include <ze_multijump>
  3. #include <ze_parachute>
  4.  
  5. // Defines
  6. #define VIP_ACCESS ADMIN_LEVEL_H
  7.  
  8. // Variables
  9. new bool:g_bIsHappyHour
  10.  
  11. // Cvars
  12. new cvar_enable_multijump, cvar_enable_parachute, cvar_enable_happy_hours, cvar_happy_hour_start, cvar_happy_hour_end, cvar_vip_flag,
  13. cvar_enable_scoreboard_attrib, cvar_vip_connect_notice
  14.  
  15. public plugin_init()
  16. {
  17.     register_plugin("[ZE] VIP System", "1.0", "Raheem")
  18.    
  19.     // Hook Chains
  20.     RegisterHookChain(RG_CBasePlayer_Spawn, "Fw_PlayerSpawn_Post", 1)
  21.    
  22.     // Cvars
  23.     cvar_enable_multijump = register_cvar("ze_give_vip_multijump", "1")
  24.     cvar_enable_parachute = register_cvar("ze_give_vip_parachute", "1")
  25.     cvar_enable_happy_hours = register_cvar("ze_enable_happy_hours", "1")
  26.     cvar_enable_scoreboard_attrib = register_cvar("ze_enable_scoreboard_attrib", "1")
  27.     cvar_vip_connect_notice = register_cvar("ze_enable_connect_notice", "1")
  28.     cvar_happy_hour_start = register_cvar("ze_happy_hours_start", "9")
  29.     cvar_happy_hour_end = register_cvar("ze_happy_hours_end", "12")
  30.     cvar_vip_flag = register_cvar("ze_vip_flag", "t")
  31.    
  32. }
  33.  
  34. public client_putinserver(id)
  35. {
  36.     if (get_user_flags(id) & VIP_ACCESS && get_pcvar_num(cvar_vip_connect_notice) != 0)
  37.     {
  38.         new szName[32]
  39.         get_user_name(id, szName, charsmax(szName))
  40.         ze_colored_print(0, "!tVIP !g%s !tConnected!y.", szName)
  41.     }
  42. }
  43.  
  44. public Fw_PlayerSpawn_Post(id)
  45. {
  46.     Happy_Hours()
  47.    
  48.     if (get_pcvar_num(cvar_enable_multijump) != 0 && (get_user_flags(id) & VIP_ACCESS))
  49.     {
  50.         ze_give_user_multijump(id)
  51.     }
  52.    
  53.     if (get_pcvar_num(cvar_enable_parachute) != 0 && (get_user_flags(id) & VIP_ACCESS))
  54.     {
  55.         ze_give_user_parachute(id)
  56.     }
  57.    
  58.     if (g_bIsHappyHour == true && get_pcvar_num(cvar_enable_happy_hours) != 0)
  59.     {
  60.         new szFlags[2]
  61.         get_pcvar_string(cvar_vip_flag, szFlags, charsmax(szFlags))
  62.         set_user_flags(id, read_flags(szFlags))
  63.     }
  64.    
  65.     set_task(0.1, "Update_Attribute", id, _, _, "a", 10)
  66. }
  67.  
  68. public Update_Attribute(id)
  69. {
  70.     if (get_user_flags(id) & VIP_ACCESS && get_pcvar_num(cvar_enable_scoreboard_attrib) != 0)
  71.     {
  72.         message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"))
  73.         write_byte(id)
  74.         write_byte(4)
  75.         message_end()
  76.     }
  77. }
  78.  
  79. stock Happy_Hours()
  80. {
  81.     new szTime[3]
  82.     get_time("%H", szTime, charsmax(szTime))
  83.  
  84.     if(get_pcvar_num(cvar_happy_hour_end) > str_to_num(szTime) >= get_pcvar_num(cvar_happy_hour_start))
  85.     {
  86.         g_bIsHappyHour = true
  87.     }
  88.     else
  89.     {
  90.         g_bIsHappyHour = false
  91.     }
  92. }
He who fails to plan is planning to fail

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#10

Post by johnnysins2000 » 7 years ago

Thanks Brother Finally :) and sorry about not reading the rules in the plugin section that i posted
Nobody Is That Busy If They Make Time :roll:

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

#11

Post by Raheem » 7 years ago

johnnysins2000 wrote: 7 years ago Thanks Brother Finally :) and sorry about not reading the rules in the plugin section that i posted
Nevermind bro and have fun :D.
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 1 guest