Raised This Month: $ Target: $400
 0% 

[HL] How to write a plugin that will...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 02-09-2010 , 20:04   Re: [HL] How to write a plugin that will...
Reply With Quote #7

Quote:
Originally Posted by nakash View Post
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(PLUGINVERSIONAUTHOR)
    
    
// Restart
    
register_clcmd("say !rr""cmdrr")
}

public  
cmdrr(pid,level,id,cid)
{
    if(!
cmd_access (pid,level,cid,1)) return PLUGIN_HANDLED
    
new szName33 ];
    
get_user_namecid szName charsmaxszName ) );
    
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_pluginPLUGIN VERSION AUTHOR )
    
register_clcmd"say !rr" "rr" )
}

public 
rrid )
{
    if (
get_user_flagsid ) & FLAG)
    {
        new 
name[32]
        
get_user_nameid name charsmax(name) )
        
server_cmd"sv_restart 1" )
        
client_printprint_chat "%s has restarted the round"name )
    }


Last edited by AfteR.; 02-09-2010 at 20:37.
AfteR. is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode