Eroare plugin Askhanar

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
^^^aLaNkiZZiiXX^^^
Membru nou
Membru nou
Posts: 1
Joined: 14 May 2019, 20:48
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

18 Jun 2019, 19:10

Plugin Cerut: Imi da aceste erori la plugin-ul lui askhanar
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
//#include <CC_ColorChat>
//#include <fcs>

#define PLUGIN "FCS PlayedTime Reward"
#define VERSION "1.2.0"  // 1.x.x  noi verificari/imbunatatiri

#define TASK_pentru	06091993

enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
}

new TeamName[  ][  ] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}





//--| 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 const g_szTag[ ] = "[Furien Credits]";

new g_iCvarPTREnable;
new g_iCvarPTRMinutes;
new g_iCvarPTRCredits;

new g_iUserTime[ 33 ];

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	g_iCvarPTREnable = register_cvar( "fcs_pentru_enable", "1" );
	g_iCvarPTRMinutes = register_cvar( "fcs_pentru_minutes", "5" );
	g_iCvarPTRCredits = register_cvar( "fcs_pentru_credits", "15" );
	
	set_task( 1.0, "task_Time", TASK_pentru, _, _, "b", 0 );
	// Add your code here...
}



public client_putinserver( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_CONTINUE;
	
	g_iUserTime[ id ] = 0;
	
	return PLUGIN_CONTINUE;
}

public client_disconnect( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_CONTINUE;
		
	g_iUserTime[ id ] = 0;
	
	return PLUGIN_CONTINUE;
}

public task_PTRFunction( )
{
	if( get_pcvar_num( g_iCvarPTREnable ) != 1 )
		return;
		
	static iPlayers[ 32 ];
	static iPlayersNum;
	
	get_players( iPlayers, iPlayersNum, "ch" );
	if( !iPlayersNum )
		return;
	
	static id, i;
	for( i = 0; i < iPlayersNum; i++ )
	{
		id = iPlayers[ i ];
		
		g_iUserTime[ id ]++;
		
		new iTime;
		iTime = get_pcvar_num( g_iCvarPTRMinutes ) ;
		
		if( g_iUserTime[ id ] >= iTime * 60 )
		{
			g_iUserTime[ id ] -= iTime * 60;
			
			new iCredits = get_pcvar_num( g_iCvarPTRCredits );
			
			fcs_add_user_credits( id, iCredits );
			ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 %i^x01 credite pentru^x03 %i^x01 minute jucate!",
				g_szTag, iCredits, iTime );
				
		}
	}
	
}


ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

	vformat(  szMessage[ 1 ], 251, msg, 4  );

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	szMessage[ 192 ] = '^0';
	

	new iTeam, iColorChange, iPlayerIndex, MSG_Type;
	
	if( id )
	{
		MSG_Type  =  MSG_ONE_UNRELIABLE;
		iPlayerIndex  =  id;
	}
	else
	{
		iPlayerIndex  =  CC_FindPlayer(  );
		MSG_Type = MSG_ALL;
	}
	
	iTeam  =  get_user_team( iPlayerIndex );
	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);

	CC_ShowColorMessage(  iPlayerIndex, MSG_Type, szMessage  );
		
	if(  iColorChange  )	CC_Team_Info(  iPlayerIndex, MSG_Type,  TeamName[ iTeam ]  );

}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
{
	
	static bool:bSayTextUsed;
	static iMsgSayText;
	
	if(  !bSayTextUsed  )
	{
		iMsgSayText  =  get_user_msgid( "SayText" );
		bSayTextUsed  =  true;
	}
	
	message_begin( iType, iMsgSayText, _, id  );
	write_byte(  id  )		
	write_string(  szMessage  );
	message_end(  );
}

