Raised This Month: $ Target: $400
 0% 

Need help in scripting (basic stuff)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
limeassist
Junior Member
Join Date: Dec 2008
Old 12-18-2008 , 06:40   Need help in scripting (basic stuff)
Reply With Quote #1

First of all, hello there to everyone. This my first post here on AM.


I've decided to make a custom plugin for my servers, so that my admins could make people record demos and take screenshots.

I am a total newbie to scripting for amx, but have knowledge in C+ & Java.


Plugin itself is working just some coding problems, I need your help in :

1. Instead of sending this message to public chat, I want to be printed for admins only

(ADMINS).........

Code:
        client_print(0, print_chat, "** Screenshot taken on player ^"%s^" by admin ^"%s^" (%s) **", name, adminname, timestamp)
2. And second procedure I am asking you to help with is how to register a chat command:

Code:
   register_clcmd("say .record", "recordplayer", ADMIN_ADMIN, "<player>")
to do
Quote:
say .record #2345
and the user with this authid will start to record a PV demo.

Last edited by limeassist; 12-18-2008 at 07:04.
limeassist is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 12-18-2008 , 11:47   Re: Need help in scripting (basic stuff)
Reply With Quote #2

1. Printing a message just to admins:
PHP Code:
public func()
{
    for(new 
1<= g_playersi++)
    {
        if( !
is_user_connected) )
            continue;
        
// method 1 - not very efficient
        /*if( !is_user_admin( i ) )
            continue;*/
            
        // method 2 - i prefer this one
        
if( ! ( get_user_flags) & ADMIN_KICK ) )
            continue;
            
        
client_printiprint_chat"Message" );
    }

- create a global variable 'g_players'
- add this in plugin_init()
PHP Code:
g_players get_maxplayers(); 
2. cmd_target, and if you have more than 1 arg. you must split the text, using parse() for instance.
__________________

anakin_cstrike is offline
Reply



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 09:11.


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