Įspėjimo Pluginas.
Posted: 2013 Apr 27 17:50
Sveiki, radau internete pluginą: amx_warn.
Komanda: amx_warn
Flag: ADMIN_BAN
Nemėginau dar šito compilint, jeigu bus errorų, praneškit..
Komanda: amx_warn
Flag: ADMIN_BAN
Code: Select all
#include <amxmodx>#include <amxmisc> new WarnTimes[ 33 ]; public plugin_init( ) { register_plugin( "Amx Warnig with Reason" , "0.1" , "kramesa" ); register_clcmd( "amx_warn" , "Warning" , ADMIN_BAN , "<name> <reason> - Warn a player selected." );} public Warning( id , level , cid ) { if( !cmd_access( id , level , cid , 3) ) { return PLUGIN_HANDLED; } new User[ 32 ] , Reason[ 32 ] , szName[ 32 ] , Uid; read_argv( 1 , User , 31 ); read_argv( 2 , Reason , 31 ); Uid = find_player( "bhl" , User ); get_user_name( Uid , szName , 31 ); if( Uid == 0 ) { client_print( id , print_chat , "[AMXX] Player not found." ); return PLUGIN_HANDLED; } else { if( strlen( Reason ) == 0 ) { client_print( id , print_chat , "[AMXX] You need put a reason."); return PLUGIN_HANDLED; } client_print( id , print_chat , "[AMXX] Warn sent to %s." , szName); client_print( Uid , print_chat , "(%s): You have been warned %d of 3 times. Reason: [%s]" , szName , WarnTimes[ Uid ] , Reason ); WarnTimes[ Uid ]++; return PLUGIN_HANDLED; } return PLUGIN_HANDLED;}