[Modificare] Plugin credite

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Aneimar
Membru, skill 0
Membru, skill 0
Posts: 90
Joined: 07 Apr 2016, 00:16
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 1 time
Contact:

10 Oct 2019, 19:30

Salut , doresc sa imi modificati acest plugin cu aceste native .

Code: Select all

native get_user_euro(id)
native set_user_euro(id, euroo)
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

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

#define PLUGIN "FCS PlayedTime Reward"
#define VERSION "0.2.0"

#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 ]++;
static iTime;
iTime = get_pcvar_num( g_iCvarPTRMinutes ) ;

if( g_iUserTime[ id ] >= iTime * 60 )
{
g_iUserTime[ id ] -= iTime * 60;

static iCredits;
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;
}
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests