Raised This Month: $32 Target: $400
 8% 

How To Add Plugin @all @t @ct


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Parisapo
Junior Member
Join Date: May 2015
Old 02-04-2019 , 13:13   How To Add Plugin @all @t @ct
Reply With Quote #1

How do I add the plugin commands such as @all @t @ct I did.

Code:
#include <sourcemod>

public Plugin:myinfo =
{
	name = "[CSGO] !canver by SelimYasar",
	description = "Can Verme Türkçeleştirme",
	author = "Selim Yasar",
	version = "1.0",
	url = "selimyasar.com"
}

public OnPluginStart()
{
	RegAdminCmd("sm_canver", Command_healthp, ADMFLAG_GENERIC);
}

public Action:Command_healthp(client, args)
{
	if(args < 1)
	{
		ReplyToCommand(client," \x02[Can Verme Plugini] \x10Kullanımı: \x0B!canver  \x01miktar \x10Örnek: \x0B!canver \x01miktar");
		return Plugin_Handled;
	}
	new String:name[64];
	new String:arg1[256];
	GetCmdArg(1, arg1, 256);
	GetClientName(client, name, 64);
	ServerCommand("sm_hp %s", arg1);
	PrintToChatAll(" \x02[%s] \x10%s \x01tarafından \x0BMahkumlara \x0E%s \x04can verildi.", "Can Verme Plugini", name, arg1);
	return Plugin_Handled;
}
Parisapo is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 02-04-2019 , 13:18   Re: How To Add Plugin @all @t @ct
Reply With Quote #2

https://sm.alliedmods.net/new-api/helpers/FindTarget

Also you should never use %s format modifier with server command unless you want someone to come in with the name ";rcon quit" and destroy your server. Use %N with the client index instead.
CliptonHeist is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 02-04-2019 , 20:57   Re: How To Add Plugin @all @t @ct
Reply With Quote #3

Quote:
Originally Posted by CliptonHeist View Post
https://sm.alliedmods.net/new-api/helpers/FindTarget

Also you should never use %s format modifier with server command unless you want someone to come in with the name ";rcon quit" and destroy your server. Use %N with the client index instead.
%N with client id wouldn't make a difference from %s with GetClientName.

Use %d with GetClientUserId(client).
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 02-04-2019 , 21:00   Re: How To Add Plugin @all @t @ct
Reply With Quote #4

Quote:
Originally Posted by arne1288 View Post
%N with client id wouldn't make a difference from %s with GetClientName.

Use %d with GetClientUserId(client).
Really? I always thought it did something different with the client index oops. I guess I have a bunch of plugins to rewrite now
CliptonHeist is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 02-04-2019 , 21:05   Re: How To Add Plugin @all @t @ct
Reply With Quote #5

Quote:
Originally Posted by CliptonHeist View Post
Really? I always thought it did something different with the client index oops. I guess I have a bunch of plugins to rewrite now
Yep.

PHP Code:
GetClientName(clientname64);
ServerCommand("sm_kick %s hello"name); 
PHP Code:
ServerCommand("sm_kick %N hello"client); 
would literally be the same, so the ";quit" thing should actually trigger on both of them.

Things like:

PHP Code:
ServerCommand("sm_kick #%d hello"GetClientUserId(client)); 
wouldn't.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 02-05-2019 , 00:54   Re: How To Add Plugin @all @t @ct
Reply With Quote #6

Now that the huge security issue has been pointed out, here's the actual solution to the question:

https://sm.alliedmods.net/new-api/co...ssTargetString
__________________
ddhoward is offline
Reply


Thread Tools
Display Modes

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 02:28.


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