Nick: RealWolf. Grad: MembruMesaje : 379 Bani : 2532 Multumiri : 2
| Subiect: [Plugin] Demo CMD Sam Iul 11, 2015 4:26 pm | |
| Titlu: Demo CMD Descriere: Cu acest plugin faceti unui player Demo Download: - Cod:
-
[/* Demo CMD ================================ | SkepT Jr. | ================================ Copyright © 2015, SkepT Jr. */
#include <amxmodx> #include <amxmisc> #include <CC_ColorChat> #include <cstrike>
#define PLUGIN "Demo CMD" #define VERSION "v1" #define AUTHOR "SkepT Jr."
#define FLAG ADMIN_SLAY
new bool:demo_on [ 33 ] new bool:demo_off [ 33 ] new const LOGFILE [ ] = "demo.txt" new CreateHudSync
public plugin_init ( ) { register_plugin ( PLUGIN, VERSION, AUTHOR ) register_concmd ( "amx_demo", "ConCmd_Demo_ON", FLAG, "*< nick > Make a demo on Player" ) register_concmd ( "amx_undemo", "ConCmd_Demo_OFF", FLAG, "*< nick > Stop a demo on Player" ) CreateHudSync = CreateHudSyncObj ( ) set_task ( 120.0, "mesaje_catre_admini", _,_,_, "b" ) // Add your code here... }
public mesaje_catre_admini ( id ) {
if ( get_user_flags ( id ) & FLAG ) { new rand = random_num ( 1, 2 ) switch ( rand ) {
case 1: ColorChat ( 0, GREEN, "[Demo]^3 Pentru a face cuiva ^4Demo^3 folositi comanda ^4amx_demo < nume >^3. ^4" ) case 2: ColorChat ( 0, GREEN, "[Demo]^3 Pentru a oprii cuiva ^4Demo-ul^3 folositi comanda ^4amx_demo < nume >^3, doar daca are ^4Demo ON^3 . ^4" ) } } }
public ConCmd_Demo_ON ( id, level, cid ) { new argument [ 32 ], admin [ 32 ], player [ 32 ], timp [ 32 ], hostname [ 64 ] read_argv ( 1, argument, 31 ) new jucator = cmd_target ( id, argument, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS ) get_user_name ( id, admin, 31 ) get_user_name ( jucator, player, 31 ) get_cvar_string ( "hostname", hostname, 63 ) get_time ( "%m/%d/%Y - %H:%M:%S", timp, 31 )
if ( !( get_user_flags ( id ) & FLAG ) ) { client_cmd( id, "echo [Demo] NU ai acces la aceasta comanda!" ) return PLUGIN_HANDLED } if ( !cmd_access ( id, level, cid, 2 ) ) return PLUGIN_HANDLED if ( !jucator ) return PLUGIN_HANDLED if ( demo_on [ id ] ) { client_cmd ( jucator, "record %s", hostname ) server_cmd ( "say_team @ %s ii face demo lui %s", admin, jucator ) log_to_file ( LOGFILE, "[Demo] Admin %s a pornit demo-ul pe %s !", admin, player ) log_to_file ( LOGFILE, "[Demo] Data si ora: %s", timp ) demo_on [ id ] = true demo_off [ id ] = false return PLUGIN_HANDLED } return PLUGIN_HANDLED }
public ConCmd_Demo_OFF ( id, level, cid ) { new argument [ 32 ], admin [ 32 ], player [ 32 ], timp [ 32 ], hostname [ 64 ] read_argv ( 1, argument, 31 ) new jucator = cmd_target ( id, argument, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS ) get_user_name ( id, admin, 31 ) get_user_name ( jucator, player, 31 ) get_cvar_string ( "hostname", hostname, 63 ) get_time ( "%m/%d/%Y - %H:%M:%S", timp, 31 ) if ( !( get_user_flags ( id ) & FLAG ) ) { client_cmd( id, "echo [Demo] NU ai acces la aceasta comanda!" ) return PLUGIN_HANDLED } if ( !cmd_access ( id, level, cid, 2 ) ) return PLUGIN_HANDLED if ( !jucator ) return PLUGIN_HANDLED if ( demo_off [ id ] ) { client_cmd ( jucator, "stop" ) server_cmd ( "say_team @ %s a oprit demo-ul de pe %s", admin, jucator ) ColorChat ( jucator, GREEN, "[Demo]^3 ^4%s^3, ^4%s^3 ti-a facut ^4Demo^3, ai timp 5 minute sa il dai .^4", jucator, admin ) ColorChat ( jucator, GREEN, "[Demo]^3 ^4%s^3, ^4Demo-ul^3 are numele ^4%s^3 .^4", jucator, hostname ) ColorChat ( 0, GREEN, "[Demo]^3 ^4%s^3 i-a facut ^4Demo^3 lui ^4%s^3 .^4", admin, jucator ) set_hudmessage ( 0, 255, 0, -1.0, 0.29, 0, 0.0, 3.0, 0.0, 1.0, 3 ) ShowSyncHudMsg ( 0, CreateHudSync, "%s i-a facut Demo lui %s !", admin, player ) log_to_file ( LOGFILE, "[Demo] Admin %s a oprit demo-ul de pe %s !", admin, player ) log_to_file ( LOGFILE, "[Demo] Data si ora: %s", timp ) cs_set_user_team ( jucator, CS_TEAM_SPECTATOR ) demo_on [ id ] = false demo_off [ id ] = true return PLUGIN_HANDLED } else if ( !demo_on [ id ] ) { server_cmd ( "say_team @ %s acel player nu are Demo ON.", admin ) demo_on [ id ] = false demo_off [ id ] = false return PLUGIN_HANDLED } return PLUGIN_HANDLED }
public client_connect ( id ) { if ( is_user_bot ( id ) || is_user_hltv ( id ) ) return PLUGIN_HANDLED demo_on [ id ] = false demo_off [ id ] = false return PLUGIN_HANDLED }
public client_disconnect ( id ){ if ( is_user_bot ( id ) || is_user_hltv ( id ) ) return PLUGIN_HANDLED demo_on [ id ] = false demo_off [ id ] = false return PLUGIN_HANDLED }
Nume: Demo CMD Versiunea: V1 Instalare: 1. Compilam sursa 2. Fisierul nume_plugin.sma il puneti in addons/amxmodx/scripting 3. Fisierul nume_plugin.amxx il puneti in addons/amxmodx/plugins 4. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma: - Cod:
-
nume_plugin.amxx Cvars: -
|
|