Raised This Month: $ Target: $400
 0% 

Trying to learn SP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jheshka
Senior Member
Join Date: Dec 2005
Old 02-12-2009 , 14:51   Trying to learn SP
Reply With Quote #1

So, I've returned (inb4 who are you, gtfo, go away, etc)


I was looking over the source code to a few plugins that were released... And I'm going to state a few things... If I'm incorrect, please correct me.

Code:
#include
Exact same as C/C++, etc


Code:
new varName = 1
Would be an integer.. Or is it the same declaration method for every data type?

Code:
varName = Value
Self explanatory

Code:
RegConsoleCmd("sm_command", Function_name);
sm_command refers to input in clients console, Function_name refers to the location in the script... [public Function_name() { ]



Or if anyone has some general knowledge, hints, or tips for coding in SP, please feel free to post them as well.
__________________
James
Jheshka is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 02-12-2009 , 15:28   Re: Trying to learn SP
Reply With Quote #2

Yes, #include is for including files (include files and/or other sourcepawn files)

yes, new varname = 1 creates an int. You can also just "decl varname" and set its value later. To declare the other basic types it would be new String:varname[], new Float:varname, and so on.

yes, RegConsoleCmd creates a console command for usage with the first param, and the second param is the name of the callback function. Such as public Action:Command_Test(client, args)

Your best bet is using the sourcemod wiki as all of this and about 1000 other topics are all covered there. Absolutely the best place to learn in conjunction with checking out the sourcecode of plugins.
__________________
CrimsonGT 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 02:37.


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