Modificare plugin [surf]

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
likepro
Membru, skill 0
Membru, skill 0
Posts: 44
Joined: 01 Mar 2013, 17:27
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 10 times
Been thanked: 7 times
Contact:

06 Mar 2013, 18:46

Am si eu un sma si din pacate acesta nu iti mai da voie pe SURF sa ai armele awp si seringa, le poti avea dar nu poti pune zoom ca iti arunca arma automat! am obs ca e de la acest plugin fiind ca , cand l-am scos mergea si dupa ce l-am pus nu mai mrg zoom! sper sa fie usor de rezolvat:D
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
#include <fakemeta>

/* Who made this bad coded plugin? */
#define PLUGIN	"SURF XP MOD"
#define AUTHOR	"Ardivaba"
#define VERSION	"1.0"

/* Lets define some illegal stuff */
#define TUTORIAL 1001
#define TASK_TUT 1111

/* What is the sound of the message? */
#define MSOUND "items/nvg_off.wav"

/* Enum for tutor colors */
enum
{
	RED = 1,
	BLUE,
	YELLOW,
	GREEN
}

/* Precache array for tutor */
new const g_TutorPrecache[][] = {
	"gfx/career/icon_!.tga",
	"gfx/career/icon_!-bigger.tga",
	"gfx/career/icon_i.tga",
	"gfx/career/icon_i-bigger.tga",
	"gfx/career/icon_skulls.tga",
	"gfx/career/round_corner_ne.tga",
	"gfx/career/round_corner_nw.tga",
	"gfx/career/round_corner_se.tga",
	"gfx/career/round_corner_sw.tga",
	"resource/TutorScheme.res",
	"resource/UI/TutorTextWindow.res"
}

/* Some new stuff for tutor */
new g_MsgTutor
new g_MsgTutClose

/* gCvars :( */
new gCvarNozoom

/* So many levels...oh my f**in god */
new const LEVELS[200] =
{
	50,
	100,
	200,
	400,
	600,
	800,
	1000,
	1200,
	1400,
	1600,
	1800,
	2000,
	2200,
	2400,
	2600,
	2800,
	3000,
	3200,
	3400,
	3600,
	3800,
	4000,
	4200,
	4400,
	4600,
	4800,
	5000,
	5200,
	5400,
	5600,
	5800,
	6000,
	6200,
	6400,
	6600,
	6800,
	7000,
	7200,
	7400,
	7600,
	7800,
	8000,
	8200,
	8400,
	8600,
	8800,
	9000,
	9200,
	9400,
	9600,
	9800,
	10000,
	10200,
	10400,
	10600,
	10800,
	11000,
	11200,
	11400,
	11600,
	11800,
	12000,
	12200,
	12400,
	12600,
	12800,
	13000,
	13200,
	13400,
	13600,
	13800,
	14000,
	14200,
	14400,
	14600,
	14800,
	15000,
	15200,
	15400,
	15600,
	15800,
	16000,
	16200,
	16400,
	16600,
	16800,
	17000,
	17200,
	17400,
	17600,
	17800,
	18000,
	18200,
	18400,
	18600,
	18800,
	19000,
	19200,
	19400,
	19600,
	19800,
	20000,
	20200,
	20400,
	20600,
	20800,
	21000,
	21200,
	21400,
	21600,
	21800,
	22000,
	22200,
	22400,
	22600,
	22800,
	23000,
	23200,
	23400,
	23600,
	23800,
	24000,
	24200,
	24400,
	24600,
	24800,
	25000,
	25200,
	25400,
	25600,
	25800,
	26000,
	26200,
	26400,
	26600,
	26800,
	27000,
	27200,
	27400,
	27600,
	27800,
	28000,
	28200,
	28400,
	28600,
	28800,
	29000,
	29200,
	29400,
	29600,
	29800,
	30000,
	30200,
	30400,
	30600,
	30800,
	31000,
	31200,
	31400,
	31600,
	31800,
	32000,
	32200,
	32400,
	32600,
	32800,
	33000,
	33200,
	33400,
	33600,
	33800,
	34000,
	34200,
	34400,
	34600,
	34800,
	35000,
	35200,
	35400,
	35600,
	35800,
	36000,
	36200,
	36400,
	36600,
	36800,
	37000,
	37200,
	37400,
	37600,
	37800,
	38000,
	38200,
	38400,
	38600,
	38800,
	39000,
	39200,
	39400,
	39600
}

new PXP[ 33 ]
new PLEVEL[ 33 ]
new PKS[ 33 ]
new g_vault

public plugin_init()
{
	//You want credits? Take credits...you stealz0rs
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	//You poor little guy died, what we gonna do now?
	register_event( "DeathMsg", "EventDeathMsg", "a" )
	
	//All kinds of information
	register_clcmd( "say /xp", "printXp", -1, "Print player Xp" )
	register_clcmd( "say /level", "printLevel", -1, "Print player level" )
	register_clcmd( "say /newlevel", "printNewLevel", -1, "Print player how many xp left to new level" )
	register_clcmd( "say /help", "printHelp", -1, "Print help" )
	register_clcmd( "say /info", "printInfo", -1, "Print info" )
	register_clcmd( "say /weapons", "printWeapons", -1, "Print weapon unlocks" )
	
	//Nozoom stuff
	register_event("SetFOV","zoom","b","1<90") 
	register_event("CurWeapon","ev_CurWeapon", "be", "1=1")
	
	//Meat...mmmm, delicious ham
	RegisterHam(Ham_Spawn, "player", "EventPlayerSpawn", 1)
	RegisterHam(Ham_TakeDamage, "player", "fwHamTakeDamage")
	
	//nVault stuff
	g_vault = nvault_open("SURFXPMOD")
	
	//Tutor stuff
	g_MsgTutor = get_user_msgid("TutorText")
	g_MsgTutClose = get_user_msgid("TutorClose")
	
	//Those annoying cvars...for the community :(
	gCvarNozoom = register_cvar("sxm_nozoom", "0", 0, 0.0)
}

/* Precache resources */
public plugin_precache()
{
	precache_sound(MSOUND)
	
	new i
	
	for(i = 0; i < sizeof g_TutorPrecache; i++) precache_generic(g_TutorPrecache)
	
	precache_model("models/customs/v_gknife.mdl")
	
	precache_model("models/customs/v_gdeagle.mdl")
	
	precache_model("models/customs/v_gelite.mdl")
	
	precache_model("models/customs/v_shegrenade.mdl")
	
}

public client_connect( id )
{
	PXP[ id ] = 0
	LoadData( id )
}

public client_disconnect( id )
{
	SaveData( id )
	PXP[ id ] = 0
	PLEVEL[ id ] = 0
	PKS[ id ] = 0
}

public EventPlayerSpawn( id )
{
	new health
	new newhealth
	new money
	new newmoney
	new armor
	new newarmor
	
	money = cs_get_user_money( id )
	newmoney = money + (PLEVEL[ id ] * 100)
	cs_set_user_money( id, newmoney)
	
	if( PLEVEL[ id ] <= 25 )
	{
		health = get_user_health( id )
		newhealth = health + (PLEVEL[ id ])
		set_user_health( id, newhealth )
	}
	else
	{
		health = get_user_health( id )
		newhealth = 125
		
		armor = get_user_armor( id )
		newarmor = armor + ((PLEVEL[ id ]) - 25)
		set_user_armor( id, newarmor )
		set_user_health( id, newhealth )
	}
}

