Raised This Month: $70 Target: $400
 17% 

Subplugin Submission [ZP] Extra Item: Golden Ak - 47 v1.1 Fix


Post New Thread Reply   
 
Thread Tools Display Modes
akkis
Junior Member
Join Date: Jun 2014
Old 06-27-2014 , 13:01   Re: [ZP] Extra Item: Golden Ak - 47 v1.1 Fix
Reply With Quote #131

Quote:
Originally Posted by Depresie View Post
zp_goldenak_dmg_multiplier 5
zp_goldenak_gold_bullets 1
zp_goldenak_cost 30
zp_goldenak_custom_model 1
zp_goldenak_unlimited_clip 1

copy this in amxx.cfg


still not working against bots
akkis is offline
akkis
Junior Member
Join Date: Jun 2014
Old 06-27-2014 , 13:11   Re: [ZP] Extra Item: Golden Ak - 47 v1.1 Fix
Reply With Quote #132

i also tried using ham_register_bot_cz.sma file compiled it and used it and cs crashed
akkis is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 06-28-2014 , 11:24   Re: [ZP] Extra Item: Golden Ak - 47 v1.1 Fix
Reply With Quote #133

Are you sure something like "ham_register_bot_cz" even exists ? (officially ?), cuz all i know is "cs_ham_bots_api"..

And even if it does, just compiling it and using it does nothing, you have to edit each and every extra that you want should work with bots and use RegisterHamBots in it.

And dont double post, use the edit button. :\
__________________
You will find everything u need :-

Last edited by Catastrophe; 06-28-2014 at 11:24.
Catastrophe is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-19-2015 , 18:41   Re: [ZP] Extra Item: Golden Ak - 47 v1.1 Fix
Reply With Quote #134

Have a problem with this ak in ZP 43, the damage is not multiplied , the version of my Amx mod is 1.8.2 , my addon is the zombie plague Fix5a , someone knows why not be multiplying ?
sorry for my bad english

Last edited by CrazY.; 09-21-2015 at 12:45.
CrazY. is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 05-20-2015 , 12:35   Re: [ZP] Extra Item: Golden Ak - 47 v1.1 Fix
Reply With Quote #135

Do you get any errors?
__________________
Problem with ZP?
ZP Helper!
zmd94 is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-20-2015 , 13:04   Re: [ZP] Extra Item: Golden Ak - 47 v1.1 Fix
Reply With Quote #136

Quote:
Originally Posted by zmd94 View Post
Do you get any errors?
Well, to buy this normal just is not multiplying the damage , for example normally would damage 500 depending on the shot, only this with the same damage normal ak :/

Last edited by CrazY.; 09-21-2015 at 12:45.
CrazY. is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 05-20-2015 , 21:45   Re: [ZP] Extra Item: Golden Ak - 47 v1.1 Fix
Reply With Quote #137

Just use below plugin:

https://forums.alliedmods.net/showpo...&postcount=230
__________________
Problem with ZP?
ZP Helper!
zmd94 is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-21-2015 , 12:44   Re: [ZP] Extra Item: Golden Ak - 47 v1.1 Fix
Reply With Quote #138

zmd94 , already fixed the error, the bots does not support ham_takedamage , just add cs_ham_bots_api that works , thanks anyway
__________________





Last edited by CrazY.; 09-21-2015 at 12:48.
CrazY. is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 09-21-2015 , 12:46   Re: [ZP] Extra Item: Golden Ak - 47 v1.1 Fix
Reply With Quote #139

Quote:
Originally Posted by akkis View Post
i also tried using ham_register_bot_cz.sma file compiled it and used it and cs crashed
Guy , try this code:

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

#define is_valid_player(%1) (1 <= %1 <= 32)

new AK_V_MODEL[64] = "models/zombie_plague/v_golden_ak47.mdl"
new AK_P_MODEL[64] = "models/zombie_plague/p_golden_ak47.mdl"

/* Pcvars */
new cvar_dmgmultiplier, cvar_goldbullets,  cvar_custommodel, cvar_uclip

// Item ID
new g_itemid

new bool:g_HasAk[33]

new g_hasZoom[ 33 ]
new bullets[ 33 ]

// Sprite
new m_spriteTexture

const Wep_ak47 = ((1<<CSW_AK47))

public plugin_init()
{
	
	/* CVARS */
	cvar_dmgmultiplier = register_cvar("zp_goldenak_dmg_multiplier", "5")
	cvar_custommodel = register_cvar("zp_goldenak_custom_model", "1")
	cvar_goldbullets = register_cvar("zp_goldenak_gold_bullets", "1")
	cvar_uclip = register_cvar("zp_goldenak_unlimited_clip", "1")
	
	// Register The Plugin
	register_plugin("[ZP] Extra: Golden Ak 47", "1.1", "AlejandroSk")
	// Register Zombie Plague extra item
	g_itemid = zp_register_extra_item("Golden Ak 47", 30, ZP_TEAM_HUMAN)
	// Death Msg
	register_event("DeathMsg", "Death", "a")
	// Weapon Pick Up
	register_event("WeapPickup","checkModel","b","1=19")
	// Current Weapon Event
	register_event("CurWeapon","checkWeapon","be","1=1")
	register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
	// Ham TakeDamage
	RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
	RegisterHamBots(Ham_TakeDamage, "fw_TakeDamage")
	register_forward( FM_CmdStart, "fw_CmdStart" )
	RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)
	
}

public client_connect(id)
{
	g_HasAk[id] = false
}

public client_disconnect(id)
{
	g_HasAk[id] = false
}

public Death()
{
	g_HasAk[read_data(2)] = false
}

public fwHamPlayerSpawnPost(id)
{
	g_HasAk[id] = false
}

public plugin_precache()
{
	precache_model(AK_V_MODEL)
	precache_model(AK_P_MODEL)
	m_spriteTexture = precache_model("sprites/dot.spr")
	precache_sound("weapons/zoom.wav")
}

public zp_user_infected_post(id)
{
	if (zp_get_user_zombie(id))
	{
		g_HasAk[id] = false
	}
}

public checkModel(id)
{
	if ( zp_get_user_zombie(id) )
		return PLUGIN_HANDLED
	
	new szWeapID = read_data(2)
	
	if ( szWeapID == CSW_AK47 && g_HasAk[id] == true && get_pcvar_num(cvar_custommodel) )
	{
		set_pev(id, pev_viewmodel2, AK_V_MODEL)
		set_pev(id, pev_weaponmodel2, AK_P_MODEL)
	}
	return PLUGIN_HANDLED
}

public checkWeapon(id)
{
	new plrClip, plrAmmo, plrWeap[32]
	new plrWeapId
	
	plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
	
	if (plrWeapId == CSW_AK47 && g_HasAk[id])
	{
		checkModel(id)
	}
	else 
	{
		return PLUGIN_CONTINUE
	}
	
	if (plrClip == 0 && get_pcvar_num(cvar_uclip))
	{
		// If the user is out of ammo..
		get_weaponname(plrWeapId, plrWeap, 31)
		// Get the name of their weapon
		give_item(id, plrWeap)
		engclient_cmd(id, plrWeap) 
		engclient_cmd(id, plrWeap)
		engclient_cmd(id, plrWeap)
	}
	return PLUGIN_HANDLED
}



public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
    if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_AK47 && g_HasAk[attacker] )
    {
        SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )
    }
}

public fw_CmdStart( id, uc_handle, seed )
{
	if( !is_user_alive( id ) ) 
		return PLUGIN_HANDLED
	
	if( ( get_uc( uc_handle, UC_Buttons ) & IN_ATTACK2 ) && !( pev( id, pev_oldbuttons ) & IN_ATTACK2 ) )
	{
		new szClip, szAmmo
		new szWeapID = get_user_weapon( id, szClip, szAmmo )
		
		if( szWeapID == CSW_AK47 && g_HasAk[id] == true && !g_hasZoom[id] == true)
		{
			g_hasZoom[id] = true
			cs_set_user_zoom( id, CS_SET_AUGSG552_ZOOM, 0 )
			emit_sound( id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100 )
		}
		
		else if ( szWeapID == CSW_AK47 && g_HasAk[id] == true && g_hasZoom[id])
		{
			g_hasZoom[ id ] = false
			cs_set_user_zoom( id, CS_RESET_ZOOM, 0 )
			
		}
		
	}
	return PLUGIN_HANDLED
}


