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

i really need help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
redouane
Junior Member
Join Date: Jan 2019
Old 01-17-2019 , 15:02   i really need help!
Reply With Quote #1

So i'm using mod 5.0.8 and i have a problem with ammo pack i mean extra items when i buy something it doesn't take any ammopack i just get it free even if you see it cost 50 ammo for example but when i buy it i get it free and i dont lose any ammo pack any situation ? i don't know what i have to do or where i can fix it so please any help?

Ahhh another thing it work normal with vipmenu it accully take ammopack for a item but it doesn't work on normal extra items.
redouane is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 01-17-2019 , 16:10   Re: i really need help!
Reply With Quote #2

Ammopack in amxx base? This musst be new.
__________________

Mordekay is offline
Old 01-17-2019, 17:15
redouane
This message has been deleted by redouane. Reason: its long
Old 01-17-2019, 17:17
redouane
This message has been deleted by redouane. Reason: long
redouane
Junior Member
Join Date: Jan 2019
Old 01-17-2019 , 17:19   Re: i really need help!
Reply With Quote #3

This is my zp50_ammopacks

Code:
/*================================================================================
	
	-----------------------
	-*- [ZP] Ammo Packs -*-
	-----------------------
	
	This plugin is part of Zombie Plague Mod and is distributed under the
	terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
	
================================================================================*/

#include <amxmodx>
#include <fakemeta>
#include <zp50_core>

#define is_user_valid(%1) (1 <= %1 <= g_MaxPlayers)

#define TASK_HIDEMONEY 100
#define ID_HIDEMONEY (taskid - TASK_HIDEMONEY)

// CS Player PData Offsets (win32)
const PDATA_SAFE = 2
const OFFSET_CSMONEY = 115

const HIDE_MONEY_BIT = (1<<5)

#define MAXPLAYERS 32

new g_MaxPlayers
new g_MsgHideWeapon, g_MsgCrosshair
new g_AmmoPacks[MAXPLAYERS+1]

new cvar_starting_ammo_packs, cvar_disable_money

public plugin_init()
{
	register_plugin("[ZP] Ammo Packs", ZP_VERSION_STRING, "ZP Dev Team")
	
	g_MaxPlayers = get_maxplayers()
	g_MsgHideWeapon = get_user_msgid("HideWeapon")
	g_MsgCrosshair = get_user_msgid("Crosshair")
	
	cvar_starting_ammo_packs = register_cvar("zp_starting_ammo_packs", "5")
	cvar_disable_money = register_cvar("zp_disable_money", "0")
	
	register_event("ResetHUD", "event_reset_hud", "be")
	register_message(get_user_msgid("Money"), "message_money")
}

public plugin_natives()
{
	register_library("zp50_ammopacks")
	register_native("zp_ammopacks_get", "native_ammopacks_get")
	register_native("zp_ammopacks_set", "native_ammopacks_set")
}

public native_ammopacks_get(plugin_id, num_params)
{
	new id = get_param(1)
	
	if (!is_user_valid(id))
	{
		log_error(AMX_ERR_NATIVE, "[ZP] Invalid Player (%d)", id)
		return -1;
	}
	
	return g_AmmoPacks[id];
}

public native_ammopacks_set(plugin_id, num_params)
{
	new id = get_param(1)
	
	if (!is_user_valid(id))
	{
		log_error(AMX_ERR_NATIVE, "[ZP] Invalid Player (%d)", id)
		return false;
	}
	
	new amount = get_param(2)
	
	g_AmmoPacks[id] = amount
	return true;
}

public client_putinserver(id)
{
	g_AmmoPacks[id] = get_pcvar_num(cvar_starting_ammo_packs)
}

public client_disconnect(id)
{
	remove_task(id+TASK_HIDEMONEY)
}

public event_reset_hud(id)
{
	// Hide money?
	if (get_pcvar_num(cvar_disable_money))
		set_task(0.1, "task_hide_money", id+TASK_HIDEMONEY)
}

// Hide Player's Money Task
public task_hide_money(taskid)
{
	// Hide money
	message_begin(MSG_ONE, g_MsgHideWeapon, _, ID_HIDEMONEY)
	write_byte(HIDE_MONEY_BIT) // what to hide bitsum
	message_end()
	
	// Hide the HL crosshair that's drawn
	message_begin(MSG_ONE, g_MsgCrosshair, _, ID_HIDEMONEY)
	write_byte(0) // toggle
	message_end()
}

public message_money(msg_id, msg_dest, msg_entity)
{
	// Disable money setting enabled?
	if (!get_pcvar_num(cvar_disable_money))
		return PLUGIN_CONTINUE;
	
	fm_cs_set_user_money(msg_entity, 0)
	return PLUGIN_HANDLED;
}

// Set User Money
stock fm_cs_set_user_money(id, value)
{
	// Prevent server crash if entity's private data not initalized
	if (pev_valid(id) != PDATA_SAFE)
		return;
	
	set_pdata_int(id, OFFSET_CSMONEY, value)
}
redouane is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 01-17-2019 , 18:11   Re: i really need help!
Reply With Quote #4

There's nothing to do with zp50_ammopacks. The problem should be in zp50_items_ammopacks.
__________________








CrazY. is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-18-2019 , 07:35   Re: i really need help!
Reply With Quote #5

What Mordekay tried to put in your head is that this section is for problems regarding AMXX itself or its default plugins. For a problem with a specific third-party plugin, post in the plugin's thread.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
redouane
Junior Member
Join Date: Jan 2019
Old 01-18-2019 , 09:36   Re: i really need help!
Reply With Quote #6

i fixed it guys thank you!!
redouane 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 11:25.


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