Jump to content

Cerere Plugin


ReaL Low Head

Recommended Posts

Nume : real.no.scuze


Versiune : 


Descriere detaliata :plugin  integrat , in sensul  ca playerul sa poata sa se puna spec : y/spec  ,max 10 min  , dar la intrare pe servar sa intre obligat la joc , sa nu aiba optiunea spec !


  • Like 1
Link to comment
Share on other sites

 

#include <amxmodx>

#include <cstrike>
 
#define PLUGIN "Detect Spectators"
#define VERSION "1.0"
#define AUTHOR "anakin_cstrike"
 
#define ACCESS ADMIN_IMMUNITY
 
new const g_Reason[] = "Nu sunt permisi spectatorii!";
new const g_Teams[2][32] = { "Terrorist", "Counter-Terrorist" }
 
new toggle_plugin, toggle_mode, toggle_time, toggle_announce, toggle_evoy;
new g_Count[33],g_msgsaytext;
 
public plugin_init() 
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("TeamInfo","event_teaminfo", "a");
 
toggle_plugin = register_cvar("detectspectators", "1");
toggle_mode = register_cvar("detectspectators_mode", "1");
toggle_time = register_cvar("detectspectators_time", "600");
toggle_evoy = register_cvar("detectspectators_admins", "0");
toggle_announce = register_cvar("detectspectators_announe", "1");
 
g_msgsaytext = get_user_msgid("SayText");
}
 
public event_teaminfo()
{
if(get_pcvar_num(toggle_plugin) != 1)
return PLUGIN_CONTINUE;
 
new index = read_data(1);
new team[ 2 ];
read_data(2, team, sizeof team - 1);
 
if(team[0] == 'S')
{
if(g_Count[ index ] >= 1)
g_Count[ index ] = 0;
 
print(index, "Poti sta spectator %d secunde", get_pcvar_num( toggle_time ) );
set_task(1.0, "count_time", index+123, _, _, "b");
 
} else {
g_Count[ index ] = 0;
remove_task( index+123 );
}
 
return PLUGIN_CONTINUE;
}
 
public count_time(task)
{
new index = task - 123;
 
if( !is_user_connected( index ))
return 0;
if( ( get_user_flags( index ) & ACCESS ) && get_pcvar_num( toggle_evoy ) == 0)
return 0;
 
g_Count[ index ]++;
 
if( get_timer( index ) >= get_pcvar_num( toggle_time ))
{
switch( get_pcvar_num( toggle_mode ) )
{
case 1:
{
new i = random_num( 1, 2 );
cs_set_user_team( index, i == 1 ? CS_TEAM_T : CS_TEAM_CT );
print( index, "Ai fost mutat la echipa %s", i == 1 ? g_Teams[ 0 ] : g_Teams[ 1 ] );
}
 
case 2: 
{
server_cmd( "kick #%d ^"%s^"", get_user_userid( index ), g_Reason );
if( get_pcvar_num( toggle_announce ) == 1 )
print(0, "%s a fost deconectat pentru ca a stat spectator %d secunde", get_pcvar_num( toggle_time ) );
}
}
 
remove_task( index+ 123 );
g_Count[ index ] = 0;
}
 
return 0;
}
 
public get_timer( index ) return g_Count[ index ];
 
public client_putinserver( id ) g_Count[ id ] = 0; 
public client_disconnect( id )
g_Count[ id ] = 0; 
remove_task(id+123); 
}
 
print( id, const message[], {Float,Sql,Result,_}:... )
{
new Buffer[ 128 ],Buffer2[ 128 ];
new players[ 32 ], index, num, i;
 
formatex( Buffer2, sizeof Buffer2 - 1, "%s",message );
vformat( Buffer, sizeof Buffer - 1, Buffer2, 3 );
get_players( players, num, "ch" );
 
if( id )
{
if( !is_user_connected( id ))
return 0;
 
message_begin( MSG_ONE, g_msgsaytext, _, id );
write_byte( id );
write_string( Buffer );
message_end();
} else {
for( i = 0; i < num;i++ )
{
index = players[ i ];
if( !is_user_connected( index )) 
continue;
 
message_begin( MSG_ONE, g_msgsaytext, _, index );
write_byte( index );
write_string( Buffer );
message_end();
}
}
 
return 1;
}

 
Aici sunt Minuntele 10 Min = 600 Secunde

