Quote:
Originally Posted by Jack_Leslie
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:
|
That's fine.
Quote:
Originally Posted by Jack_Leslie
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];
|
Is the correct way, you had it backwards.
Quote:
Originally Posted by Jack_Leslie
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; }
|
There is literally
no difference in efficiency between the two, it just makes you read it differently. Personal choice really.