public EventDeathMsg()
{
	new killer = read_data( 1 )
	new victim = read_data( 2 )
	new headshot = read_data( 3 )
	new xp
	new hs
	
	if(PLEVEL[ killer ] > PLEVEL[ victim ])
	{
		xp = 4
	}
	
	if(PLEVEL[ killer ] < PLEVEL[ victim ])
	{
		xp = 6
	}
	
	if(PLEVEL[ killer ] == PLEVEL[ victim ])
	{
		xp = 5
	}
	
	PKS[ victim ] = 0
	
	if( victim == killer )
	{
		return PLUGIN_CONTINUE
	}
	
	if(headshot)
	{
		xp = xp + 5
		hs = 1
	}
	
	if(PKS[ killer ] < 10)
	{
		PKS[ killer ]++
	}
	
	xp = xp + PKS[ killer ]
	
	add_xp( killer, xp, hs )
	check_level( killer )
	
	new Text[ 100 ]
	formatex(Text,191,"You died and lost your killstreak!")
	MakeTutor(victim,Text,RED,3.0)
}

/* Add xp */
public add_xp( id, xp, hs )
{
	new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
	
	PXP[ id ] = PXP[ id ] + xp
	
	if(hs)
	{
		new Text[ 100 ]
		formatex(Text,191,"Headshot! You got %d xp! ^nKillstreak: %d^nNew level after %d xp!", xp, PKS[ id ], newlevel)
		MakeTutor(id,Text,GREEN,3.0)
	}
	else
	{
		new Text[ 100 ]
		formatex(Text,191,"You got %d xp! ^nKillstreak: %d^nNew level after %d xp!", xp, PKS[ id ], newlevel)
		MakeTutor(id,Text,GREEN,3.0)
	}
}

/* Lets check if player got a new level */
public check_level( id )
{
	if(PXP[ id ] >= LEVELS[PLEVEL[ id ]])
	{
		PLEVEL[ id ]++
		new Text[ 100 ]
		formatex(Text,191,"You are now level %d!", PLEVEL[ id ])
		MakeTutor(id,Text,GREEN,5.0)
	}
}

/* Lets print the list of weapon achievments */
public printWeapons( id )
{
	new Text[ 255 ]
	formatex(Text,191,
	"LEVEL 5 Unlock^nGolden Knife^n^nLEVEL 7 Unlock^nGolden Elites^n^nLEVEL 10 Unlock^nGolden Deagle^n^nLevel 15 Unlock^nGerman Grenade")
	MakeTutor(id,Text,YELLOW,7.0)
}

public printHelp( id )
{
	//new Text[ 255 ]
	//formatex(Text,191,
	//"Selleks, et vaadata enda levelit kirjuta:^n/level ^nSelleks, et vaadata enda XPd kirjuta:^n/xp^nSelleks, et vaadata millal uus level tuleb kirjuta:^n/uuslevel^n^nSelleks, et vaadata millal mis relva lahti saad kirjuta:^n/relvad")
	//MakeTutor(id,Text,YELLOW,7.0)
}

/* Plugin information */
public printInfo( id )
{
	new Text[ 255 ]
	formatex(Text,191,
	"What is SURF XP MOD?^n-SXM is mod created by Ardivaba for surf server^n^nWhat can i do with levels?^n-Levels reward you HP, starting money and golden weapons")
	MakeTutor(id,Text,YELLOW,7.0)
}

/* Lets print players ammount of xp */
public printXp( id )
{
	new Text[ 100 ]
	formatex(Text,191,"You have %d xp!", PXP[ id ])
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print when player get's new level */
public printNewLevel( id )
{
	new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
	new Text[ 100 ]
	formatex(Text,191,"New level after %d xp!", newlevel)
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print players level */
public printLevel( id )
{
	
	new Text[ 100 ]
	formatex(Text,191,"Your level is %d!", PLEVEL[ id ])
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Save Data to nVault */
public SaveData(id)
{
	new AuthID[35]
	get_user_name(id,AuthID,34)
	
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-Mod",AuthID)
	format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
	nvault_set(g_vault,vaultkey,vaultdata)
	return PLUGIN_CONTINUE
}

/* Load Data  from nVault */
public LoadData(id)
{
	new AuthID[35]
	get_user_name(id,AuthID,34)
	
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-Mod",AuthID)
	format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
	nvault_get(g_vault,vaultkey,vaultdata,255)
	
	replace_all(vaultdata, 255, "#", " ")
	
	new playerxp[32], playerlevel[32]
	
	parse(vaultdata, playerxp, 31, playerlevel, 31)
	
	PXP[id] = str_to_num(playerxp)
	PLEVEL[id] = str_to_num(playerlevel)
	
	return PLUGIN_CONTINUE
}

/* Teeme tutori teksti */
MakeTutor(id,Text[],Color,Float:Time = 0.0) {
	
	client_cmd( id, "spk %s", MSOUND )
	
	if(is_user_connected( id ))
	{
		message_begin(MSG_ONE_UNRELIABLE,g_MsgTutor,_,id)
		write_string(Text)
		write_byte(0)
		write_short(0)
		write_short(0)
		write_short(1<<Color)
		message_end()
	}
	
	if(Time != 0.0) {
		
		if( task_exists( id + TASK_TUT ) )
		{
			remove_task( id + TASK_TUT )
		}
		
		set_task(Time,"RemoveTutor",id + TASK_TUT)
	}
}

/* Lets Remove Tutor */
public RemoveTutor(taskID) {
	
	new id = taskID - TASK_TUT
	message_begin(MSG_ALL,g_MsgTutClose,_,id)
	message_end()
}

public zoom( id )
{
	if(gCvarNozoom)
	{
		client_cmd( id, "drop" )
	}
}

/* Golden Weapons */

public ev_CurWeapon(id)
{
	if(!is_user_connected(id) || !is_user_alive(id)) 
	{
		return PLUGIN_HANDLED;
	}
	
	new Weapon_Id = read_data(2)
	
	/* Golden Knife */
	if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 5 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gknife.mdl")
	}
	
	/* Golden Elites */
	if(Weapon_Id == CSW_ELITE && PLEVEL[ id ] >= 7 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gelite.mdl")
	}
	
	/* Golden Deagle */
	if(Weapon_Id == CSW_DEAGLE && PLEVEL[ id ] >= 10 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gdeagle.mdl")
	}
	
	/* German Grenade */
	if(Weapon_Id == CSW_HEGRENADE && PLEVEL[ id ] >= 15 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_shegrenade.mdl")
	}
	
	return PLUGIN_CONTINUE;
}

public fwHamTakeDamage(victim, inflictor, attacker, Float:damage, damagebits)
{
	
	/* Golden Knife */
	if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 5)
	{
		SetHamParamFloat(4, damage * 1.5)
		return HAM_HANDLED
	}
	
	/* Golden Elites */
	if(get_user_weapon(attacker) == CSW_ELITE && PLEVEL[ attacker ] >= 7)
	{
		SetHamParamFloat(4, damage * 1.5)
		return HAM_HANDLED
	}
	
	/* Golden Deagle */
	if(get_user_weapon(attacker) == CSW_DEAGLE && PLEVEL[ attacker ] >= 10)
	{
		SetHamParamFloat(4, damage * 1.3)
		return HAM_HANDLED
	}
	
	/* German Grenade */
	if(get_user_weapon(attacker) == CSW_HEGRENADE && PLEVEL[ attacker ] >= 15)
	{
		SetHamParamFloat(4, damage * 1.4)
		return HAM_HANDLED
	}
	
	return HAM_IGNORED 
}[/Buton]
RoyalServer
User avatar
cassuftw-
Membru, skill +2
Membru, skill +2
Posts: 618
Joined: 17 Sep 2011, 19:08
Detinator Steam: Da
Location: Târgu Jiu
Has thanked: 69 times
Been thanked: 40 times

06 Mar 2013, 19:06

Incearca acum :) .
plugin | Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
#include <fakemeta>

/* Who made this bad coded plugin? */
#define PLUGIN	"SURF XP MOD"
#define AUTHOR	"Ardivaba"
#define VERSION	"1.0"

/* Lets define some illegal stuff */
#define TUTORIAL 1001
#define TASK_TUT 1111

/* What is the sound of the message? */
#define MSOUND "items/nvg_off.wav"

/* Enum for tutor colors */
enum
{
	RED = 1,
	BLUE,
	YELLOW,
	GREEN
}

/* Precache array for tutor */
new const g_TutorPrecache[][] = {
	"gfx/career/icon_!.tga",
	"gfx/career/icon_!-bigger.tga",
	"gfx/career/icon_i.tga",
	"gfx/career/icon_i-bigger.tga",
	"gfx/career/icon_skulls.tga",
	"gfx/career/round_corner_ne.tga",
	"gfx/career/round_corner_nw.tga",
	"gfx/career/round_corner_se.tga",
	"gfx/career/round_corner_sw.tga",
	"resource/TutorScheme.res",
	"resource/UI/TutorTextWindow.res"
}

/* Some new stuff for tutor */
new g_MsgTutor
new g_MsgTutClose


/* So many levels...oh my f**in god */
new const LEVELS[200] =
{
	50,
	100,
	200,
	400,
	600,
	800,
	1000,
	1200,
	1400,
	1600,
	1800,
	2000,
	2200,
	2400,
	2600,
	2800,
	3000,
	3200,
	3400,
	3600,
	3800,
	4000,
	4200,
	4400,
	4600,
	4800,
	5000,
	5200,
	5400,
	5600,
	5800,
	6000,
	6200,
	6400,
	6600,
	6800,
	7000,
	7200,
	7400,
	7600,
	7800,
	8000,
	8200,
	8400,
	8600,
	8800,
	9000,
	9200,
	9400,
	9600,
	9800,
	10000,
	10200,
	10400,
	10600,
	10800,
	11000,
	11200,
	11400,
	11600,
	11800,
	12000,
	12200,
	12400,
	12600,
	12800,
	13000,
	13200,
	13400,
	13600,
	13800,
	14000,
	14200,
	14400,
	14600,
	14800,
	15000,
	15200,
	15400,
	15600,
	15800,
	16000,
	16200,
	16400,
	16600,
	16800,
	17000,
	17200,
	17400,
	17600,
	17800,
	18000,
	18200,
	18400,
	18600,
	18800,
	19000,
	19200,
	19400,
	19600,
	19800,
	20000,
	20200,
	20400,
	20600,
	20800,
	21000,
	21200,
	21400,
	21600,
	21800,
	22000,
	22200,
	22400,
	22600,
	22800,
	23000,
	23200,
	23400,
	23600,
	23800,
	24000,
	24200,
	24400,
	24600,
	24800,
	25000,
	25200,
	25400,
	25600,
	25800,
	26000,
	26200,
	26400,
	26600,
	26800,
	27000,
	27200,
	27400,
	27600,
	27800,
	28000,
	28200,
	28400,
	28600,
	28800,
	29000,
	29200,
	29400,
	29600,
	29800,
	30000,
	30200,
	30400,
	30600,
	30800,
	31000,
	31200,
	31400,
	31600,
	31800,
	32000,
	32200,
	32400,
	32600,
	32800,
	33000,
	33200,
	33400,
	33600,
	33800,
	34000,
	34200,
	34400,
	34600,
	34800,
	35000,
	35200,
	35400,
	35600,
	35800,
	36000,
	36200,
	36400,
	36600,
	36800,
	37000,
	37200,
	37400,
	37600,
	37800,
	38000,
	38200,
	38400,
	38600,
	38800,
	39000,
	39200,
	39400,
	39600
}

new PXP[ 33 ]
new PLEVEL[ 33 ]
new PKS[ 33 ]
new g_vault

public plugin_init()
{
	//You want credits? Take credits...you stealz0rs
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	//You poor little guy died, what we gonna do now?
	register_event( "DeathMsg", "EventDeathMsg", "a" )
	
	//All kinds of information
	register_clcmd( "say /xp", "printXp", -1, "Print player Xp" )
	register_clcmd( "say /level", "printLevel", -1, "Print player level" )
	register_clcmd( "say /newlevel", "printNewLevel", -1, "Print player how many xp left to new level" )
	register_clcmd( "say /help", "printHelp", -1, "Print help" )
	register_clcmd( "say /info", "printInfo", -1, "Print info" )
	register_clcmd( "say /weapons", "printWeapons", -1, "Print weapon unlocks" )
	

	
	//Meat...mmmm, delicious ham
	RegisterHam(Ham_Spawn, "player", "EventPlayerSpawn", 1)
	RegisterHam(Ham_TakeDamage, "player", "fwHamTakeDamage")
	
	//nVault stuff
	g_vault = nvault_open("SURFXPMOD")
	
	//Tutor stuff
	g_MsgTutor = get_user_msgid("TutorText")
	g_MsgTutClose = get_user_msgid("TutorClose")
	
	
}

/* Precache resources */
public plugin_precache()
{
	precache_sound(MSOUND)
	
	new i
	
	for(i = 0; i < sizeof g_TutorPrecache; i++) precache_generic(g_TutorPrecache)
	
	precache_model("models/customs/v_gknife.mdl")
	
	precache_model("models/customs/v_gdeagle.mdl")
	
	precache_model("models/customs/v_gelite.mdl")
	
	precache_model("models/customs/v_shegrenade.mdl")
	
}

public client_connect( id )
{
	PXP[ id ] = 0
	LoadData( id )
}

public client_disconnect( id )
{
	SaveData( id )
	PXP[ id ] = 0
	PLEVEL[ id ] = 0
	PKS[ id ] = 0
}

public EventPlayerSpawn( id )
{
	new health
	new newhealth
	new money
	new newmoney
	new armor
	new newarmor
	
	money = cs_get_user_money( id )
	newmoney = money + (PLEVEL[ id ] * 100)
	cs_set_user_money( id, newmoney)
	
	if( PLEVEL[ id ] <= 25 )
	{
		health = get_user_health( id )
		newhealth = health + (PLEVEL[ id ])
		set_user_health( id, newhealth )
	}
	else
	{
		health = get_user_health( id )
		newhealth = 125
		
		armor = get_user_armor( id )
		newarmor = armor + ((PLEVEL[ id ]) - 25)
		set_user_armor( id, newarmor )
		set_user_health( id, newhealth )
	}
}

public EventDeathMsg()
{
	new killer = read_data( 1 )
	new victim = read_data( 2 )
	new headshot = read_data( 3 )
	new xp
	new hs
	
	if(PLEVEL[ killer ] > PLEVEL[ victim ])
	{
		xp = 4
	}
	
	if(PLEVEL[ killer ] < PLEVEL[ victim ])
	{
		xp = 6
	}
	
	if(PLEVEL[ killer ] == PLEVEL[ victim ])
	{
		xp = 5
	}
	
	PKS[ victim ] = 0
	
	if( victim == killer )
	{
		return PLUGIN_CONTINUE
	}
	
	if(headshot)
	{
		xp = xp + 5
		hs = 1
	}
	
	if(PKS[ killer ] < 10)
	{
		PKS[ killer ]++
	}
	
	xp = xp + PKS[ killer ]
	
	add_xp( killer, xp, hs )
	check_level( killer )
	
	new Text[ 100 ]
	formatex(Text,191,"You died and lost your killstreak!")
	MakeTutor(victim,Text,RED,3.0)
}

