Raised This Month: $ Target: $400
 0% 

Making a plugin tutorial?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bakuryu
Member
Join Date: Dec 2011
Old 12-19-2011 , 12:40   Making a plugin tutorial?
Reply With Quote #1

I'm looking to make a plugin for L4D and L4D2 is there any tutorials on how to get started? I know entry level C++ I don't know if that's enough I'm kinda rusty XD
Bakuryu is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 12-19-2011 , 13:58   Re: Making a plugin tutorial?
Reply With Quote #2

Have fun: http://wiki.alliedmods.net/Category:SourceMod_Scripting
When you've done enough, look at other L4D(2) plugins to get an idea of some of the things you can do.
__________________
pheadxdll is offline
Bakuryu
Member
Join Date: Dec 2011
Old 12-19-2011 , 23:36   Re: Making a plugin tutorial?
Reply With Quote #3

Thank you for the tutorials it seems my C++ knowledge will transfer a little. The tutorial is still a little confusing or im just really rusty. for exmaple in

public Action:Command_Slap(client, arges) are these two parameters or what? If so where are they getting them from because the next part gets the arguments which maybe I'm confused between those, but its looking for the username and the amount of damage which is 2 arguments, but it does this by checking the parameter of arges which is 0 at this point isn't it? It makes sense to check for another argument because if its just sm_playerslap Bakuryu it slaps them for no damage, but if its 1 it still technically isn't passing the if statement as both arges needs to be >= 2 and the second argument needs to work. Also there seems to be a ton of variables that aren't declared anywhere maybe I'm missing something, but where did MAX_TARGET_LENGTH come from? Is this a keyword?

To start mine off I want to make some text and a menu pop up for the user I am assuming I need to make use of the menu functions, I'm just not sure which ones any examples of a simple menu system?
Bakuryu is offline
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 12-20-2011 , 09:20   Re: Making a plugin tutorial?
Reply With Quote #4

Command_Slap is the callback for the command sm_slap, when a client invokes the command through chat/console his/her client id is passed to client and args contains the number of arguments he/she passed. The Command_Slap code block is then run to see what actions should happen. The arguments he/she passed can be retrieved in the form of a string with GetCmdArg. MAX_TARGET_LENGTH is defined in one of the includes the plugin has used to compile. If you look at sourcemod.inc you'll see that it includes other includes, this just creates a large tree of includes. There are many things that are defined with simply including sourcemod.inc. Some examples: NULL_VECTOR PLATFORM_MAX_PATH MAX_NAME_LENGTH
If you simply want to print stuff to the client, look at the various PrintTo... functions in the api.
Api here
__________________
McFlurry is offline
Send a message via Skype™ to McFlurry
Bakuryu
Member
Join Date: Dec 2011
Old 12-20-2011 , 12:11   Re: Making a plugin tutorial?
Reply With Quote #5

Ok that definitely makes a little more sense. Is client and arge a keyword though? alone with MAX_TARGET_LENGTH if so is there a list of these words what they are used for etc? Also won't the PrintTo functions only send texts? how do you make them menus? Shouldn't I look at the Menu functions?
Bakuryu is offline
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 12-20-2011 , 13:19   Re: Making a plugin tutorial?
Reply With Quote #6

Every bold section in the api is an include file that sourcemod.inc includes in itself, with the exception of sdktools and its subsections. Clicking on a bold section will give you the overview of what that include file creates for use within your plugin, usually these are enums and #define variables. I assume you know how different tag types work and how functions return certain tag variables, if so go ahead and try creating a menu/panel by looking at the menus section in the api.
__________________
McFlurry is offline
Send a message via Skype™ to McFlurry
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 21:52.


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