AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get Steam Id, match names (https://forums.alliedmods.net/showthread.php?t=99525)

CyberMaN 08-06-2009 12:58

get Steam Id, match names
 
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.

Demigod90 08-06-2009 13:41

Re: get Steam Id, match names
 
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;



CyberMaN 08-06-2009 19:07

Re: get Steam Id, match names
 
Thanks, that solves my first question, much appreciated.

Anyone with answers on the 2nd?

Regards,

James.

CyberMaN 08-08-2009 10:35

Re: get Steam Id, match names
 
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.

VMAN 08-19-2009 03:38

Re: get Steam Id, match names
 
quotes are done like ^" and new lines are ^n


All times are GMT -4. The time now is 18:21.

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