/* Add xp */
public add_xp( id, xp, hs )
{
	new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
	
	PXP[ id ] = PXP[ id ] + xp
	
	if(hs)
	{
		new Text[ 100 ]
		formatex(Text,191,"Headshot! You got %d xp! ^nKillstreak: %d^nNew level after %d xp!", xp, PKS[ id ], newlevel)
		MakeTutor(id,Text,GREEN,3.0)
	}
	else
	{
		new Text[ 100 ]
		formatex(Text,191,"You got %d xp! ^nKillstreak: %d^nNew level after %d xp!", xp, PKS[ id ], newlevel)
		MakeTutor(id,Text,GREEN,3.0)
	}
}

/* Lets check if player got a new level */
public check_level( id )
{
	if(PXP[ id ] >= LEVELS[PLEVEL[ id ]])
	{
		PLEVEL[ id ]++
		new Text[ 100 ]
		formatex(Text,191,"You are now level %d!", PLEVEL[ id ])
		MakeTutor(id,Text,GREEN,5.0)
	}
}

/* Lets print the list of weapon achievments */
public printWeapons( id )
{
	new Text[ 255 ]
	formatex(Text,191,
	"LEVEL 5 Unlock^nGolden Knife^n^nLEVEL 7 Unlock^nGolden Elites^n^nLEVEL 10 Unlock^nGolden Deagle^n^nLevel 15 Unlock^nGerman Grenade")
	MakeTutor(id,Text,YELLOW,7.0)
}

public printHelp( id )
{
	//new Text[ 255 ]
	//formatex(Text,191,
	//"Selleks, et vaadata enda levelit kirjuta:^n/level ^nSelleks, et vaadata enda XPd kirjuta:^n/xp^nSelleks, et vaadata millal uus level tuleb kirjuta:^n/uuslevel^n^nSelleks, et vaadata millal mis relva lahti saad kirjuta:^n/relvad")
	//MakeTutor(id,Text,YELLOW,7.0)
}

/* Plugin information */
public printInfo( id )
{
	new Text[ 255 ]
	formatex(Text,191,
	"What is SURF XP MOD?^n-SXM is mod created by Ardivaba for surf server^n^nWhat can i do with levels?^n-Levels reward you HP, starting money and golden weapons")
	MakeTutor(id,Text,YELLOW,7.0)
}

/* Lets print players ammount of xp */
public printXp( id )
{
	new Text[ 100 ]
	formatex(Text,191,"You have %d xp!", PXP[ id ])
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print when player get's new level */
public printNewLevel( id )
{
	new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
	new Text[ 100 ]
	formatex(Text,191,"New level after %d xp!", newlevel)
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print players level */
public printLevel( id )
{
	
	new Text[ 100 ]
	formatex(Text,191,"Your level is %d!", PLEVEL[ id ])
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Save Data to nVault */
public SaveData(id)
{
	new AuthID[35]
	get_user_name(id,AuthID,34)
	
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-Mod",AuthID)
	format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
	nvault_set(g_vault,vaultkey,vaultdata)
	return PLUGIN_CONTINUE
}

/* Load Data  from nVault */
public LoadData(id)
{
	new AuthID[35]
	get_user_name(id,AuthID,34)
	
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-Mod",AuthID)
	format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
	nvault_get(g_vault,vaultkey,vaultdata,255)
	
	replace_all(vaultdata, 255, "#", " ")
	
	new playerxp[32], playerlevel[32]
	
	parse(vaultdata, playerxp, 31, playerlevel, 31)
	
	PXP[id] = str_to_num(playerxp)
	PLEVEL[id] = str_to_num(playerlevel)
	
	return PLUGIN_CONTINUE
}

/* Teeme tutori teksti */
MakeTutor(id,Text[],Color,Float:Time = 0.0) {
	
	client_cmd( id, "spk %s", MSOUND )
	
	if(is_user_connected( id ))
	{
		message_begin(MSG_ONE_UNRELIABLE,g_MsgTutor,_,id)
		write_string(Text)
		write_byte(0)
		write_short(0)
		write_short(0)
		write_short(1<<Color)
		message_end()
	}
	
	if(Time != 0.0) {
		
		if( task_exists( id + TASK_TUT ) )
		{
			remove_task( id + TASK_TUT )
		}
		
		set_task(Time,"RemoveTutor",id + TASK_TUT)
	}
}

/* Lets Remove Tutor */
public RemoveTutor(taskID) {
	
	new id = taskID - TASK_TUT
	message_begin(MSG_ALL,g_MsgTutClose,_,id)
	message_end()
}


/* Golden Weapons */

public ev_CurWeapon(id)
{
	if(!is_user_connected(id) || !is_user_alive(id)) 
	{
		return PLUGIN_HANDLED;
	}
	
	new Weapon_Id = read_data(2)
	
	/* Golden Knife */
	if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 5 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gknife.mdl")
	}
	
	/* Golden Elites */
	if(Weapon_Id == CSW_ELITE && PLEVEL[ id ] >= 7 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gelite.mdl")
	}
	
	/* Golden Deagle */
	if(Weapon_Id == CSW_DEAGLE && PLEVEL[ id ] >= 10 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gdeagle.mdl")
	}
	
	/* German Grenade */
	if(Weapon_Id == CSW_HEGRENADE && PLEVEL[ id ] >= 15 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_shegrenade.mdl")
	}
	
	return PLUGIN_CONTINUE;
}

public fwHamTakeDamage(victim, inflictor, attacker, Float:damage, damagebits)
{
	
	/* Golden Knife */
	if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 5)
	{
		SetHamParamFloat(4, damage * 1.5)
		return HAM_HANDLED
	}
	
	/* Golden Elites */
	if(get_user_weapon(attacker) == CSW_ELITE && PLEVEL[ attacker ] >= 7)
	{
		SetHamParamFloat(4, damage * 1.5)
		return HAM_HANDLED
	}
	
	/* Golden Deagle */
	if(get_user_weapon(attacker) == CSW_DEAGLE && PLEVEL[ attacker ] >= 10)
	{
		SetHamParamFloat(4, damage * 1.3)
		return HAM_HANDLED
	}
	
	/* German Grenade */
	if(get_user_weapon(attacker) == CSW_HEGRENADE && PLEVEL[ attacker ] >= 15)
	{
		SetHamParamFloat(4, damage * 1.4)
		return HAM_HANDLED
	}
	
	return HAM_IGNORED 
}
Steam profile: http://adf.ly/rr28k
likepro
Membru, skill 0
Membru, skill 0
Posts: 44
Joined: 01 Mar 2013, 17:27
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 10 times
Been thanked: 7 times
Contact:

06 Mar 2013, 19:14

acuma mai am o problema, la cativa playeri le apare doar acel dreptunghi negru fara scrisul cu levelul tau! poate puteti modifica si sa apara in chat ca un mesaj... ce ziceti?:D
likepro
Membru, skill 0
Membru, skill 0
Posts: 44
Joined: 01 Mar 2013, 17:27
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 10 times
Been thanked: 7 times
Contact:

06 Mar 2013, 20:07

nu se poate rezolva asta?
User avatar
Fantasy1
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 4836
Joined: 05 Jul 2012, 01:26
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (1 Mar)
Utilizator neserios (TEPAR!)
Has thanked: 278 times
Been thanked: 217 times
Contact:

06 Mar 2013, 22:45

As dori si eu acest plugin dar imi lipsesc modelele , mi le poti da si mie te rog frumos?
Edit : da , are dreptate , apare un tiunghi negru in dreapta.
CLICK AICI pentru FORUM
- Un Forum Care Nu Poate Fi Spart -
- Un Forum Care Nu Modifica Topicurile Cu Tepari -
- Vrei Indexare In Google? Posteaza Tzeparii La Noi -

- Daca ai nevoie sa te ajut cu un addons/plugin etc se plateste, nu ajut cu nimic pe GRATIS -
User avatar
cassuftw-
Membru, skill +2
Membru, skill +2
Posts: 618
Joined: 17 Sep 2011, 19:08
Detinator Steam: Da
Location: Târgu Jiu
Has thanked: 69 times
Been thanked: 40 times

07 Mar 2013, 08:00

Try now:
plugin | Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
#include <fakemeta>

/* Who made this bad coded plugin? */
#define PLUGIN	"SURF XP MOD"
#define AUTHOR	"Ardivaba"
#define VERSION	"1.0"

/* Lets define some illegal stuff */
#define TUTORIAL 1001
#define TASK_TUT 1111

/* What is the sound of the message? */
#define MSOUND "items/nvg_off.wav"

/* Enum for tutor colors */
enum
{
	RED = 1,
	BLUE,
	YELLOW,
	GREEN
}

/* Precache array for tutor */
new const g_TutorPrecache[][] = {
	"gfx/career/icon_!.tga",
	"gfx/career/icon_!-bigger.tga",
	"gfx/career/icon_i.tga",
	"gfx/career/icon_i-bigger.tga",
	"gfx/career/icon_skulls.tga",
	"gfx/career/round_corner_ne.tga",
	"gfx/career/round_corner_nw.tga",
	"gfx/career/round_corner_se.tga",
	"gfx/career/round_corner_sw.tga",
	"resource/TutorScheme.res",
	"resource/UI/TutorTextWindow.res"
}

/* Some new stuff for tutor */
new g_MsgTutor
new g_MsgTutClose


/* So many levels...oh my f**in god */
new const LEVELS[200] =
{
	50,
	100,
	200,
	400,
	600,
	800,
	1000,
	1200,
	1400,
	1600,
	1800,
	2000,
	2200,
	2400,
	2600,
	2800,
	3000,
	3200,
	3400,
	3600,
	3800,
	4000,
	4200,
	4400,
	4600,
	4800,
	5000,
	5200,
	5400,
	5600,
	5800,
	6000,
	6200,
	6400,
	6600,
	6800,
	7000,
	7200,
	7400,
	7600,
	7800,
	8000,
	8200,
	8400,
	8600,
	8800,
	9000,
	9200,
	9400,
	9600,
	9800,
	10000,
	10200,
	10400,
	10600,
	10800,
	11000,
	11200,
	11400,
	11600,
	11800,
	12000,
	12200,
	12400,
	12600,
	12800,
	13000,
	13200,
	13400,
	13600,
	13800,
	14000,
	14200,
	14400,
	14600,
	14800,
	15000,
	15200,
	15400,
	15600,
	15800,
	16000,
	16200,
	16400,
	16600,
	16800,
	17000,
	17200,
	17400,
	17600,
	17800,
	18000,
	18200,
	18400,
	18600,
	18800,
	19000,
	19200,
	19400,
	19600,
	19800,
	20000,
	20200,
	20400,
	20600,
	20800,
	21000,
	21200,
	21400,
	21600,
	21800,
	22000,
	22200,
	22400,
	22600,
	22800,
	23000,
	23200,
	23400,
	23600,
	23800,
	24000,
	24200,
	24400,
	24600,
	24800,
	25000,
	25200,
	25400,
	25600,
	25800,
	26000,
	26200,
	26400,
	26600,
	26800,
	27000,
	27200,
	27400,
	27600,
	27800,
	28000,
	28200,
	28400,
	28600,
	28800,
	29000,
	29200,
	29400,
	29600,
	29800,
	30000,
	30200,
	30400,
	30600,
	30800,
	31000,
	31200,
	31400,
	31600,
	31800,
	32000,
	32200,
	32400,
	32600,
	32800,
	33000,
	33200,
	33400,
	33600,
	33800,
	34000,
	34200,
	34400,
	34600,
	34800,
	35000,
	35200,
	35400,
	35600,
	35800,
	36000,
	36200,
	36400,
	36600,
	36800,
	37000,
	37200,
	37400,
	37600,
	37800,
	38000,
	38200,
	38400,
	38600,
	38800,
	39000,
	39200,
	39400,
	39600
}

new PXP[ 33 ]
new PLEVEL[ 33 ]
new PKS[ 33 ]
new g_vault

public plugin_init()
{
	//You want credits? Take credits...you stealz0rs
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	//You poor little guy died, what we gonna do now?
	register_event( "DeathMsg", "EventDeathMsg", "a" )
	
	//All kinds of information
	register_clcmd( "say /xp", "printXp", -1, "Print player Xp" )
	register_clcmd( "say /level", "printLevel", -1, "Print player level" )
	register_clcmd( "say /newlevel", "printNewLevel", -1, "Print player how many xp left to new level" )
	register_clcmd( "say /help", "printHelp", -1, "Print help" )
	register_clcmd( "say /info", "printInfo", -1, "Print info" )
	register_clcmd( "say /weapons", "printWeapons", -1, "Print weapon unlocks" )
	
	
	
	//Meat...mmmm, delicious ham
	RegisterHam(Ham_Spawn, "player", "EventPlayerSpawn", 1)
	RegisterHam(Ham_TakeDamage, "player", "fwHamTakeDamage")
	
	//nVault stuff
	g_vault = nvault_open("SURFXPMOD")
	
	//Tutor stuff
	g_MsgTutor = get_user_msgid("TutorText")
	g_MsgTutClose = get_user_msgid("TutorClose")
	
	
}

/* Precache resources */
public plugin_precache()
{
	precache_sound(MSOUND)
	
	new i
	
	for(i = 0; i < sizeof g_TutorPrecache; i++) precache_generic(g_TutorPrecache)
	
	precache_model("models/customs/v_gknife.mdl")
	
	precache_model("models/customs/v_gdeagle.mdl")
	
	precache_model("models/customs/v_gelite.mdl")
	
	precache_model("models/customs/v_shegrenade.mdl")
	
}

public client_connect( id )
{
	PXP[ id ] = 0
	LoadData( id )
}

public client_disconnect( id )
{
	SaveData( id )
	PXP[ id ] = 0
	PLEVEL[ id ] = 0
	PKS[ id ] = 0
}

public EventPlayerSpawn( id )
{
	new health
	new newhealth
	new money
	new newmoney
	new armor
	new newarmor
	
	money = cs_get_user_money( id )
	newmoney = money + (PLEVEL[ id ] * 100)
	cs_set_user_money( id, newmoney)
	
	if( PLEVEL[ id ] <= 25 )
	{
		health = get_user_health( id )
		newhealth = health + (PLEVEL[ id ])
		set_user_health( id, newhealth )
	}
	else
	{
		health = get_user_health( id )
		newhealth = 125
		
		armor = get_user_armor( id )
		newarmor = armor + ((PLEVEL[ id ]) - 25)
		set_user_armor( id, newarmor )
		set_user_health( id, newhealth )
	}
}

public EventDeathMsg()
{
	new killer = read_data( 1 )
	new victim = read_data( 2 )
	new headshot = read_data( 3 )
	new xp
	new hs
	
	if(PLEVEL[ killer ] > PLEVEL[ victim ])
	{
		xp = 4
	}
	
	if(PLEVEL[ killer ] < PLEVEL[ victim ])
	{
		xp = 6
	}
	
	if(PLEVEL[ killer ] == PLEVEL[ victim ])
	{
		xp = 5
	}
	
	PKS[ victim ] = 0
	
	if( victim == killer )
	{
		return PLUGIN_CONTINUE
	}
	
	if(headshot)
	{
		xp = xp + 5
		hs = 1
	}
	
	if(PKS[ killer ] < 10)
	{
		PKS[ killer ]++
	}
	
	xp = xp + PKS[ killer ]
	
	add_xp( killer, xp, hs )
	check_level( killer )
	
	new Text[ 100 ]
	formatex(Text,191,"You died and lost your killstreak!")
	MakeTutor(victim,Text,RED,3.0)
}

/* Add xp */
public add_xp( id, xp, hs )
{
	new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
	
	PXP[ id ] = PXP[ id ] + xp
	
	if(hs)
	{
		new Text[ 100 ]
		formatex(Text,191,"Headshot! You got %d xp! ^nKillstreak: %d^nNew level after %d xp!", xp, PKS[ id ], newlevel)
		MakeTutor(id,Text,GREEN,3.0)
	}
	else
	{
		new Text[ 100 ]
		formatex(Text,191,"You got %d xp! ^nKillstreak: %d^nNew level after %d xp!", xp, PKS[ id ], newlevel)
		MakeTutor(id,Text,GREEN,3.0)
	}
}

/* Lets check if player got a new level */
public check_level( id )
{
	if(PXP[ id ] >= LEVELS[PLEVEL[ id ]])
	{
		PLEVEL[ id ]++
		new Text[ 100 ]
		formatex(Text,191,"You are now level %d!", PLEVEL[ id ])
		MakeTutor(id,Text,GREEN,5.0)
	}
}

/* Lets print the list of weapon achievments */
public printWeapons( id )
{
	new Text[ 255 ]
	formatex(Text,191,
	"LEVEL 5 Unlock^nGolden Knife^n^nLEVEL 7 Unlock^nGolden Elites^n^nLEVEL 10 Unlock^nGolden Deagle^n^nLevel 15 Unlock^nGerman Grenade")
	MakeTutor(id,Text,YELLOW,7.0)
}

public printHelp( id )
{
	//new Text[ 255 ]
	//formatex(Text,191,
	//"Selleks, et vaadata enda levelit kirjuta:^n/level ^nSelleks, et vaadata enda XPd kirjuta:^n/xp^nSelleks, et vaadata millal uus level tuleb kirjuta:^n/uuslevel^n^nSelleks, et vaadata millal mis relva lahti saad kirjuta:^n/relvad")
	//MakeTutor(id,Text,YELLOW,7.0)
}

/* Plugin information */
public printInfo( id )
{
	new Text[ 255 ]
	formatex(Text,191,
	"What is SURF XP MOD?^n-SXM is mod created by Ardivaba for surf server^n^nWhat can i do with levels?^n-Levels reward you HP, starting money and golden weapons")
	MakeTutor(id,Text,YELLOW,7.0)
}

/* Lets print players ammount of xp */
public printXp( id )
{
	new Text[ 100 ]
	formatex(Text,191,"You have %d xp!", PXP[ id ])
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print when player get's new level */
public printNewLevel( id )
{
	new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
	new Text[ 100 ]
	formatex(Text,191,"New level after %d xp!", newlevel)
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print players level */
public printLevel( id )
{
	
	new Text[ 100 ]
	formatex(Text,191,"Your level is %d!", PLEVEL[ id ])
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Save Data to nVault */
public SaveData(id)
{
	new AuthID[35]
	get_user_name(id,AuthID,34)
	
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-Mod",AuthID)
	format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
	nvault_set(g_vault,vaultkey,vaultdata)
	return PLUGIN_CONTINUE
}

/* Load Data  from nVault */
public LoadData(id)
{
	new AuthID[35]
	get_user_name(id,AuthID,34)
	
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-Mod",AuthID)
	format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
	nvault_get(g_vault,vaultkey,vaultdata,255)
	
	replace_all(vaultdata, 255, "#", " ")
	
	new playerxp[32], playerlevel[32]
	
	parse(vaultdata, playerxp, 31, playerlevel, 31)
	
	PXP[id] = str_to_num(playerxp)
	PLEVEL[id] = str_to_num(playerlevel)
	
	return PLUGIN_CONTINUE
}

/* Teeme tutori teksti */
MakeTutor(id,Text[],Color,Float:Time = 0.0) {
	
	client_cmd( id, "spk %s", MSOUND )
	
	if(is_user_connected( id ))
	{
		message_begin(MSG_ONE_UNRELIABLE,g_MsgTutor,_,id)
		write_string(Text)
		write_byte(0)
		write_short(0)
		write_short(0)
		write_short(1<<Color)
		message_end()
	}
	
	if(Time != 0.0) {
		
		if( task_exists( id + TASK_TUT ) )
		{
			remove_task( id + TASK_TUT )
		}
		
		set_task(Time,"RemoveTutor",id + TASK_TUT)
	}
}

/* Lets Remove Tutor */
public RemoveTutor(taskID) {
	
	new id = taskID - TASK_TUT
	message_begin(MSG_ALL,g_MsgTutClose,_,id)
	message_end()
}

}

/* Golden Weapons */

public ev_CurWeapon(id)
{
	if(!is_user_connected(id) || !is_user_alive(id)) 
	{
		return PLUGIN_HANDLED;
	}
	
	new Weapon_Id = read_data(2)
	
	/* Golden Knife */
	if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 5 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gknife.mdl")
	}
	
	/* Golden Elites */
	if(Weapon_Id == CSW_ELITE && PLEVEL[ id ] >= 7 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gelite.mdl")
	}
	
	/* Golden Deagle */
	if(Weapon_Id == CSW_DEAGLE && PLEVEL[ id ] >= 10 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gdeagle.mdl")
	}
	
	/* German Grenade */
	if(Weapon_Id == CSW_HEGRENADE && PLEVEL[ id ] >= 15 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_shegrenade.mdl")
	}
	
	return PLUGIN_CONTINUE;
}

public fwHamTakeDamage(victim, inflictor, attacker, Float:damage, damagebits)
{
	
	/* Golden Knife */
	if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 5)
	{
		SetHamParamFloat(4, damage * 1.5)
		return HAM_HANDLED
	}
	
	/* Golden Elites */
	if(get_user_weapon(attacker) == CSW_ELITE && PLEVEL[ attacker ] >= 7)
	{
		SetHamParamFloat(4, damage * 1.5)
		return HAM_HANDLED
	}
	
	/* Golden Deagle */
	if(get_user_weapon(attacker) == CSW_DEAGLE && PLEVEL[ attacker ] >= 10)
	{
		SetHamParamFloat(4, damage * 1.3)
		return HAM_HANDLED
	}
	
	/* German Grenade */
	if(get_user_weapon(attacker) == CSW_HEGRENADE && PLEVEL[ attacker ] >= 15)
	{
		SetHamParamFloat(4, damage * 1.4)
		return HAM_HANDLED
	}
	
	return HAM_IGNORED 
}


Daca te-am ajutat apasa multumesc :) .
Steam profile: http://adf.ly/rr28k
likepro
Membru, skill 0
Membru, skill 0
Posts: 44
Joined: 01 Mar 2013, 17:27
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 10 times
Been thanked: 7 times
Contact:

07 Mar 2013, 08:15

/tmp/textNkrZpJ.sma(405) : warning 209: function "EventDeathMsg" should return a value
/tmp/textNkrZpJ.sma(563) : error 054: unmatched closing brace

1 Error.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textNkrZpJ.amx (compile failed).

nu merge compilat
si am observat ca nu iti mai revine arma daca dai retry
likepro
Membru, skill 0
Membru, skill 0
Posts: 44
Joined: 01 Mar 2013, 17:27
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 10 times
Been thanked: 7 times
Contact:

07 Mar 2013, 10:14

Acea eroare nu poate fi rezolvata?
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times

07 Mar 2013, 10:34

Uite
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
#include <fakemeta>

/* Who made this bad coded plugin? */
#define PLUGIN	"SURF XP MOD"
#define AUTHOR	"Ardivaba"
#define VERSION	"1.0"

/* Lets define some illegal stuff */
#define TUTORIAL 1001
#define TASK_TUT 1111

/* What is the sound of the message? */
#define MSOUND "items/nvg_off.wav"

/* Enum for tutor colors */
enum
{
	RED = 1,
	BLUE,
	YELLOW,
	GREEN
}

/* Precache array for tutor */
new const g_TutorPrecache[][] = {
	"gfx/career/icon_!.tga",
	"gfx/career/icon_!-bigger.tga",
	"gfx/career/icon_i.tga",
	"gfx/career/icon_i-bigger.tga",
	"gfx/career/icon_skulls.tga",
	"gfx/career/round_corner_ne.tga",
	"gfx/career/round_corner_nw.tga",
	"gfx/career/round_corner_se.tga",
	"gfx/career/round_corner_sw.tga",
	"resource/TutorScheme.res",
	"resource/UI/TutorTextWindow.res"
}