CC_Team_Info( id, const iType, const szTeam[  ] )
{
	static bool:bTeamInfoUsed;
	static iMsgTeamInfo;
	if(  !bTeamInfoUsed  )
	{
		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
		bTeamInfoUsed  =  true;
	}
	
	message_begin( iType, iMsgTeamInfo, _, id  );
	write_byte(  id  );
	write_string(  szTeam  );
	message_end(  );

	return 1;
}

CC_ColorSelection(  id, const iType, Color:iColorType)
{
	switch(  iColorType  )
	{
		
		case RED:	return CC_Team_Info(  id, iType, TeamName[ 1 ]  );
		case BLUE:	return CC_Team_Info(  id, iType, TeamName[ 2 ]  );
		case GREY:	return CC_Team_Info(  id, iType, TeamName[ 0 ]  );

	}

	return 0;
}

CC_FindPlayer(  )
{
	new iMaxPlayers  =  get_maxplayers(  );
	
	for( new i = 1; i <= iMaxPlayers; i++ )
		if(  is_user_connected( i )  )
			return i;
	
	return -1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ froman\\ fcharset0 Times New Roman;}}\n{\\ colortbl ;\\ red0\\ green0\\ blue0;}\n\\ viewkind4\\ uc1\\ pard\\ cf1\\ lang11274\\ f0\\ fs24 \n\\ par }
*/
Erorile:
| Afiseaza codul
L 06/18/2019 - 18:38:12: Function is not present (function "task_Time") (plugin "TimeReward.amxx")
L 06/18/2019 - 18:38:12: [AMXX] Displaying debug trace (plugin "TimeReward.amxx")
L 06/18/2019 - 18:38:12: [AMXX] Run time error 10: native error (native "set_task")
L 06/18/2019 - 18:38:12: [AMXX]    [0] 2253x7o2.sma.p::plugin_init (line 107)
in logs...
Descriere (adica ce face el mai exact): Am spus mai sus
Serverul ruleaza (HLDS/ReHLDS): ReHLDS
Versiune AMX Mod X:1.8.2
Modul Serverului: Furien
Este plugin-ul care ar fi trebuit sa dea 15 credite la 5 min
RoyalServer 2
User avatar
WHOAMI?
eXtream Mod
eXtream Mod
Posts: 999
Joined: 17 Dec 2013, 19:51
Detinator Steam: Da
Reputatie: eXtream Mod
Fost Membru Club eXtreamCS (o luna)
Location: US
Has thanked: 30 times
Been thanked: 20 times

28 Jun 2019, 15:42

Activeaza

Code: Select all

#include <CC_ColorChat>
#include <fcs>
Dupa ai nevoie de fisierul fcs.inc ca sa-l poti compila.
| Afiseaza codul
#if defined _fcs_included
	#endinput
#endif

#define _fcs_included



