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

Help A Newbie Out, Got no experience at all so need help.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TUSK3N1337
SourceMod Donor
Join Date: Dec 2013
Location: Sweden
Old 01-25-2015 , 15:45   Help A Newbie Out, Got no experience at all so need help.
Reply With Quote #1

Hello I am a total noob when it comes to scripting so one step at a time, I want this plugin here to print all available commands in the chat when someone types !cmd and it should print all available commands a time after a players have connected.

I took this https://forums.alliedmods.net/showthread.php?p=2206742 plugin and tried to modify it but I need help how do I do?

The game that is need to work on is CS:GO

HTML Code:
#pragma semicolon 1
#include <sourcemod>

public Plugin:myinfo ={
	name = "List SourceMod Commands",
	author = "X",
	description = "Lists SourceMod commands accessible to the client.",
	version = "1.0",
	url = ""
};

public OnPluginStart() {
	RegAdminCmd("sm_cmd", Command_listcmd, 0);
}

public Action:Command_listcmd(client, args) {
	decl String:name[64];
	new Handle:cvar, bool:isCommand, flags;
	
	cvar = FindFirstConCommand(name, sizeof(name), isCommand, flags);
	
	if(cvar == INVALID_HANDLE) {
		PrintToChat(client, "Could not load command list");
		return Plugin_Handled;
	}
	
	do {
		if(!isCommand) 
			continue;
		
		new bool:isSmCmd = name[0] == 's' && name[1] == 'm' && name[2] == '_';
		
		if (isSmCmd && CheckCommandAccess(client, name, 0, false)) {
			PrintToChat(client, "%s", name);
		}
	} while(FindNextConCommand(cvar, name, sizeof(name), isCommand, flags));
	
	return Plugin_Handled;
}  
__________________

Last edited by TUSK3N1337; 01-25-2015 at 15:46.
TUSK3N1337 is offline
Send a message via Skype™ to TUSK3N1337
Darkness_
Veteran Member
Join Date: Nov 2014
Old 01-25-2015 , 17:34   Re: Help A Newbie Out, Got no experience at all so need help.
Reply With Quote #2

Why not just use sm_help?
Darkness_ is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-25-2015 , 17:50   Re: Help A Newbie Out, Got no experience at all so need help.
Reply With Quote #3

or sm_searchcmd ""
Mitchell is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 01-25-2015 , 18:09   Re: Help A Newbie Out, Got no experience at all so need help.
Reply With Quote #4

I assume they must know of these commands already, as both were mentioned in the thread he linked to. OP, see here for SourceMod's code on sm_help to show you how the team did it.
__________________
11530 is offline
TUSK3N1337
SourceMod Donor
Join Date: Dec 2013
Location: Sweden
Old 01-25-2015 , 19:54   Re: Help A Newbie Out, Got no experience at all so need help.
Reply With Quote #5

What do you mean sm_help and sm_searchcmd? I want it to function as a plugin to print commands to chat for new players that recently joined the server like

"Hello and Welcome available commands are !donate !guns !admins !rpgmenu"

I dont want it to print to console since I dont expect people to be able to use it.
__________________
TUSK3N1337 is offline
Send a message via Skype™ to TUSK3N1337
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 01-25-2015 , 20:01   Re: Help A Newbie Out, Got no experience at all so need help.
Reply With Quote #6

Well, we've answered your question still. Use the code for sm_help we mentioned, Format to a string with itself as a parameter and PrintToChat on join with 30 second timer.
__________________
11530 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 19:03.


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