Raised This Month: $ Target: $400
 0% 

printing hello message ?


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Author Message
DaniDin
Member
Join Date: Oct 2008
Old 01-25-2009 , 17:41   printing hello message ?
#1

hi
i want wan user connect the server it will kick him and type this message
"Hi , *username* your steamid is : *SteamID* ."
*username* = the username in the game
*steamid* = the steam id of this user
pleas how i do this ?
DaniDin is offline
DaniDin
Member
Join Date: Oct 2008
Old 01-25-2009 , 18:00   Re: printing hello message ?
#2

some 1?
pleaaaaas
DaniDin is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 01-25-2009 , 18:01   Re: printing hello message ?
#3

Code:
#include <amxmodx> public plugin_init()     register_plugin("KickU","0.1a","Drak"); // "client_connect(id)" there SteamID might not be valid public client_authorized(id) {     new AuthID[36],plName[33]     get_user_authid(id,AuthID,35);     get_user_name(id,plName,32);         server_cmd("kick #%d ^"Hi, %s Your SteamID is: %s^"",get_user_userid(id),plName,AuthID);     server_exec(); }
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
DaniDin
Member
Join Date: Oct 2008
Old 01-25-2009 , 18:05   Re: printing hello message ?
#4

thanks
try it ...
DaniDin is offline
DaniDin
Member
Join Date: Oct 2008
Old 01-25-2009 , 18:30   Re: printing hello message ?
#5

hi
way it's not working ?
i do this :
PHP Code:
public plugin_init()
{
    
register_plugin(PLUGIN,VERSION,AUTHOR)
    
set_task(30.0,"HelloMSG",0,_,_,"",0)

}

// Say Hello To The User
public HelloMSG(id)
{
    new 
AuthID[32],plName[32]
    
get_user_authid(id,AuthID,32);
    
get_user_name(id,plName,32);
    
    
server_cmd("say ^"Hi, %s Your SteamID is: %s^"",plName,AuthID);

it's type the name of the server and bo steam id :\
DaniDin is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 01-25-2009 , 18:55   Re: printing hello message ?
#6

Your setting a task, with no ID given. It's gonna do nothing.
What exactly do you want.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
DaniDin
Member
Join Date: Oct 2008
Old 01-25-2009 , 20:02   Re: printing hello message ?
#7

the server will type hello with the user steamid and the nick and ip :\
DaniDin is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 01-25-2009 , 20:34   Re: printing hello message ?
#8

Code:
#include <amxmodx> public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR) } public client_authorized(id)     set_task(20.0,"HelloMSG",id); // Say Hello To The User public HelloMSG(id) {     new AuthID[32],plName[32]     get_user_authid(id,AuthID,32);     get_user_name(id,plName,32);         server_cmd("say ^"Hi, %s Your SteamID is: %s^"",plName,AuthID); }

You should catch the "ResetHUD" event, and send the message when they spawn. But the above will work still.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
DaniDin
Member
Join Date: Oct 2008
Old 01-25-2009 , 20:44   Re: printing hello message ?
#9

thanks now i do this and it now working you can help with this ?
PHP Code:
public client_authorized(id)
{
    new 
AuthID[32],plName[32]
    
get_user_authid(id,AuthID,32);
    
get_user_name(id,plName,32);
        
SQL_ThreadQuery(g_SqlTuple,"SelectHandle","SELECT logged FROM users WHERE nick='%s'",plName);
}

public 
SelectHandle(FailState,Handle:Query,Error[],Errcode,Data[],DataSize,id)
{
    new 
name[32], authid[32]
    if(
FailState == TQUERY_CONNECT_FAILED)
        return 
set_fail_state("Could not connect to SQL database.")
    else if(
FailState == TQUERY_QUERY_FAILED)
        return 
set_fail_state("Query failed.")
   
    if(
Errcode)
        return 
log_amx("Error on query: %s",Error)
   
    new 
str[33]
    while(
SQL_MoreResults(Query))
    {
        
SQL_ReadResult(Query,0,str,33)
        
get_user_name(id,name,31
        
get_user_authid(id,authid,31)

        
server_cmd("amx_say ^"my: %s^"",str)
    
    
        
SQL_NextRow(Query)
    }
   
    return 
PLUGIN_CONTINUE

DaniDin is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 01-25-2009 , 21:14   Re: printing hello message ?
#10

What you have make's no sense. But you didn't even pass an ID. Which I did here.
Code:
#include <amxmodx> #include <sqlx> public client_authorized(id) {     new AuthID[36],plName[33],Data[1]     get_user_authid(id,AuthID,35);     get_user_name(id,plName,32);         Data[0] = id     SQL_ThreadQuery(g_SqlTuple,"SelectHandle","SELECT logged FROM users WHERE nick='%s'",plName,Data,1); } public SelectHandle(FailState,Handle:Query,Error[],Errcode,Data[],DataSize,id) {     if(FailState == TQUERY_CONNECT_FAILED)         return set_fail_state("Could not connect to SQL database.")     else if(FailState == TQUERY_QUERY_FAILED)         return set_fail_state("Query failed.")         if(Errcode)         return log_amx("Error on query: %s",Error)         new id = Data[0],plName[33],AuthID[36],String[128]     while(SQL_MoreResults(Query))     {         SQL_ReadResult(Query,0,String,127);                 get_user_name(id,plName,32);         get_user_authid(id,AuthID,35);                 server_cmd("amx_say ^"my: %s^"",String);                 SQL_NextRow(Query);     }         return PLUGIN_CONTINUE }
I'm not sure what's saved in the SQL, so I don't know what it's even going to display. or what "amx_say" does
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
Closed Thread



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 01:44.


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