public make_tracer(id)
{
	if (get_pcvar_num(cvar_goldbullets))
	{
		new clip,ammo
		new wpnid = get_user_weapon(id,clip,ammo)
		new pteam[16]
		
		get_user_team(id, pteam, 15)
		
		if ((bullets[id] > clip) && (wpnid == CSW_AK47) && g_HasAk[id]) 
		{
			new vec1[3], vec2[3]
			get_user_origin(id, vec1, 1) // origin; your camera point.
			get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)
			
			
			//BEAMENTPOINTS
			message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
			write_byte (0)     //TE_BEAMENTPOINTS 0
			write_coord(vec1[0])
			write_coord(vec1[1])
			write_coord(vec1[2])
			write_coord(vec2[0])
			write_coord(vec2[1])
			write_coord(vec2[2])
			write_short( m_spriteTexture )
			write_byte(1) // framestart
			write_byte(5) // framerate
			write_byte(2) // life
			write_byte(10) // width
			write_byte(0) // noise
			write_byte( 255 )     // r, g, b
			write_byte( 215 )       // r, g, b
			write_byte( 0 )       // r, g, b
			write_byte(200) // brightness
			write_byte(150) // speed
			message_end()
		}
	
		bullets[id] = clip
	}
	
}

public zp_extra_item_selected(player, itemid)
{
	if ( itemid == g_itemid )
	{
		if ( user_has_weapon(player, CSW_AK47) )
		{
			drop_prim(player)
		}
		
		give_item(player, "weapon_ak47")
		client_print_color(player, "^4[ZP] ^1Voce comprou a ^4Golden Ak-47^1.")
		g_HasAk[player] = true;
	}
}

stock drop_prim(id) 
{
	new weapons[32], num
	get_user_weapons(id, weapons, num)
	for (new i = 0; i < num; i++) {
		if (Wep_ak47 & (1<<weapons[i])) 
		{
			static wname[32]
			get_weaponname(weapons[i], wname, sizeof wname - 1)
			engclient_cmd(id, "drop", wname)
		}
	}
}

stock client_print_color(const id,const input[], any:...)
{
	new msg[191], players[32], count = 1; vformat(msg,190,input,3);
	replace_all(msg,190,"/g","^4");    // green
	replace_all(msg,190,"/y","^1");    // normal
	replace_all(msg,190,"/t","^3");    // team
        
	if (id) players[0] = id; else get_players(players,count,"ch");
        
	for (new i=0;i<count;i++)
	{
		if (is_user_connected(players[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
			write_byte(players[i]);
			write_string(msg);
			message_end();
		}
	}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/
be sure to have the module and the plugin cs_ham_bots_api to work properly.
__________________





Last edited by CrazY.; 09-21-2015 at 12:47.
CrazY. is offline
NTARIS
Junior Member
Join Date: Dec 2020
Old 01-28-2021 , 04:39   Re: [ZP] Extra Item: Golden Ak - 47 v1.1 Fix
Reply With Quote #140

*Fixed bug with 0 BP ammo

I think alejandro (MAY) removed the required line for that on propose here is the solution to the code.

Code:
public zp_extra_item_selected(player, itemid)
{
    if ( itemid == g_itemid )
    {
        if ( user_has_weapon(player, CSW_AK47) )
        {
            drop_prim(player)
        }
        
        give_item(player, "weapon_ak47")
        cs_set_user_bpammo(player, CSW_AK47, 90) 
        client_print(player, print_chat, "[ZP] You bought Golden AK-47")
        g_Hasawp[player] = true;
    }
}
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_goldenak.sma - 60 views - 6.0 KB)

Last edited by NTARIS; 01-31-2021 at 07:06. Reason: BUG FIX 2020
NTARIS is offline
Reply


Thread Tools
Display Modes

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 19:00.


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