Problem with drop money plugins

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Problem with drop money plugins

Мнение от lantimilan » 30 Май 2018, 21:54

Hello i have one problem when is warmup and when restart live round people can get money in first round it any cvar to disable this to take money in first round just to take when kill players to get money in

Plugin :

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <fakemeta>
#include <cromchat>

#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif

#define PLUGIN	"LS Dhuro Pare"
#define AUTHOR	"c0d3"
#define VERSION	"1.7"

#if cellbits == 32
#define OFFSET_CSMONEY  115
#else
#define OFFSET_CSMONEY  140
#endif

#define OFFSET_LINUX      5

#define MAXENTS 1500

new moneybox[MAXENTS]
new model[] = "models/LS-Paret/ls-paret.mdl"
new money_sound1[] = "LS-Paret/dhuro-para.wav"

new method, ison, m_amount, ran_money, random_nums, money_drop, money_drop_a, fadeon, money_sound, divide, force
//new method6
new g_msgScreenFade
new bool:can_pickup[33]

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	ison = register_cvar("amx_dropmoney","1")
	method = register_cvar("amx_dropmethod","2")
	divide = register_cvar("amx_moneydivide","2")
	m_amount = register_cvar("amx_dropamount","300")
	ran_money = register_cvar("amx_droprandom","300 500 700")
	random_nums = register_cvar("amx_droprandomnums","300 7500")
	money_drop = register_cvar("amx_playerdrop","1")
	money_drop_a = register_cvar("amx_playerdropamount","500")
	fadeon = register_cvar("amx_moneyfade","0")
	money_sound = register_cvar("amx_moneysound","1")
	force = register_cvar("amx_dropforce","10")
	g_msgScreenFade = get_user_msgid("ScreenFade")
	
	register_clcmd("drop","hook_drop")
	
	register_event("DeathMsg", "deatha", "a")
	register_forward(FM_Touch,"player_Touch")
	register_logevent("round_start", 2, "1=Round_Start")
}

public client_connect(id)	can_pickup[id]=true

#if (AMXX_VERSION_NUM < 183)
public client_disconnect(id)
#else
public client_disconnected(id)
#endif
{
	can_pickup[id]=false
}

public plugin_precache()
{
	precache_model(model)
	precache_sound(money_sound1)
}

public hook_drop(id)
{
	if(!get_pcvar_num(ison) || !get_pcvar_num(money_drop))
	return PLUGIN_CONTINUE
	
	new weapon,clip,ammo,money,Float:velo[3]
	weapon = get_user_weapon(id,clip,ammo)
	
	if(weapon == CSW_KNIFE)
	{
		if(fm_get_user_money(id) < get_pcvar_num(money_drop_a))
			money = fm_get_user_money(id)
		else
			money = get_pcvar_num(money_drop_a)
			
		CC_SendMessage(id, "&x01[&x04APS Pare&x01] &x05Ju hodhet &x04%d &x03$", money);
		
		fm_set_user_money(id,fm_get_user_money(id) - money)
		can_pickup[id] = false
		set_task(0.3,"reset_pick",id)
		new start_velo = get_pcvar_num(force) * 15
		new end_velo = get_pcvar_num(force) * 50
		velocity_by_aim(id,random_num(start_velo,end_velo),velo)
		make_money(id,money,velo)
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
}

public reset_pick(id)	can_pickup[id] = true

public deatha() {
	if(!get_pcvar_num(ison))	return PLUGIN_CONTINUE
	
	new money, Float:velo[3]
	new victim = read_data(2)
	new killer = read_data(1)
	
	if(killer && killer != victim)
		fm_set_user_money(killer,fm_get_user_money(killer) - 300)
	
	switch(get_pcvar_num(method)) {
		case 1:{
			money = get_pcvar_num(m_amount)
			if(fm_get_user_money(victim) < money) {
				money = fm_get_user_money(victim)
				fm_set_user_money(victim,0)
			}
			else	fm_set_user_money(victim,fm_get_user_money(victim) - get_pcvar_num(m_amount))
			}
		case 2:{
			new tempmoney = fm_get_user_money(victim)
			if(money != 1) {
				money = (tempmoney / get_pcvar_num(divide))
				fm_set_user_money(victim,fm_get_user_money(victim) - money)
			}
			else {
				fm_set_user_money(victim,0)
				money = 1
			}
		}
		case 3:{
			new maxmoney = fm_get_user_money(victim)
			money = random_num(1,maxmoney)
			fm_set_user_money(victim,fm_get_user_money(victim) - money)
		}
		case 4:{
			new tempmoney2[32]
			get_pcvar_string(ran_money,tempmoney2,31)
			new tempmoney[3][6]
			parse(tempmoney2, tempmoney[0], sizeof tempmoney[] - 1,tempmoney[1], sizeof tempmoney[] - 1,tempmoney[2], sizeof tempmoney[] - 1)
			new num = random_num(1,3)
			switch(num) {
				case 1:{
					money = str_to_num(tempmoney[0])
				}
				case 2:{
					money = str_to_num(tempmoney[1])
				}
				case 3:{
					money = str_to_num(tempmoney[2])
				}
			}
			if(fm_get_user_money(victim) < money) {
				fm_set_user_money(victim,0)
				money = fm_get_user_money(victim)
			}
			else	fm_set_user_money(victim,fm_get_user_money(victim) - money)
			}
		case 5:{
			new tempmoney22[32], num_from, num_to
			get_pcvar_string(random_nums,tempmoney22,31)
			new tempmoney1[2][6]
			parse(tempmoney22, tempmoney1[0], sizeof tempmoney1[] - 1,tempmoney1[1], sizeof tempmoney1[] - 1)
			num_from = str_to_num(tempmoney1[0])
			num_to = str_to_num(tempmoney1[1])
			if(num_to > 16000)	num_to = 16000
			if(num_from < 0)	num_to = 0
			money = random_num(num_from,num_to)
			
			if(fm_get_user_money(victim) < money) {
				fm_set_user_money(victim,0)
				money = fm_get_user_money(victim)
			}
			else	fm_set_user_money(victim,fm_get_user_money(victim) - money)
			}
	}
	make_money(victim,money,velo)
	return PLUGIN_CONTINUE
}

public round_start() {
	new money_ent
	while((money_ent=engfunc(EngFunc_FindEntityByString,money_ent,"classname","pdm_money")) != 0){
		engfunc(EngFunc_RemoveEntity,money_ent)
	}
}


public make_money(id,money,Float:velo[]) {
	new moneybags = money/1000
	new moneyleft = money
	new Float:origin[3]
	new Float:angles[3]
	new Float:mins[3] = {-2.79, -0.0, -6.14}
	new Float:maxs[3] = {2.42, 1.99, 6.35}
	
	if((moneybags * 1000) < money)	moneybags++
	
	for(new i = 0; i < moneybags; ++i) {
		new newent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString,"info_target"))
		if(!is_user_alive(id)) {
			velo[0] = random_float(1.0,150.0)
			velo[1] = random_float(1.0,150.0)
			velo[2] = random_float(1.0,150.0)
		}
		else 
			velo[2] += 100
		
		pev(newent,pev_angles,angles)
		angles[1] += random_num(1,360)
		pev(id,pev_origin,origin)
		set_pev(newent, pev_origin, origin)
		set_pev(newent, pev_classname, "pdm_money")
		engfunc(EngFunc_SetModel, newent, model)
		engfunc(EngFunc_SetSize,newent,mins,maxs)
		set_pev(newent,pev_angles,angles)
		set_pev(newent, pev_solid, SOLID_TRIGGER)
		set_pev(newent,pev_movetype,MOVETYPE_TOSS)
		set_pev(newent, pev_velocity,velo)
		engfunc(EngFunc_DropToFloor,newent)
		
		if(moneyleft == 0)	return FMRES_IGNORED
		
		if(moneyleft < 1000) {
			moneybox[newent]=moneyleft
			moneyleft = 0
			return FMRES_IGNORED
		}
		moneyleft -= 1000
		moneybox[newent]=1000
	}
	return FMRES_IGNORED
}

