Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin
Archive › Old Forum Threads › Help › Scripting Help › can id be steam id?
9 posts, 4 people · 909 views Thread Rating: ★★★★★
closedcan id be steam id?
Started by Dr.G on 12-11-2008, 12:34 PM
Dr.G
started this thread
Posts: 776
Threads: 75
Joined: Nov 2007
12-11-2008, 12:34 PM #1

can id be steam id somehow? example:rnrn

 public admin_sniper(id)rn{rn	if(cmd_access(id,1) && is_user_connected(id))rn		if(is_user_alive(id))rn			give_item(id,"weapon_springfield")rnrn	return PLUGIN_HANDLEDrn}rnrn
rnrnIf i replace it like this it wont work:rnrn
 public admin_sniper(STEAM_0:1:12345)rn{rn	if(cmd_access(STEAM_0:1:12345,1) && is_user_connected(STEAM_0:1:12345))rn		if(is_user_alive(STEAM_0:1:12345))rn			give_item(STEAM_0:1:12345,"weapon_springfield")rnrn	return PLUGIN_HANDLEDrn}rnrn
rnrnSo how would i only allow the function to a person with STEAM_0:1:12345 ?

H h0_noMan
posted here
Posts: 80
Threads: 11
Joined: Dec 2007
12-11-2008, 12:50 PM #2

How is called the admin_sniper function ? register_clcmd or register_concmd or others ?nnYou just have to set the function for only being executed by an admin with a specific flags.

Dr.G
started this thread
Posts: 776
Threads: 75
Joined: Nov 2007
12-11-2008, 02:06 PM #3

its called like thisrnrn

register_concmd("admin_sniper","admin_sniper",ADMIN_BAN,"Gives you a sniper rifle")
rnrnBut want it to be only one person, by steamid in example. isnt that possible?

H h0_noMan
posted here
Posts: 80
Threads: 11
Joined: Dec 2007
12-11-2008, 02:43 PM #4

Yes you can.nnBut if you have acces to the server, you can modify users flags to be the only one with a specified flag.nn

public admin_sniper(id)n{n    new steamid[]n    get_user_authid( id, steamid, 35) nn    if(cmd_access(id,1) && is_user_connected(id))n        if(equal(steamid,"STEAM_0:1:000000"))n            if(is_user_alive(id))n                give_item(id,"weapon_springfield")nn    return PLUGIN_HANDLEDn}
Tank
posted here
Posts: 581
Threads: 59
Joined: Jan 2007
12-11-2008, 03:16 PM #5

Good question and good explanation. I've been looking myself for this as well for my donators.

Dr.G
started this thread
Posts: 776
Threads: 75
Joined: Nov 2007
12-11-2008, 03:16 PM #6

cool thanks!!

Zor
posted here
Posts: 688
Threads: 75
Joined: Jun 2006
12-13-2008, 06:10 PM #7

You could also use only certain flags for certain people. As such you can give access to all people and then check the persons flags after they call the function. That way you can utilize the other flags:rnrnhttp://wiki.amxmodx.org/Adding_Admins_(AMX_Mod_X)#Access_LevelsrnrnLook at levels A-H. To do this you would do the following:rnrn

register_concmd("admin_sniper","admin_sniper",ADMIN_RESERVATION,"Gives you a sniper rifle")
rnrnThat way you can add your donators to the Reservation. Then you just look at the individual and see if they have certain flags and then give them access:rnrn
public admin_sniper(id, level, cid)rn{rn	// id = 1 -32rn	// level = this case ADMIN_RESERVATIONrn	// cid = id of the command that called this functionrn	// 1 = the count of switches attached to thisrn	//	command eg: admin_ban 1 100 rn	//	-- that would be 3 or 1 for command and 2 for switchesrn	// and last rn	if(!cmd_access(id, level, cid, 1)) // check for BAN accessrn	{rn		if(get_user_flags(id) & (ADMIN_LEVEL_A|ADMIN_LEVEL_B))rn		{rn			if(is_user_alive(id))rn			{rn                	give_item(id,"weapon_springfield")rn			}rn		}rn	}rnrn	return PLUGIN_HANDLEDrn}
rnrnIn the above if you have set them to level a or level b they get access. So you have redundancy. They have to have reservation to get into that command, and then they have to have level a or level b. So I hope this helps!

H h0_noMan
posted here
Posts: 80
Threads: 11
Joined: Dec 2007
12-13-2008, 10:21 PM #8

I think that using ADMIN flags is the best way to do what you want.

Dr.G
started this thread
Posts: 776
Threads: 75
Joined: Nov 2007
12-14-2008, 01:55 PM #9

Thanks guys! very usefull info!

Archive › Old Forum Threads › Help › Scripting Help › can id be steam id?
DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC