Raised This Month: $ Target: $400
 0% 

get Steam Id, match names


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CyberMaN
Junior Member
Join Date: Mar 2009
Old 08-06-2009 , 12:58   get Steam Id, match names
Reply With Quote #1

Hello,

I wasn't sure what kind of Title to give to the topic, I hope it wasn't misleading. I have recently began scripting in amxx, and I might as well say, that functions page rocks, and the Studio is very useful as well.

I am looking to do a couple of things, different scripts for different things.

First of all, I am trying to find a method to get someone's steam id using amxx. I didn't find something on the functions page, although I may have missed something.

The 2nd thing, well.. I have a command that has as a parameter a username. Thing is, it's case sensitive and has some restrictions. E.g: if I have a nick CyberMaN and enter:

command CyberMan (No effect)
command CYberMaN (No effect)
command CyberMaN (matches, effect)

Also, I want something like this:
command Cyber (searches for match, matches CyberMaN as its the only nick with that string, effect)

I hope I was detailed enough. Thanks for the time taken to read this post, and in advance to your replies.

Regards,

James.
CyberMaN is offline
Demigod90
Junior Member
Join Date: Jul 2009
Location: Illinois, USA
Old 08-06-2009 , 13:41   Re: get Steam Id, match names
Reply With Quote #2

For the steam id that is easy as I show you an example of how I do it below. But for your 2nd request I couldn't say intil I tried it on my private server.

This example pretty much finds out your steam id and than display's it in the chat window in green text, it also plays a sound clip "blip" so you can hear that something popped up on the chat window.

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

#define PLUGIN "Gather & Display Steam ID"
#define VERSION "1.0"
#define AUTHOR "Demigod90"

new g_iMsgSayTextg_szSoundFile[] = "buttons/blip1.wav";

public 
plugin_init()
{
    
register_plugin(PLUGIN,VERSION,AUTHOR)
    
register_clcmd("say /sid","display_sid",0)
    
register_clcmd("say_team /sid","display_sid",0)
    
    
g_iMsgSayText get_user_msgid("SayText");
}

public 
plugin_precache()
{
    
precache_sound(g_szSoundFile);
}

public 
display_sid(id)
{
    if(
is_user_bot(id)) return PLUGIN_CONTINUE;
    
    new 
szAuthID[33];
    
get_user_authid(id,szAuthID,32);
    
    new 
szMessage[164];
    
format(szMessage163"^x04Your Steam ID is: %s"szAuthID);
    
    
client_cmd(id"spk %s"g_szSoundFile);
    
    
message_begin(MSG_ONEg_iMsgSayText, {0,0,0}, id);
    
write_byte  (id);
    
write_string(szMessage);
    
message_end ();
    
    return 
PLUGIN_HANDLED;

__________________

REP++
If you found this post helpful!

Demigod1990 <- Try my BRUTE!

Last edited by Demigod90; 08-06-2009 at 17:19. Reason: typo
Demigod90 is offline
CyberMaN
Junior Member
Join Date: Mar 2009
Old 08-06-2009 , 19:07   Re: get Steam Id, match names
Reply With Quote #3

Thanks, that solves my first question, much appreciated.

Anyone with answers on the 2nd?

Regards,

James.
CyberMaN is offline
CyberMaN
Junior Member
Join Date: Mar 2009
Old 08-08-2009 , 10:35   Re: get Steam Id, match names
Reply With Quote #4

Oh, also, I'm implementing a command that does:

server_cmd("amx_command %s %s %s %s %s", var, var2, var3, var4, var5);

The 2nd and the 4th %s need to have quotes ("") in order for their values to be parsed properly, how can I do that? I tried surrounding them with ' but no luck.

Any ideas?

Regards,

James.
CyberMaN is offline
VMAN
Senior Member
Join Date: Oct 2007
Location: California, US
Old 08-19-2009 , 03:38   Re: get Steam Id, match names
Reply With Quote #5

quotes are done like ^" and new lines are ^n
VMAN 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 18:21.


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