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

Ideas to make your coding experience easier


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^BuGs^
Senior Member
Join Date: May 2007
Old 08-12-2007 , 23:06   Ideas to make your coding experience easier
Reply With Quote #1

I been witnessing lots of people doing the same thing so I compiling a bunch of tips.
  1. Before starting a project:
    1. Decide what you are really going to do. (Game play, administration, fun, etc.)
    2. Decide how you are going to do it.
    3. Make sure you can handle that project.
  2. Be sure that you are using latest versions. (MM:S, SM and API's you use.)
  3. Always make a "To Do" list and a change log to keep your project organized.
  4. Check to see if something your about to code in your script is already being done by another plugin with their API. (Don't reinvent the wheel.)
    1. Reason: Less Memory Usage
    2. Example: Repeated messages that go to all client to tell something (i.e. Type !yourtriggerhere to run me)
    3. Possible Solution: Use the Ads API. Allows better control flow of messages. (Shameless plug)
    4. Con: Online compiler will not work.
  5. Your plugin provide functionally that everyone could use... create an API with the needed natives. Bouns... make it so it's optional so you don't force the person using your plugin, also have to use the secondary plugin just so they can disable it once it's running.
  6. Highly recommend using http://sm.nican132.com/ for fast looking up of function definitions.
  7. Do not hardcode values. Use Cvars or a configuration file.
  8. Tell users your project's compatibilities/dependencies. (OS, mod, extensions, plugins, APIs)
  9. Don't wait for a request to put screenshots. You can use Picasa Web to organize your screenshots easily.
  10. Do not create your own "MAX CLIENTS" define. Use MAXPLAYERS. If this is going to be an array, do not forget the "+ 1". Client Index start 1 -- not 0.(Hint for people who want their plugins approved.)
  11. Post your suggestion!
__________________
Sourcemod Plugin Author and Plugin Approver
"The correct way is MAXPLAYERS + 1"
I will not take bugs/new idea reports over the forums. Please use the issue list.

Last edited by ^BuGs^; 08-14-2007 at 09:08.
^BuGs^ is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 08-13-2007 , 07:26   Re: Ideas to make your coding experience easier
Reply With Quote #2

Don't hardcode ;)
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
^BuGs^
Senior Member
Join Date: May 2007
Old 08-13-2007 , 07:41   Re: Ideas to make your coding experience easier
Reply With Quote #3

Quote:
Originally Posted by Peoples Army View Post
that was a shamless plug lol .
Yes, but true. If half the scripts used the Ads API, people would be able to control if they wanted advertisements. For me having tons of messages show in chat is mading. Having a script that does ads + my ads plugins creates 3 to 5 lines in chat which are removed right away from other content. i.e. Someone joining or throwing a grenade.
__________________
Sourcemod Plugin Author and Plugin Approver
"The correct way is MAXPLAYERS + 1"
I will not take bugs/new idea reports over the forums. Please use the issue list.
^BuGs^ is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 08-13-2007 , 07:53   Re: Ideas to make your coding experience easier
Reply With Quote #4

helpfull tip 4:

DO NOT use pencil and paper as a SDK.
Peoples Army is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 08-13-2007 , 09:25   Re: Ideas to make your coding experience easier
Reply With Quote #5

1- Before starting a project:
Decide what you are really going to do. (Game play, administration, fun, etc.)
Decide how you are going to do it.
Make sure you can handle that project.

2- Be sure that you are using latest versions. (MM: S, SM and API's you use.)

3- Always make a "To Do" list and a change log to keep your project organized.

4- Tell users your project's compatibilities/dependencies. (OS, mod, extensions, plugins, APIs)

5- Don't wait for a request to put screenshots. You can use Picasa Web to organize your screenshots easily.
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
dubbeh
Senior Member
Join Date: Jul 2007
Old 08-13-2007 , 09:49   Re: Ideas to make your coding experience easier
Reply With Quote #6

Good thing is to make use of the stack that might be a very similiar function but with a very small change

eg.
PHP Code:

CreatePlayerListMenu 
(clientHandle:hMenu, const String:szMenuTitle[], MenuHandler:Handler)
{
    
decl String:szClientIndex[8] = ""String:szClientName[64] = "";
    static 
iIndex 0;

    
hMenu CreateMenu (Handler);
    
SetMenuTitle (hMenuszMenuTitle);
    
    
iIndex 1;
    while (
iIndex <= g_iMaxClients)
    {
        if (
IsClientConnected (iIndex) && IsClientInGame (iIndex))
        {
            
GetClientName (iIndexszClientNamesizeof (szClientName));
            
Format (szClientIndexsizeof (szClientIndex), "%d"iIndex);
            
AddMenuItem (hMenuszClientIndexszClientName);
        }

        
iIndex++;
    }

    
DisplayMenu (hMenuclientMENU_TIME_FOREVER);

Using this for diffrent menus like player kick/ban/mute - find it saves lots of coding time & clutter in overall code ;)
__________________
SM Plugins - dubbeh.net - Plugin requests are welcome

Last edited by dubbeh; 08-13-2007 at 09:53. Reason: removed fake client check
dubbeh is offline
spelworm
Senior Member
Join Date: Mar 2007
Old 08-14-2007 , 02:59   Re: Ideas to make your coding experience easier
Reply With Quote #7

i just cant figure out how all the commands work >< i can look at it for a long time and the only thing i know then is i need a asprine against the headache
is there some page that will explain how u write a command with a example i checked the wiki page but it just isnt very clear to me

btw why are all the posts deleted ?
spelworm is offline
dubbeh
Senior Member
Join Date: Jul 2007
Old 08-14-2007 , 07:29   Re: Ideas to make your coding experience easier
Reply With Quote #8

Highly recommend using http://sm.nican132.com/ for fast looking up of function definitions

Love it if someone would be willing to make a searchable chm file for easy local lookup
__________________
SM Plugins - dubbeh.net - Plugin requests are welcome
dubbeh is offline
Nican
Veteran Member
Join Date: Jan 2006
Location: NY
Old 08-14-2007 , 12:40   Re: Ideas to make your coding experience easier
Reply With Quote #9

Quote:
Originally Posted by dubbeh View Post
Highly recommend using http://sm.nican132.com/ for fast looking up of function definitions

Love it if someone would be willing to make a searchable chm file for easy local lookup
Do you know how to make .chm file? If you want I can upload the MySQL database for you, or you can teach me how to make one, since SM is being update constantly...
__________________
http://www.nican132.com
I require reputation!
Nican is offline
Send a message via ICQ to Nican Send a message via MSN to Nican
dubbeh
Senior Member
Join Date: Jul 2007
Old 08-14-2007 , 13:33   Re: Ideas to make your coding experience easier
Reply With Quote #10

Found quite a few window based ones & the SDK can be download from the MSDN

I'll keep looking around & see if i can find a php script
__________________
SM Plugins - dubbeh.net - Plugin requests are welcome
dubbeh 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 05:15.


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