/* Some new stuff for tutor */
new g_MsgTutor
new g_MsgTutClose


/* So many levels...oh my f**in god */
new const LEVELS[200] =
{
	50,
	100,
	200,
	400,
	600,
	800,
	1000,
	1200,
	1400,
	1600,
	1800,
	2000,
	2200,
	2400,
	2600,
	2800,
	3000,
	3200,
	3400,
	3600,
	3800,
	4000,
	4200,
	4400,
	4600,
	4800,
	5000,
	5200,
	5400,
	5600,
	5800,
	6000,
	6200,
	6400,
	6600,
	6800,
	7000,
	7200,
	7400,
	7600,
	7800,
	8000,
	8200,
	8400,
	8600,
	8800,
	9000,
	9200,
	9400,
	9600,
	9800,
	10000,
	10200,
	10400,
	10600,
	10800,
	11000,
	11200,
	11400,
	11600,
	11800,
	12000,
	12200,
	12400,
	12600,
	12800,
	13000,
	13200,
	13400,
	13600,
	13800,
	14000,
	14200,
	14400,
	14600,
	14800,
	15000,
	15200,
	15400,
	15600,
	15800,
	16000,
	16200,
	16400,
	16600,
	16800,
	17000,
	17200,
	17400,
	17600,
	17800,
	18000,
	18200,
	18400,
	18600,
	18800,
	19000,
	19200,
	19400,
	19600,
	19800,
	20000,
	20200,
	20400,
	20600,
	20800,
	21000,
	21200,
	21400,
	21600,
	21800,
	22000,
	22200,
	22400,
	22600,
	22800,
	23000,
	23200,
	23400,
	23600,
	23800,
	24000,
	24200,
	24400,
	24600,
	24800,
	25000,
	25200,
	25400,
	25600,
	25800,
	26000,
	26200,
	26400,
	26600,
	26800,
	27000,
	27200,
	27400,
	27600,
	27800,
	28000,
	28200,
	28400,
	28600,
	28800,
	29000,
	29200,
	29400,
	29600,
	29800,
	30000,
	30200,
	30400,
	30600,
	30800,
	31000,
	31200,
	31400,
	31600,
	31800,
	32000,
	32200,
	32400,
	32600,
	32800,
	33000,
	33200,
	33400,
	33600,
	33800,
	34000,
	34200,
	34400,
	34600,
	34800,
	35000,
	35200,
	35400,
	35600,
	35800,
	36000,
	36200,
	36400,
	36600,
	36800,
	37000,
	37200,
	37400,
	37600,
	37800,
	38000,
	38200,
	38400,
	38600,
	38800,
	39000,
	39200,
	39400,
	39600
}

new PXP[ 33 ]
new PLEVEL[ 33 ]
new PKS[ 33 ]
new g_vault

public plugin_init()
{
	//You want credits? Take credits...you stealz0rs
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	//You poor little guy died, what we gonna do now?
	register_event( "DeathMsg", "EventDeathMsg", "a" )
	
	//All kinds of information
	register_clcmd( "say /xp", "printXp", -1, "Print player Xp" )
	register_clcmd( "say /level", "printLevel", -1, "Print player level" )
	register_clcmd( "say /newlevel", "printNewLevel", -1, "Print player how many xp left to new level" )
	register_clcmd( "say /help", "printHelp", -1, "Print help" )
	register_clcmd( "say /info", "printInfo", -1, "Print info" )
	register_clcmd( "say /weapons", "printWeapons", -1, "Print weapon unlocks" )
	
	
	
	//Meat...mmmm, delicious ham
	RegisterHam(Ham_Spawn, "player", "EventPlayerSpawn", 1)
	RegisterHam(Ham_TakeDamage, "player", "fwHamTakeDamage")
	
	//nVault stuff
	g_vault = nvault_open("SURFXPMOD")
	
	//Tutor stuff
	g_MsgTutor = get_user_msgid("TutorText")
	g_MsgTutClose = get_user_msgid("TutorClose")
	
	
}

/* Precache resources */
public plugin_precache()
{
	precache_sound(MSOUND)
	
	new i
	
	for(i = 0; i < sizeof g_TutorPrecache; i++) precache_generic(g_TutorPrecache)
	
	precache_model("models/customs/v_gknife.mdl")
	
	precache_model("models/customs/v_gdeagle.mdl")
	
	precache_model("models/customs/v_gelite.mdl")
	
	precache_model("models/customs/v_shegrenade.mdl")
	
}

public client_connect( id )
{
	PXP[ id ] = 0
	LoadData( id )
}

public client_disconnect( id )
{
	SaveData( id )
	PXP[ id ] = 0
	PLEVEL[ id ] = 0
	PKS[ id ] = 0
}

public EventPlayerSpawn( id )
{
	new health
	new newhealth
	new money
	new newmoney
	new armor
	new newarmor
	
	money = cs_get_user_money( id )
	newmoney = money + (PLEVEL[ id ] * 100)
	cs_set_user_money( id, newmoney)
	
	if( PLEVEL[ id ] <= 25 )
	{
		health = get_user_health( id )
		newhealth = health + (PLEVEL[ id ])
		set_user_health( id, newhealth )
	}
	else
	{
		health = get_user_health( id )
		newhealth = 125
		
		armor = get_user_armor( id )
		newarmor = armor + ((PLEVEL[ id ]) - 25)
		set_user_armor( id, newarmor )
		set_user_health( id, newhealth )
	}
}

public EventDeathMsg()
{
	new killer = read_data( 1 )
	new victim = read_data( 2 )
	new headshot = read_data( 3 )
	new xp
	new hs
	
	if(PLEVEL[ killer ] > PLEVEL[ victim ])
	{
		xp = 4
	}
	
	if(PLEVEL[ killer ] < PLEVEL[ victim ])
	{
		xp = 6
	}
	
	if(PLEVEL[ killer ] == PLEVEL[ victim ])
	{
		xp = 5
	}
	
	PKS[ victim ] = 0
	
	if( victim == killer )
	{
		return PLUGIN_CONTINUE
	}
	
	if(headshot)
	{
		xp = xp + 5
		hs = 1
	}
	
	if(PKS[ killer ] < 10)
	{
		PKS[ killer ]++
	}
	
	xp = xp + PKS[ killer ]
	
	add_xp( killer, xp, hs )
	check_level( killer )
	
	new Text[ 100 ]
	formatex(Text,191,"You died and lost your killstreak!")
	MakeTutor(victim,Text,RED,3.0)
	
	return PLUGIN_CONTINUE
}


/* Add xp */
public add_xp( id, xp, hs )
{
	new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
	
	PXP[ id ] = PXP[ id ] + xp
	
	if(hs)
	{
		new Text[ 100 ]
		formatex(Text,191,"Headshot! You got %d xp! ^nKillstreak: %d^nNew level after %d xp!", xp, PKS[ id ], newlevel)
		MakeTutor(id,Text,GREEN,3.0)
	}
	else
	{
		new Text[ 100 ]
		formatex(Text,191,"You got %d xp! ^nKillstreak: %d^nNew level after %d xp!", xp, PKS[ id ], newlevel)
		MakeTutor(id,Text,GREEN,3.0)
	}
}

/* Lets check if player got a new level */
public check_level( id )
{
	if(PXP[ id ] >= LEVELS[PLEVEL[ id ]])
	{
		PLEVEL[ id ]++
		new Text[ 100 ]
		formatex(Text,191,"You are now level %d!", PLEVEL[ id ])
		MakeTutor(id,Text,GREEN,5.0)
	}
}

/* Lets print the list of weapon achievments */
public printWeapons( id )
{
	new Text[ 255 ]
	formatex(Text,191,
	"LEVEL 5 Unlock^nGolden Knife^n^nLEVEL 7 Unlock^nGolden Elites^n^nLEVEL 10 Unlock^nGolden Deagle^n^nLevel 15 Unlock^nGerman Grenade")
	MakeTutor(id,Text,YELLOW,7.0)
}

public printHelp( id )
{
	//new Text[ 255 ]
	//formatex(Text,191,
	//"Selleks, et vaadata enda levelit kirjuta:^n/level ^nSelleks, et vaadata enda XPd kirjuta:^n/xp^nSelleks, et vaadata millal uus level tuleb kirjuta:^n/uuslevel^n^nSelleks, et vaadata millal mis relva lahti saad kirjuta:^n/relvad")
	//MakeTutor(id,Text,YELLOW,7.0)
}

/* Plugin information */
public printInfo( id )
{
	new Text[ 255 ]
	formatex(Text,191,
	"What is SURF XP MOD?^n-SXM is mod created by Ardivaba for surf server^n^nWhat can i do with levels?^n-Levels reward you HP, starting money and golden weapons")
	MakeTutor(id,Text,YELLOW,7.0)
}

/* Lets print players ammount of xp */
public printXp( id )
{
	new Text[ 100 ]
	formatex(Text,191,"You have %d xp!", PXP[ id ])
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print when player get's new level */
public printNewLevel( id )
{
	new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
	new Text[ 100 ]
	formatex(Text,191,"New level after %d xp!", newlevel)
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print players level */
public printLevel( id )
{
	
	new Text[ 100 ]
	formatex(Text,191,"Your level is %d!", PLEVEL[ id ])
	MakeTutor(id,Text,YELLOW,3.0)
}

/* Save Data to nVault */
public SaveData(id)
{
	new AuthID[35]
	get_user_name(id,AuthID,34)
	
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-Mod",AuthID)
	format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
	nvault_set(g_vault,vaultkey,vaultdata)
	return PLUGIN_CONTINUE
}

/* Load Data  from nVault */
public LoadData(id)
{
	new AuthID[35]
	get_user_name(id,AuthID,34)
	
	new vaultkey[64],vaultdata[256]
	format(vaultkey,63,"%s-Mod",AuthID)
	format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
	nvault_get(g_vault,vaultkey,vaultdata,255)
	
	replace_all(vaultdata, 255, "#", " ")
	
	new playerxp[32], playerlevel[32]
	
	parse(vaultdata, playerxp, 31, playerlevel, 31)
	
	PXP[id] = str_to_num(playerxp)
	PLEVEL[id] = str_to_num(playerlevel)
	
	return PLUGIN_CONTINUE
}

/* Teeme tutori teksti */
MakeTutor(id,Text[],Color,Float:Time = 0.0) {
	
	client_cmd( id, "spk %s", MSOUND )
	
	if(is_user_connected( id ))
	{
		message_begin(MSG_ONE_UNRELIABLE,g_MsgTutor,_,id)
		write_string(Text)
		write_byte(0)
		write_short(0)
		write_short(0)
		write_short(1<<Color)
		message_end()
	}
	
	if(Time != 0.0) {
		
		if( task_exists( id + TASK_TUT ) )
		{
			remove_task( id + TASK_TUT )
		}
		
		set_task(Time,"RemoveTutor",id + TASK_TUT)
	}
}

/* Lets Remove Tutor */
public RemoveTutor(taskID) {
	
	new id = taskID - TASK_TUT
	message_begin(MSG_ALL,g_MsgTutClose,_,id)
	message_end()
}

/* Golden Weapons */

public ev_CurWeapon(id)
{
	if(!is_user_connected(id) || !is_user_alive(id)) 
	{
		return PLUGIN_HANDLED;
	}
	
	new Weapon_Id = read_data(2)
	
	/* Golden Knife */
	if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 5 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gknife.mdl")
	}
	
	/* Golden Elites */
	if(Weapon_Id == CSW_ELITE && PLEVEL[ id ] >= 7 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gelite.mdl")
	}
	
	/* Golden Deagle */
	if(Weapon_Id == CSW_DEAGLE && PLEVEL[ id ] >= 10 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_gdeagle.mdl")
	}
	
	/* German Grenade */
	if(Weapon_Id == CSW_HEGRENADE && PLEVEL[ id ] >= 15 ) 
	{
		set_pev(id, pev_viewmodel2, "models/customs/v_shegrenade.mdl")
	}
	
	return PLUGIN_CONTINUE;
}

public fwHamTakeDamage(victim, inflictor, attacker, Float:damage, damagebits)
{
	
	/* Golden Knife */
	if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 5)
	{
		SetHamParamFloat(4, damage * 1.5)
		return HAM_HANDLED
	}
	
	/* Golden Elites */
	if(get_user_weapon(attacker) == CSW_ELITE && PLEVEL[ attacker ] >= 7)
	{
		SetHamParamFloat(4, damage * 1.5)
		return HAM_HANDLED
	}
	
	/* Golden Deagle */
	if(get_user_weapon(attacker) == CSW_DEAGLE && PLEVEL[ attacker ] >= 10)
	{
		SetHamParamFloat(4, damage * 1.3)
		return HAM_HANDLED
	}
	
	/* German Grenade */
	if(get_user_weapon(attacker) == CSW_HEGRENADE && PLEVEL[ attacker ] >= 15)
	{
		SetHamParamFloat(4, damage * 1.4)
		return HAM_HANDLED
	}
	
	return HAM_IGNORED 
}
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
likepro
Membru, skill 0
Membru, skill 0
Posts: 44
Joined: 01 Mar 2013, 17:27
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 10 times
Been thanked: 7 times
Contact:

07 Mar 2013, 11:09

de ce oare nu functioneaza?:(( zice bad load
User avatar
Fantasy1
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 4836
Joined: 05 Jul 2012, 01:26
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (1 Mar)
Utilizator neserios (TEPAR!)
Has thanked: 278 times
Been thanked: 217 times
Contact:

09 Mar 2013, 18:54

Merge si din pacate se vede imaginea aia in dreapta.. , am si eu nev urgent de el.
CLICK AICI pentru FORUM
- Un Forum Care Nu Poate Fi Spart -
- Un Forum Care Nu Modifica Topicurile Cu Tepari -
- Vrei Indexare In Google? Posteaza Tzeparii La Noi -

- Daca ai nevoie sa te ajut cu un addons/plugin etc se plateste, nu ajut cu nimic pe GRATIS -
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 20 guests