Raised This Month: $51 Target: $400
 12% 

[help] need knife on this script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zm_Mnml
Junior Member
Join Date: Nov 2014
Old 12-07-2014 , 17:30   [help] need knife on this script
Reply With Quote #1

after this zombie uses ammo he has no knife to swap to, also when you right click the scout doesnt zoom in

Code:
#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <cstrike>
#include <fun>

new g_zclassid1, cvar_ammo, cvar_fov

new const model_weapon_scout[] = "models/v_scout.mdl"
new const model_weapon_scout_p[] = "models/p_scout.mdl"

new g_IsSniperClasses[33]

new g_zombies_fov

public plugin_init()
{
	register_plugin( "[ZP] Class: Sniper Zombie", "0.3", "Zombie-rus" )
	
	register_event ( "WeapPickup", "ZombieGun", "b", "1=19" )
	
	cvar_ammo = register_cvar( "zp_ammo_bullets", "4" )
	cvar_fov = register_cvar( "zp_class_fov", "135" )
}

public plugin_precache()
{
	g_zclassid1 = zp_register_zombie_class( "Sniper Zombie", "Can shoot and infect", "zombie_source", "v_knife_zombie.mdl", 2000, 270, 1.0, 0.35 )
	
	precache_model ( model_weapon_scout_p )
	precache_model ( model_weapon_scout )
}


public plugin_cfg()
{
	g_zombies_fov = get_cvar_pointer( "zp_zombie_fov" )
}

public zp_user_infected_post( id, infector )
{
	if ( zp_get_user_zombie_class ( id ) == g_zclassid1 )
	{
		g_IsSniperClasses[ id ] = 1;
		
		strip_user_weapons( id )
		
		give_item( id, "weapon_scout" )
		cs_set_user_bpammo( id, CSW_SCOUT, get_pcvar_num ( cvar_ammo ) ) 
		
		msg_one_unreliable ( id )
	}
}

public ZombieGun ( id )
{
	if ( !zp_get_user_zombie ( id ) )
		return PLUGIN_HANDLED;
	
	new WepID = read_data ( 2 )
	
	if ( WepID == CSW_SCOUT && g_IsSniperClasses[ id ] == 1 )
	{
		set_pev ( id, pev_viewmodel2, model_weapon_scout )
		set_pev ( id, pev_viewmodel2, model_weapon_scout_p )
	}
	
	return PLUGIN_HANDLED;
}

public msg_one_unreliable( id )
{
	if ( zp_get_user_zombie_class ( id ) == g_zclassid1 )
	{
		message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SetFOV"), {0,0,0}, id )
		write_byte( get_pcvar_num ( cvar_fov ) )
		message_end( )
	}
	else 
	{
		message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SetFOV" ), {0,0,0}, id )
		write_byte( g_zombies_fov ) // fov angle
		message_end( )
	}
}  
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/

Last edited by Zm_Mnml; 12-07-2014 at 17:32.
Zm_Mnml is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-08-2014 , 09:40   Re: [help] need knife on this script
Reply With Quote #2

Just change this:
Code:
public zp_user_infected_post( id, infector )
{
    if ( zp_get_user_zombie_class ( id ) == g_zclassid1 )
    {
        g_IsSniperClasses[ id ] = 1;
        
        strip_user_weapons( id )
        
        give_item( id, "weapon_scout" )
        cs_set_user_bpammo( id, CSW_SCOUT, get_pcvar_num ( cvar_ammo ) ) 
        
        msg_one_unreliable ( id )
    }
}
-->
Code:
public zp_user_infected_post( id, infector )
{
    if ( zp_get_user_zombie_class ( id ) == g_zclassid1 )
    {
        g_IsSniperClasses[ id ] = 1;
        
        strip_user_weapons( id )
        
        give_item( id, "weapon_knife" )
        give_item( id, "weapon_scout" )
        cs_set_user_bpammo( id, CSW_SCOUT, get_pcvar_num ( cvar_ammo ) ) 
        
        msg_one_unreliable ( id )
    }
}
zmd94 is offline
Zm_Mnml
Junior Member
Join Date: Nov 2014
Old 12-08-2014 , 10:37   Re: [help] need knife on this script
Reply With Quote #3

Quote:
Originally Posted by zmd94 View Post
Just change this:
Code:
public zp_user_infected_post( id, infector )
{
    if ( zp_get_user_zombie_class ( id ) == g_zclassid1 )
    {
        g_IsSniperClasses[ id ] = 1;
        
        strip_user_weapons( id )
        
        give_item( id, "weapon_scout" )
        cs_set_user_bpammo( id, CSW_SCOUT, get_pcvar_num ( cvar_ammo ) ) 
        
        msg_one_unreliable ( id )
    }
}
-->
Code:
public zp_user_infected_post( id, infector )
{
    if ( zp_get_user_zombie_class ( id ) == g_zclassid1 )
    {
        g_IsSniperClasses[ id ] = 1;
        
        strip_user_weapons( id )
        
        give_item( id, "weapon_knife" )
        give_item( id, "weapon_scout" )
        cs_set_user_bpammo( id, CSW_SCOUT, get_pcvar_num ( cvar_ammo ) ) 
        
        msg_one_unreliable ( id )
    }
}
well that was easy, thx man
Zm_Mnml is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-08-2014 , 10:39   Re: [help] need knife on this script
Reply With Quote #4

So, your problem is solved?
zmd94 is offline
Zm_Mnml
Junior Member
Join Date: Nov 2014
Old 12-08-2014 , 11:08   Re: [help] need knife on this script
Reply With Quote #5

Quote:
Originally Posted by zmd94 View Post
So, your problem is solved?
yep, gonna change weapon to deagle and make this class for vips
Zm_Mnml is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-08-2014 , 11:12   Re: [help] need knife on this script
Reply With Quote #6

Alright. ;)
zmd94 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode