Best effiecent scripting
#1

Hi there,

I'm currently working on a custom script, from complete scratch, even color definitions, I'm only currently at 1,261 lines but before I go any further I'd like to get some opinions on the best way to script efficiently, so in a years time the script is still scriptable (unlike some messy godfather edits).

I'm using y_ini and y_commands, with Dini for some other commands that require certain things that y_ini can't do. I'm then using foreach, sscanf2 and streamer. So in my opinion, that's pretty efficient so far.

How ever it's the actual style/method of coding I'm worried about that's going to make it inefficient. One thing is, for dialogs, I use dialog defines so that I can keep track of what dialog numbers I'm at.
Example:
pawn Code:
#define DIALOG_LOGIN 1
Then, for player related variables (not sure of the technical name), I use a define for them.
Example:
pawn Code:
#define MAX_PLAYERS MP

new gIsPlayerLoggedIn[MP];
I then use this style of coding when I create a command:
pawn Code:
CMD:connected(playerid, params[])
{
    if(IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "You are connected.");
    else return SendClientMessage(playerid, -1, "For some reason, you are not connected.");
}
Instead of:
pawn Code:
CMD:connected(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, -1, "You are connected.");
        return 1;
    }
    else
    {
        SendClientMessage(playerid, -1, "For some reason, you are not connected.");
    }
    return 1;
}

So, how do you think I'm going with efficiency so far? Should I keep going the way I am or change things? Input your opinions below, and voice your opinion on anything else about scripting efficiently
Reply


Messages In This Thread
Best effiecent scripting - by Jack_Leslie - 31.07.2012, 03:27
Re: Best effiecent scripting - by dannyk0ed - 31.07.2012, 03:33
Re: Best effiecent scripting - by ReneG - 31.07.2012, 03:53
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 03:56
Re: Best effiecent scripting - by coole210 - 31.07.2012, 03:56
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 04:01
Re: Best effiecent scripting - by coole210 - 31.07.2012, 04:22
Re: Best effiecent scripting - by JoBullet - 31.07.2012, 05:00
Re: Best effiecent scripting - by CaHbKo - 31.07.2012, 08:40
Re: Best effiecent scripting - by CaHbKo - 31.07.2012, 09:16
Re: Best effiecent scripting - by Sinner - 31.07.2012, 09:31
Re: Best effiecent scripting - by Sniper Kitty - 31.07.2012, 09:32
Re: Best effiecent scripting - by Vince - 31.07.2012, 09:49
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 11:07
Re: Best effiecent scripting - by Slice - 31.07.2012, 11:10
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 11:12
Re: Best effiecent scripting - by IstuntmanI - 31.07.2012, 11:13
Re: Best effiecent scripting - by Slice - 31.07.2012, 11:26
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 11:46
Re: Best effiecent scripting - by Vince - 31.07.2012, 11:52
Re: Best effiecent scripting - by Universal - 31.07.2012, 12:17
Re: Best effiecent scripting - by Jack_Leslie - 31.07.2012, 12:20
Re: Best effiecent scripting - by Slice - 31.07.2012, 12:21
Re: Best effiecent scripting - by SuperViper - 31.07.2012, 16:26
Re: Best effiecent scripting - by The__ - 31.07.2012, 18:08
Re: Best effiecent scripting - by SuperViper - 31.07.2012, 19:05
Re: Best effiecent scripting - by Finn - 31.07.2012, 19:15
Re: Best effiecent scripting - by The__ - 31.07.2012, 19:24
Re: Best effiecent scripting - by Universal - 31.07.2012, 19:36
Re: Best effiecent scripting - by [KHK]Khalid - 02.08.2012, 03:12
Re: Best effiecent scripting - by Y_Less - 02.08.2012, 07:07
Re: Best effiecent scripting - by Ash. - 02.08.2012, 11:29
Re: Best effiecent scripting - by WackoX - 02.08.2012, 12:25
Re: Best effiecent scripting - by Y_Less - 02.08.2012, 14:13
Re: Best effiecent scripting - by [KHK]Khalid - 02.08.2012, 17:00
Re: Best effiecent scripting - by Y_Less - 02.08.2012, 18:44
Re: Best effiecent scripting - by [KHK]Khalid - 02.08.2012, 19:10

Forum Jump:


Users browsing this thread: 3 Guest(s)