 |
|
Veteran Member
Join Date: Dec 2008
Location: λ
|

02-09-2010
, 20:04
Re: [HL] How to write a plugin that will...
|
#7
|
Quote:
Originally Posted by nakash
It gives me an error: undefinded symbol "slay".
another problem that I have is when someone types !rr it prints the name of the server and not the player who wrote !rr,is there a way to fix that?
PHP Code:
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
// Restart
register_clcmd("say !rr", "cmdrr")
}
public cmdrr(pid,level,id,cid)
{
if(!cmd_access (pid,level,cid,1)) return PLUGIN_HANDLED
new szName[ 33 ];
get_user_name( cid , szName , charsmax( szName ) );
client_print(0,print_chat,"%s has restarted the round.",szName)
server_cmd("sv_restart 1")
return 0;
}
|
PHP Code:
#include <amxmodx>
#define PLUGIN "Restart in chat"
#define VERSION "1.0"
#define AUTHOR "AfteR ;)"
const FLAG = ADMIN_CHAT
public plugin_init( )
{
register_plugin( PLUGIN , VERSION , AUTHOR )
register_clcmd( "say !rr" , "rr" )
}
public rr( id )
{
if (get_user_flags( id ) & FLAG)
{
new name[32]
get_user_name( id , name , charsmax(name) )
server_cmd( "sv_restart 1" )
client_print( 0 , print_chat , "%s has restarted the round", name )
}
}
Last edited by AfteR.; 02-09-2010 at 20:37.
|
|
|
|