toggle_time = register_cvar("detectspectators_time", "600");

 

Vezi daca O sa-ti mearga. 
Descarcare : Aici
Link to comment
Share on other sites

 

 

#include <amxmodx>

#include <cstrike>
 
#define PLUGIN "Detect Spectators"
#define VERSION "1.0"
#define AUTHOR "anakin_cstrike"
 
#define ACCESS ADMIN_IMMUNITY
 
new const g_Reason[] = "Nu sunt permisi spectatorii!";
new const g_Teams[2][32] = { "Terrorist", "Counter-Terrorist" }
 
new toggle_plugin, toggle_mode, toggle_time, toggle_announce, toggle_evoy;
new g_Count[33],g_msgsaytext;
 
public plugin_init() 
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("TeamInfo","event_teaminfo", "a");
 
toggle_plugin = register_cvar("detectspectators", "1");
toggle_mode = register_cvar("detectspectators_mode", "1");
toggle_time = register_cvar("detectspectators_time", "600");
toggle_evoy = register_cvar("detectspectators_admins", "0");
toggle_announce = register_cvar("detectspectators_announe", "1");
 
g_msgsaytext = get_user_msgid("SayText");
}
 
public event_teaminfo()
{
if(get_pcvar_num(toggle_plugin) != 1)
return PLUGIN_CONTINUE;
 
new index = read_data(1);
new team[ 2 ];
read_data(2, team, sizeof team - 1);
 
if(team[0] == 'S')
{
if(g_Count[ index ] >= 1)
g_Count[ index ] = 0;
 
print(index, "Poti sta spectator %d secunde", get_pcvar_num( toggle_time ) );
set_task(1.0, "count_time", index+123, _, _, "b");
 
} else {
g_Count[ index ] = 0;
remove_task( index+123 );
}
 
return PLUGIN_CONTINUE;
}
 
public count_time(task)
{
new index = task - 123;
 
if( !is_user_connected( index ))
return 0;
if( ( get_user_flags( index ) & ACCESS ) && get_pcvar_num( toggle_evoy ) == 0)
return 0;
 
g_Count[ index ]++;
 
if( get_timer( index ) >= get_pcvar_num( toggle_time ))
{
switch( get_pcvar_num( toggle_mode ) )
{
case 1:
{
new i = random_num( 1, 2 );
cs_set_user_team( index, i == 1 ? CS_TEAM_T : CS_TEAM_CT );
print( index, "Ai fost mutat la echipa %s", i == 1 ? g_Teams[ 0 ] : g_Teams[ 1 ] );
}
 
case 2: 
{
server_cmd( "kick #%d ^"%s^"", get_user_userid( index ), g_Reason );
if( get_pcvar_num( toggle_announce ) == 1 )
print(0, "%s a fost deconectat pentru ca a stat spectator %d secunde", get_pcvar_num( toggle_time ) );
}
}
 
remove_task( index+ 123 );
g_Count[ index ] = 0;
}
 
return 0;
}
 
public get_timer( index ) return g_Count[ index ];
 
public client_putinserver( id ) g_Count[ id ] = 0; 
public client_disconnect( id )
g_Count[ id ] = 0; 
remove_task(id+123); 
}
 
print( id, const message[], {Float,Sql,Result,_}:... )
{
new Buffer[ 128 ],Buffer2[ 128 ];
new players[ 32 ], index, num, i;
 
formatex( Buffer2, sizeof Buffer2 - 1, "%s",message );
vformat( Buffer, sizeof Buffer - 1, Buffer2, 3 );
get_players( players, num, "ch" );
 
if( id )
{
if( !is_user_connected( id ))
return 0;
 
message_begin( MSG_ONE, g_msgsaytext, _, id );
write_byte( id );
write_string( Buffer );
message_end();
} else {
for( i = 0; i < num;i++ )
{
index = players[ i ];
if( !is_user_connected( index )) 
continue;
 
message_begin( MSG_ONE, g_msgsaytext, _, index );
write_byte( index );
write_string( Buffer );
message_end();
}
}
 
return 1;
}

 
Aici sunt Minuntele 10 Min = 600 Secunde

toggle_time = register_cvar("detectspectators_time", "600");

 

Vezi daca O sa-ti mearga. 
Descarcare : Aici

 

 super .... functioneaza ..... multumesc .. si o zi buna !

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...