Raised This Month: $51 Target: $400
 12% 

[ALL] Command & CVAR shortcut


Post New Thread Reply   
 
Thread Tools Display Modes
MafiaBoss
AlliedModders Donor
Join Date: Aug 2013
Old 12-28-2013 , 20:59   Re: [ALL] Command shortcut
Reply With Quote #11

Quote:
Originally Posted by Arkarr View Post
Hum, what's wrong ? Any error(s) in console and logs ?
I placed the files, did the configuration and got my guys to test it out, nothing happened. I'll copy paste an example later.

"ChatCommand"
{
"1"
{
"chat" "golden frying pan"
"command" "sm_giveweapon [PLAYER_NAME] 1071"
"flag" "a"
}
}

Thats just one of it.

Last edited by MafiaBoss; 12-28-2013 at 21:40.
MafiaBoss is offline
jpwanabe
Veteran Member
Join Date: Mar 2010
Old 12-29-2013 , 19:13   Re: [ALL] Command shortcut
Reply With Quote #12

Yea no longer works after updating.

Plus some plugins don't run off of steam id.
__________________
My Steam TF2APP
My sig changes with each load! Refresh to see my other servers!

Last edited by jpwanabe; 12-29-2013 at 19:14.
jpwanabe is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 12-29-2013 , 19:27   Re: [ALL] Command shortcut
Reply With Quote #13

Quote:
Originally Posted by jpwanabe View Post
Yea no longer works after updating.

Plus some plugins don't run off of steam id.
Steam ID? You mean userID right? Every command that uses ProcessTargetString() can use the userID. Every last one, as that is a function of ProcessTargetString(). Unless the plugin author has manually recreated the @all, @me, @!me, @alive, etc targeting strings, then every command that can use @me, etc., can use the userID.

If you would knowingly and willingly install any plugin that passes the client's name through ServerCommand, then you deserve any grief that exploiters may cause you.


The only problem is with this plugin; Arkarr made an error around line 50-51.
__________________

Last edited by ddhoward; 12-30-2013 at 00:08.
ddhoward is offline
jpwanabe
Veteran Member
Join Date: Mar 2010
Old 12-29-2013 , 19:33   Re: [ALL] Command shortcut
Reply With Quote #14

So I should be able to target my self using 76561197992143964 and this plugin
__________________
My Steam TF2APP
My sig changes with each load! Refresh to see my other servers!
jpwanabe is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 12-29-2013 , 20:06   Re: [ALL] Command shortcut
Reply With Quote #15

Quote:
Originally Posted by jpwanabe View Post
So I should be able to target my self using 76561197992143964 and this plugin

You are severely confused sir. A client's userID is NOT THE SAME THING as his Steam ID. A userID is just a number that the server gives to a client based on how many players joined the server before him since the last server restart. A Steam ID is a unique identifier that is assigned to a person's Steam Account. Now, this CAN also be used to target the player, but not in the form that you have suggested. You need to use the other form of the Steam ID which looks like STEAM_0:1:234567 or [U:1:123456789]. The community ID (which looks like this: 76561197992143964) numbers are NOT applicable for usage in ProcessTargetString().

Let's say that I joined a server. Let's say that
  • I am the 378th player to join since the server was last restarted, making my userID 378.
  • My Steam ID is STEAM_0:1:48287056 (or STEAM_1:1:48287056 or even [U:1:96574113], depending on the game.)
  • My community ID is 76561198056839841
  • My player name on the server is "Derek Howard"

Now, assuming that you wanted to give me the GRU for whatever reason, the following ways would ALL BE VALID.

vvvv unspoiler this vvvv
Spoiler
^^^ unspoiler this ^^^



The sm_givew command does not need an update. It can already handle userIDs as it makes use of ProcessTargetString(). The ONLY thing that must be done to fix this plugin is to correct the small error on line 51 that I pointed out in my previous post.

I will restate it once more. Every command with targeting that can use @me, @all, etc. can also use #<userid>.
__________________

Last edited by ddhoward; 08-24-2015 at 22:00. Reason: adding information on new steam ID format for tf2
ddhoward is offline
MafiaBoss
AlliedModders Donor
Join Date: Aug 2013
Old 12-29-2013 , 20:23   Re: [ALL] Command shortcut
Reply With Quote #16

So it's

"ChatCommand"
{
"1"
{
"chat" "golden frying pan"
"command" "sm_giveweapon #<userid> 1071"
"flag" "a"
}
}

Is it that way?
MafiaBoss is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 12-29-2013 , 20:28   Re: [ALL] Command shortcut
Reply With Quote #17

Quote:
Originally Posted by MafiaBoss View Post
So it's

"ChatCommand"
{
"1"
{
"chat" "golden frying pan"
"command" "sm_giveweapon #<userid> 1071"
"flag" "a"
}
}

Is it that way?
No. You don't need to change anything that you are doing. Follow the instructions exactly as they are on the first post, and wait for the plugin to be fixed.

Code:
"ChatCommand"
{
	"1"
	{
		"chat" "golden frying pan"
		"command" "sm_giveweapon [PLAYER_NAME] 1071"
		"flag" "a"
	}
}
__________________

Last edited by ddhoward; 12-29-2013 at 20:29.
ddhoward is offline
rowedahelicon
Senior Member
Join Date: Feb 2011
Location: The Observatory
Old 12-30-2013 , 00:00   Re: [ALL] Command shortcut
Reply With Quote #18

Fixed it, line 50 was calling for the ID as a string rather than an interger

Code:
Format(player_final, sizeof(player_final), "%s", player_id);
Where it should be

Code:
Format(player_final, sizeof(player_final), "%d", player_id);
Attached Files
File Type: sp Get Plugin or Get Source (CommandShortcut.sp - 416 views - 1.6 KB)
__________________
SCG, A furry community in the stars - https://www.scg.wtf
rowedahelicon is offline
Send a message via Skype™ to rowedahelicon
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 12-30-2013 , 00:13   Re: [ALL] Command shortcut
Reply With Quote #19

Quote:
Originally Posted by rowedahelicon View Post
Fixed it
No you didn't, as you removed the # before the %s/%d.

Quote:
line 50 was calling for the ID as a string rather than an interger

Code:
Format(player_final, sizeof(player_final), "%s", player_id);
Where it should be

Code:
Format(player_final, sizeof(player_final), "%d", player_id);
I believe that's what line 49's purpose is. He probably meant to do this on line 50:

Code:
Format(player_final, sizeof(player_final), "#%s", player_idSTR);
which also works. It is worth noting that your solution makes line 49 and the player_idSTR variable completely irrelevant.

Attached is an actual fix (I think.)
Attached Files
File Type: sp Get Plugin or Get Source (CommandShortcut.sp - 512 views - 1.5 KB)
__________________

Last edited by ddhoward; 12-30-2013 at 00:22.
ddhoward is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 12-30-2013 , 02:34   Re: [ALL] Command shortcut
Reply With Quote #20

@ddhoward and @rowedahelicon
Well, thanks to you both, I'm too slow for you... Can't fix it until now, didn't have enough time. Anyway, thanks !

@ddhoward
Your version will be posted in the main post. Thanks again.
__________________
Want to check my plugins ?
Arkarr 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 17:00.


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