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

Edit plugin biohazard level


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BiohazardLucifer
Member
Join Date: Dec 2015
Old 12-29-2015 , 03:55   Edit plugin biohazard level
Reply With Quote #1

Hi,i have a plugin and if you can to edit..

HTML Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <nvault>
#include <dhudmessage>
#include <biohazard>

static const
PLUGIN[] = "",
VERSION[] = "1.0",
AUTHOR[] = "scosmyn";

new Xp[33],Level[33],g_vault
new minutes = 180
new bool:Have_UP[33]

public plugin_init() {
	register_plugin(PLUGIN,VERSION,AUTHOR);
	
	RegisterHam(Ham_Spawn,"player","fwd_spawn",1);
	
	register_event("DeathMsg","ev_msg","a");
	register_event("CurWeapon","ev_weapon","be","1=1");
	
	g_vault = nvault_open("lvlmod");
	
	set_task(20.0,"save",_,_,_,"b")
}
public getNeededPacks(id)
{
	switch(Level[id])
	{
		      case 1 : return 200
			case 2 : return 400
			case 3 : return 600
			case 4 : return 800
			case 5 : return 1000
			case 6 : return 1200
			case 7 : return 1400
			case 8 : return 1600
			case 9 : return 1800
			case 10 : return 2000
			case 11 : return 2200
			case 12 : return 2400
			case 13 : return 2600
			case 14 : return 2800
			case 15 : return 3000
		}
}
public save(id) {
	if(get_maxplayers() < 1)
		return;
	else
		SaveData(id)
}
public client_putinserver(id)
{
	LoadData(id)
	set_task(1.0,"hud_stats",id+0x138F,_,_,"b")
	if(Level[id] == 0)
	{
		Level[id] = 1
	}
}
public plugin_natives()
{
	register_native("bio_get_level", "get_level", 1)
}
public get_level(id)
{
	return Level[id]
}
public hud_stats(id) {
	id -= 0x138F
	if(is_user_alive(id) && !is_user_bot(id) && Level[id] < 20)
	{
		set_dhudmessage(238,216,16, 0.0,0.20,0,6.0, 1.0)
		show_dhudmessage(id, "[XP: %d/%d]   |   [LVL: %d]",Xp[id], getNeededPacks(id),Level[id])
	}
	else if(is_user_alive(id) && !is_user_bot(id) && Level[id] > 19)
	{
		set_dhudmessage(238,216,16, 0.0,0.20,0,6.0, 1.0)
		show_dhudmessage(id, "[XP: COMPLET/COMPLET]   |   [LVL: %d]",Level[id])
	}
}
public client_disconnect(id) {
	remove_task(id+0x138F)
	remove_task(id)
	SaveData(id)
	Level[id] = 0
	Xp[id] = 0
}
public ev_weapon(id) {
	if(!is_user_zombie(id))
		set_user_maxspeed(id,get_user_maxspeed(id) + (Level[id] * 2))
	else
		return
}
public ev_msg( ) {
	static kiler,victim
	
	kiler = read_data(1)
	victim = read_data(2)
	
	if(kiler == victim || !is_user_alive(kiler))
		return
	
	if(kiler != victim)
		Xp[kiler]++
	
	while(Xp[kiler] >= getNeededPacks(kiler))
	{
		Level[kiler]++;
		Xp[kiler] = 0
		color(kiler,"!team[LevelMod]!yFelicitari,tocmai ai ajuns la level %i",Level[kiler])
		
		if(is_user_zombie(kiler))
		{
			set_user_health(kiler,get_user_health(kiler) + 60 * Level[kiler])
			set_user_armor(kiler,get_user_armor(kiler) + 20 * Level[kiler])
		}
		else
		{
			set_user_health(kiler,get_user_health(kiler) + 5 * Level[kiler])
			ev_weapon(kiler)
		}
		return
	}
	
	SaveData(kiler)
}
public fwd_spawn(id) {
	if(!is_user_alive(id))
		return HAM_IGNORED
	
	Have_UP[id] = false
	
	if(task_exists(id))
		remove_task(id)
	
	set_task(2.1,"upgrade",id,_,_,"a",minutes)
	return HAM_HANDLED
}
public upgrade(id) {
	if(Have_UP[id])
		return
	
	if(is_user_zombie(id))
	{
		Have_UP[id] = true
		set_user_health(id,get_user_health(id) + 60 * Level[id])
		set_user_armor(id,get_user_armor(id) + 20 * Level[id])
	}
	else
	{
		Have_UP[id] = true
		set_user_health(id,get_user_health(id) + 5 * Level[id])
		ev_weapon(id)
	}
}

public SaveData(id)
{
	new vaultkey[64],vaultdata[256],name[32]
	get_user_name(id,name,charsmax(name))
	format(vaultkey,63,"%s-Mod",name)
	format(vaultdata,255,"%i#%i#",Xp[id],Level[id])
	nvault_set(g_vault,vaultkey,vaultdata)
	return 0
}

public LoadData(id) {
	new vaultkey[64],vaultdata[256],name[32]
	get_user_name(id,name,charsmax(name))
	format(vaultkey,63,"%s-Mod",name)
	format(vaultdata,255,"%i#%i#",Xp[id],Level[id])
	
	nvault_get(g_vault,vaultkey,vaultdata,255)
	replace_all(vaultdata, 255, "#", " ")
	new XP[32], LEVEL[32]
	parse(vaultdata, XP, 31, LEVEL, 31)
	Xp[id] = str_to_num(XP)
	Level[id] = str_to_num(LEVEL)
	return 0
}
public event_infect(victim, attacker) {
	if(is_user_alive(victim))
	{
		set_user_health(victim,get_user_health(victim) + 60 * Level[victim])
		set_user_armor(victim,get_user_armor(victim) + 20 * Level[victim])
	}
	Xp[attacker]++
	if(Xp[attacker] >= getNeededPacks(attacker))
	{
		Level[attacker]++;
		Xp[attacker] = 0
		color(attacker,"!team[LevelMod]!yFelicitari,tocmai ai ajuns la level %i",Level[attacker])
	}
	SaveData(attacker)
	
}
public plugin_end() nvault_close(g_vault)

stock color( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]
	
	static msg[ 191 ]
	vformat( msg, 190, input, 3 )
	
	replace_all( msg, 190, "!g", "^4" ) //- verde
	replace_all( msg, 190, "!y", "^1" ) //- galben
	replace_all( msg, 190, "!team", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal
	
	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\\ lang1048\\ f0\\ fs16 \n\\ par }
*/

1. It has trouble saving the name exp/level ..
2. It has bug catch fire your weapon when speed..
3. Add comadn setlevel .. amx_setlevel :-?
4. add command chat.. say "/level nick" look at player level
BiohazardLucifer is offline
Send a message via Yahoo to BiohazardLucifer Send a message via Skype™ to BiohazardLucifer
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 12-29-2015 , 04:30   Re: Edit plugin biohazard level
Reply With Quote #2

Wrong section bro, post in AMX section. (reported topic)
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
BiohazardLucifer
Member
Join Date: Dec 2015
Old 12-29-2015 , 04:39   Re: Edit plugin biohazard level
Reply With Quote #3

Please moderator to move a topic where to ..

Last edited by BiohazardLucifer; 12-29-2015 at 04:39.
BiohazardLucifer is offline
Send a message via Yahoo to BiohazardLucifer Send a message via Skype™ to BiohazardLucifer
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 13:03.


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