/*
 * 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);
}
User avatar
LOLpgl
Membru, skill +3
Membru, skill +3
Posts: 1127
Joined: 16 Dec 2013, 21:01
Detinator Steam: Da
SteamID: ionutcruso
Location: Rm.Valcea
Has thanked: 19 times
Been thanked: 15 times

29 Jun 2019, 02:18

Poftim.

Code: Select all

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
//#include <CC_ColorChat>
//#include <fcs>

#define PLUGIN "FCS PlayedTime Reward"
#define VERSION "1.2.0"  // 1.x.x  noi verificari/imbunatatiri

#define TASK_pentru	06091993

enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
}

new TeamName[  ][  ] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
}





//--| 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 const g_szTag[ ] = "[Furien Credits]";

new g_iCvarPTREnable;
new g_iCvarPTRMinutes;
new g_iCvarPTRCredits;

new g_iUserTime[ 33 ];

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	g_iCvarPTREnable = register_cvar( "fcs_pentru_enable", "1" );
	g_iCvarPTRMinutes = register_cvar( "fcs_pentru_minutes", "5" );
	g_iCvarPTRCredits = register_cvar( "fcs_pentru_credits", "15" );
	
	set_task( 1.0, "task_PTRFunction", TASK_pentru, _, _, "b", 0 );
	// Add your code here...
}



public client_putinserver( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_CONTINUE;
	
	g_iUserTime[ id ] = 0;
	
	return PLUGIN_CONTINUE;
}

public client_disconnect( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_CONTINUE;
		
	g_iUserTime[ id ] = 0;
	
	return PLUGIN_CONTINUE;
}

public task_PTRFunction( )
{
	if( get_pcvar_num( g_iCvarPTREnable ) != 1 )
		return;
		
	static iPlayers[ 32 ];
	static iPlayersNum;
	
	get_players( iPlayers, iPlayersNum, "ch" );
	if( !iPlayersNum )
		return;
	
	static id, i;
	for( i = 0; i < iPlayersNum; i++ )
	{
		id = iPlayers[ i ];
		
		g_iUserTime[ id ]++;
		
		new iTime;
		iTime = get_pcvar_num( g_iCvarPTRMinutes ) ;
		
		if( g_iUserTime[ id ] >= iTime * 60 )
		{
			g_iUserTime[ id ] -= iTime * 60;
			
			new iCredits = get_pcvar_num( g_iCvarPTRCredits );
			
			fcs_add_user_credits( id, iCredits );
			ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 %i^x01 credite pentru^x03 %i^x01 minute jucate!",
				g_szTag, iCredits, iTime );
				
		}
	}
	
}


ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

	vformat(  szMessage[ 1 ], 251, msg, 4  );

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	szMessage[ 192 ] = '^0';
	

	new iTeam, iColorChange, iPlayerIndex, MSG_Type;
	
	if( id )
	{
		MSG_Type  =  MSG_ONE_UNRELIABLE;
		iPlayerIndex  =  id;
	}
	else
	{
		iPlayerIndex  =  CC_FindPlayer(  );
		MSG_Type = MSG_ALL;
	}
	
	iTeam  =  get_user_team( iPlayerIndex );
	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);

	CC_ShowColorMessage(  iPlayerIndex, MSG_Type, szMessage  );
		
	if(  iColorChange  )	CC_Team_Info(  iPlayerIndex, MSG_Type,  TeamName[ iTeam ]  );

}

CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
{
	
	static bool:bSayTextUsed;
	static iMsgSayText;
	
	if(  !bSayTextUsed  )
	{
		iMsgSayText  =  get_user_msgid( "SayText" );
		bSayTextUsed  =  true;
	}
	
	message_begin( iType, iMsgSayText, _, id  );
	write_byte(  id  )		
	write_string(  szMessage  );
	message_end(  );
}

CC_Team_Info( id, const iType, const szTeam[  ] )
{
	static bool:bTeamInfoUsed;
	static iMsgTeamInfo;
	if(  !bTeamInfoUsed  )
	{
		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
		bTeamInfoUsed  =  true;
	}
	
	message_begin( iType, iMsgTeamInfo, _, id  );
	write_byte(  id  );
	write_string(  szTeam  );
	message_end(  );

	return 1;
}

CC_ColorSelection(  id, const iType, Color:iColorType)
{
	switch(  iColorType  )
	{
		
		case RED:	return CC_Team_Info(  id, iType, TeamName[ 1 ]  );
		case BLUE:	return CC_Team_Info(  id, iType, TeamName[ 2 ]  );
		case GREY:	return CC_Team_Info(  id, iType, TeamName[ 0 ]  );

	}

	return 0;
}

CC_FindPlayer(  )
{
	new iMaxPlayers  =  get_maxplayers(  );
	
	for( new i = 1; i <= iMaxPlayers; i++ )
		if(  is_user_connected( i )  )
			return i;
	
	return -1;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ froman\\ fcharset0 Times New Roman;}}\n{\\ colortbl ;\\ red0\\ green0\\ blue0;}\n\\ viewkind4\\ uc1\\ pard\\ cf1\\ lang11274\\ f0\\ fs24 \n\\ par }
*/
Post Reply

Return to “Cereri”

  • Information