[REZOLVAT][Cerere Modificare] Plugin Kill Reward

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Starke
Membru, skill 0
Membru, skill 0
Posts: 63
Joined: 26 Jun 2013, 20:23
Detinator Steam: Nu
CS Status: DR.CS1.RO
Detinator server CS: DR.CS1.RO
Has thanked: 18 times
Contact:

23 Jul 2014, 18:57

Salut , am si eu un plugin care iti da credite pe kill dar este pe sistemul de credite a lui Askhanar , iar eu il folosesc pe cel a lui aragon si as dori sa-mi fie trecut pe cel a lui aragon
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
//include <fcs>

#define PLUGIN "FCS Kill Reward"
#define VERSION "0.1.5"


//--| Furien Credits System .inc file
/*
 * Returns a players credits
 * 
 * @param		client - The player index to get points of
 * 
 * @return		The credits client
 * 
 */

native fcs_get_user_credits(client);

/*
 * Sets <credits> to client
 * 
 * @param		client - The player index to set points to
 * @param		credits - The amount of credits to set to client
 * 
 * @return		The credits of client
 * 
 */

native fcs_set_user_credits(client, credits);

/*
 * Adds <credits> points to client
 * 
 * @param		client - The player index to add points to
 * @param		credits - The amount of credits to add to client
 * 
 * @return		The credits of client
 * 
 */

stock fcs_add_user_credits(client, credits)
{
	return fcs_set_user_credits(client, fcs_get_user_credits(client) + credits);
}

/*
 * Subtracts <credits>  from client
 * 
 * @param		client - The player index to subtract points from
 * @param		credits - The amount of credits to substract from client
 * 
 * @return		The credits of client
 * 
 */

stock fcs_sub_user_credits(client, credits)
{
	return fcs_set_user_credits(client, fcs_get_user_credits(client) - credits);
}

//--| End of Furien Credits System .inc file

new g_iCvarEnable;
new g_iCvarCredits;
new g_iCvarHSCredits;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	g_iCvarEnable = register_cvar( "fcs_kr_enable", "1" );
	g_iCvarCredits = register_cvar( "fcs_kr_credits", "7" );
	g_iCvarHSCredits = register_cvar( "fcs_kr_hscredits", "3" );//( bonus, fcs_kr_credits + fcs_kr_hscredits )
	
	register_event( "DeathMsg","ev_DeathMsg", "a")
	
}

public ev_DeathMsg()
{
	if( get_pcvar_num( g_iCvarEnable ) != 1 )
		return;
	new iKiller = read_data( 1 );
	if( iKiller == read_data( 2 ) )
		return;
		
	new iCredits = get_pcvar_num( g_iCvarCredits );
	
	if( read_data( 3 ) )
		iCredits += get_pcvar_num( g_iCvarHSCredits );
		
	fcs_add_user_credits( iKiller, iCredits );
	
}
Daca puteti sa puneti si un mesaj colorat cand primeste credite gen:Ai primit 7 credite pentru ca ai facut un kill . & Ai primit 10 credite pentru ca ai dat un HeadShot .


Native sistem credite aragon:
| Afiseaza codul
native get_user_credits(id);
native set_user_credits(id, cantitate);
Last edited by Cosmin on 23 Jul 2014, 21:51, edited 1 time in total.
Reason: #Rezolvat.
Image
Zonek
Cosmin
Fost moderator
Fost moderator
Posts: 9361
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

23 Jul 2014, 20:47

| Afiseaza codul
#include <amxmodx>

#define PLUGIN "FCS Kill Reward"
#define VERSION "0.1.5"


//--| Furien Credits System .inc file
/*
 * Returns a players credits
 * 
 * @param		client - The player index to get points of
 * 
 * @return		The credits client
 * 
 */

//native fcs_get_user_credits(client);

/*
 * Sets <credits> to client
 * 
 * @param		client - The player index to set points to
 * @param		credits - The amount of credits to set to client
 * 
 * @return		The credits of client
 * 
 */

//native fcs_set_user_credits(client, credits);

/*
 * Adds <credits> points to client
 * 
 * @param		client - The player index to add points to
 * @param		credits - The amount of credits to add to client
 * 
 * @return		The credits of client
 * 
 */

//stock fcs_add_user_credits(client, credits)
//{
	//return fcs_set_user_credits(client, fcs_get_user_credits(client) + credits);
//}

/*
 * Subtracts <credits>  from client
 * 
 * @param		client - The player index to subtract points from
 * @param		credits - The amount of credits to substract from client
 * 
 * @return		The credits of client
 * 
 */

//stock fcs_sub_user_credits(client, credits)
//{
	//return fcs_set_user_credits(client, fcs_get_user_credits(client) - credits);
//}

//--| End of Furien Credits System .inc file

new g_iCvarEnable;
new g_iCvarCredits;
new g_iCvarHSCredits;

native get_user_credits(id);
native set_user_credits(id, cantitate);

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	g_iCvarEnable = register_cvar( "fcs_kr_enable", "1" );
	g_iCvarCredits = register_cvar( "fcs_kr_credits", "7" );
	g_iCvarHSCredits = register_cvar( "fcs_kr_hscredits", "3" );//( bonus, fcs_kr_credits + fcs_kr_hscredits )
	
	register_event( "DeathMsg","ev_DeathMsg", "a")
	
}

public ev_DeathMsg()
{
	if( get_pcvar_num( g_iCvarEnable ) != 1 )
		return;
	static kiler,victim,hs
	
	kiler = read_data(1)
	victim = read_data(2)
	hs = read_data(3)
	if(kiler == victim) return
	
	if(kiler != victim)
	{
		set_user_credits(kiler,get_user_credits(kiler) + get_pcvar_num(g_iCvarCredits))
		color(kiler,"!teamAi primit !g%i credite !teampentru ca ai facut !g1 kill",get_pcvar_num(g_iCvarCredits))
	}
	if(hs)
	{
		set_user_credits(kiler,get_user_credits(kiler) + get_pcvar_num(g_iCvarHSCredits))
		color(kiler,"!teamAi primit !g%i credite !teampentru ca ai ai dat !gheadshot.",get_pcvar_num(g_iCvarHSCredits))
	}
}
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( );
			}
		}
	}
}
Starke
Membru, skill 0
Membru, skill 0
Posts: 63
Joined: 26 Jun 2013, 20:23
Detinator Steam: Nu
CS Status: DR.CS1.RO
Detinator server CS: DR.CS1.RO
Has thanked: 18 times
Contact:

23 Jul 2014, 21:46

Multumesc.
Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests