Raised This Month: $ Target: $400
 0% 

how to do say ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DaniDin
Member
Join Date: Oct 2008
Old 12-25-2008 , 17:36   how to do say ?
Reply With Quote #1

hi
i want to do command like this :
sayhi

and if admin do this so it's say to all "Hi , Have Fun In my Server"
how i do it ?
DaniDin is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 12-25-2008 , 18:36   Re: how to do say ?
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Hi"
#define VERSION "1.0"
#define AUTHOR "Starsailor"
#define ACCESS_LEVEL ADMIN_KICK


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say hi","showhi")
    
}

public 
showhi() {
    new 
maxplayers get_maxplayers()
    new 
j
    
for(<= maxplayers j++){
        if(
get_user_flags(j) & ACCESS_LEVEL){
           
client_cmd(j,"say Hi , Have Fun In my Server")

            
        }
    }

Attached Files
File Type: sma Get Plugin or Get Source (sayhi.sma - 555 views - 519 Bytes)
__________________
Find my plugins here..

Ex - Spanish Moderator.

Last edited by Starsailor; 12-25-2008 at 18:44.
Starsailor is offline
DaniDin
Member
Join Date: Oct 2008
Old 12-25-2008 , 19:20   Re: how to do say ?
Reply With Quote #3

10x dud
do you kbow how i do connect to sql in localhost and chaked in user table in userid if the id = 1 so the user will get kick ?
DaniDin is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-25-2008 , 19:22   Re: how to do say ?
Reply With Quote #4

Quote:
Originally Posted by DaniDin View Post
10x dud
do you kbow how i do connect to sql in localhost and chaked in user table in userid if the id = 1 so the user will get kick ?
http://www.amxmodx.org/funcwiki.php?go=module&id=23
__________________

Community / No support through PM
danielkza is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-25-2008 , 19:28   Re: how to do say ?
Reply With Quote #5

Quote:
Originally Posted by Starsailor View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "Hi"
#define VERSION "1.0"
#define AUTHOR "Starsailor"
#define ACCESS_LEVEL ADMIN_KICK
 
 
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say hi","showhi")
 
}
 
public 
showhi() {
    new 
maxplayers get_maxplayers()
    new 
j
    
for(<= maxplayers j++){
        if(
get_user_flags(j) & ACCESS_LEVEL){
           
client_cmd(j,"say Hi , Have Fun In my Server")
 
 
        }
    }

WTF?
Code:
#include <amxmodx>   #define ADMIN ADMIN_IMMUNITY   public plugin_init()         register_clcmd("say hi", "cmdSayHi");   public cmdSayHi(id) {         if (is_user_connected(id) && (get_user_flags(id) & ADMIN))                 client_cmd(id, "say Hi , Have Fun In my Server");           return PLUGIN_HANDLED; }
__________________
hleV is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-25-2008 , 19:37   Re: how to do say ?
Reply With Quote #6

Quote:
Originally Posted by hleV View Post
WTF?
Code:
#include <amxmodx> #define ADMIN ADMIN_IMMUNITY public plugin_init() register_clcmd("say hi", "cmdSayHi"); public cmdSayHi(id) { if (is_user_connected(id) && (get_user_flags(id) & ADMIN)) client_cmd(id, "say Hi , Have Fun In my Server"); return PLUGIN_HANDLED; }
WTF?

PHP Code:
#include <amxmodx>

#define ADMIN_SAYHI ADMIN_ADMIN

public plugin_init()
{
    
register_clcmd("say hi""SayHi")
}

public 
SayHi(id)
{
    if(
access(idADMIN_SAYHI))
    {
        static 
szName[32]
        
get_user_name(idszNamecharsmax(szName))

        
client_print(0print_chat"Have fun on my server! - %s"szName)
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE

__________________

Community / No support through PM
danielkza is offline
DaniDin
Member
Join Date: Oct 2008
Old 12-25-2008 , 19:41   Re: how to do say ?
Reply With Quote #7

how i do that i can use the sayhi 1 times in the map ?
DaniDin is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-25-2008 , 19:47   Re: how to do say ?
Reply With Quote #8

Quote:
Originally Posted by DaniDin View Post
how i do that i can use the sayhi 1 times in the map ?
I see you're just trying to experiment in scripting, and if you don't know how to do something, go RTFM and try yourself, we won't keep writing scripts for you, specially for useless purposes like this.
__________________

Community / No support through PM
danielkza is offline
DaniDin
Member
Join Date: Oct 2008
Old 12-25-2008 , 19:49   Re: how to do say ?
Reply With Quote #9

i try to search in the wiki but i dont found nothing
DaniDin is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 12-25-2008 , 20:02   Re: how to do say ?
Reply With Quote #10

Quote:
Originally Posted by Starsailor View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Hi"
#define VERSION "1.0"
#define AUTHOR "Starsailor"
#define ACCESS_LEVEL ADMIN_KICK


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say hi","showhi")
    
}

public 
showhi() {
    new 
maxplayers get_maxplayers()
    new 
j
    
for(<= maxplayers j++){
        if(
get_user_flags(j) & ACCESS_LEVEL){
           
client_cmd(j,"say Hi , Have Fun In my Server")

            
        }
    }

That's a terrible way to do it. You could do something like this instead:

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Player Greeting""1.0""Spunky")

    
register_clcmd("say hi""cmd_sayhi"ADMIN_KICK"Greets players.")
}

cmd_sayhi(idlevelcid)
{
    if (!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED

    client_print
(0print_chat"Hello, welcome to my server!")

    return 
PLUGIN_HANDLED

There's absolutely no need to loop through all of the players. You should note that nobody except you will be able to say hi like that though. They'd have to say hello or hey or something else.
Spunky is offline
Send a message via AIM to Spunky
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:13.


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