public player_Touch(touched, toucher) { 
	
	if (!pev_valid(touched) || !is_user_alive(toucher) ||  !get_pcvar_num(ison) || !can_pickup[toucher])
		return FMRES_IGNORED
	
	new classname[32]
	pev(touched, pev_classname, classname, sizeof classname - 1)
	
	if (equali(classname, "pdm_money")) {
		if(fm_get_user_money(toucher) == 16000)	return FMRES_IGNORED
		else if((fm_get_user_money(toucher)+moneybox[touched]) > 16000)		fm_set_user_money(toucher,16000)
		else	fm_set_user_money(toucher,fm_get_user_money(toucher) + moneybox[touched])
		
		CC_SendMessage(toucher, "&x01[&x04APS Pare&x01] &x05Ju morret &x04%d &x03$", moneybox[touched]);
			
		if(get_pcvar_num(money_sound))	client_cmd(toucher,"spk %s",money_sound1)
		
		if(pev_valid(touched))
			engfunc(EngFunc_RemoveEntity,touched)
		
		if(get_pcvar_num(fadeon))
			screen_fade(toucher)
	}
	
	return FMRES_IGNORED
}


public screen_fade(id) {
	message_begin(MSG_ONE, g_msgScreenFade, {0,0,0}, id) 
	write_short(1<<12)
	write_short(1<<12)
	write_short(1<<12)
	write_byte(0)
	write_byte(200)
	write_byte(0)
	write_byte(20)
	message_end()
}


//XxAvalanchexX Stocks
stock fm_set_user_money(id,money,flash=0)
{
	set_pdata_int(id,OFFSET_CSMONEY,money,OFFSET_LINUX);
	
	message_begin(MSG_ONE,get_user_msgid("Money"),{0,0,0},id);
	write_long(money);
	write_byte(flash);
	message_end();
}




stock fm_get_user_money(id)
{
	return get_pdata_int(id,OFFSET_CSMONEY,OFFSET_LINUX);
}

Аватар
1fRaNkkK
Извън линия
Потребител
Потребител
Мнения: 776
Регистриран на: 09 Окт 2016, 15:21
Се отблагодари: 8 пъти
Получена благодарност: 55 пъти

Problem with drop money plugins

Мнение от 1fRaNkkK » 31 Май 2018, 15:21

Not sure where did you get the code but when I search for drop money amxx I get this: https://forums.alliedmods.net/showthread.php?p=600758 first and there is the same code, at least same cvars and the author is different, don't really know what's going on but I suggest you to use the plugin which is approved by alliedmods.

About your question every cvar in the topic in alliedmods has a description, I don't know if there's cvar to solve your problem but read it, maybe you'll find something useful :surrender:

Edit: I get it now: c0d3 - same nickname in your avatar... well what can I say, at least we're not the only ones... :hooray:

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Problem with drop money plugins

Мнение от lantimilan » 31 Май 2018, 21:15

Yes i set sometimes i not like to steal plugins from my ftp server i want to make different and when my staff search amx_plugins cant find this plugin because i fixed try again fixed some code change some other and for this reason i change not for any reason just dont steal plugin

You can see this plugin : http://prntscr.com/jp6bba i have original author just change name plugins to safe for not steal from my server and plugins OciXCrom plugins : http://prntscr.com/jp6c3l im not try to win money just i dont like to shared my plugins from my server this is only reason who want to understand okey who not want you can ignore this topic or can closed admin if considered bad i told my reason
Последно промяна от lantimilan на 31 Май 2018, 22:02, променено общо 1 път.

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 424
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 31 пъти
Получена благодарност: 3 пъти

Problem with drop money plugins

Мнение от lantimilan » 02 Юни 2018, 00:09

Closed this thread

Заключено
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 8 госта