12.07.2011, 17:11
It's okay for your first gamemode, but I see a lot of room for improvement; The indentation in some parts just looks like crap. Furthermore, there are parts in the GM of which I'm sure that they were copied and for which no credit was given.
And last but not least, some general improvements. First: make good use of switch statements. if-elseif-elseif-elseif-...-else looks ugly and unprofessional. Second, you can save the class of a player in a single variable, rather than 5, using for example:
And last but not least, some general improvements. First: make good use of switch statements. if-elseif-elseif-elseif-...-else looks ugly and unprofessional. Second, you can save the class of a player in a single variable, rather than 5, using for example:
pawn Code:
enum
{
CLASS_SNIPER = 1,
CLASS_ASSAULT,
CLASS_ROCKET,
CLASS_PILOT,
CLASS_MEDIC
};
new pClass[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
switch(pClass[playerid])
{
case CLASS_SNIPER: {}
case CLASS_ASSAULT: {}
case CLASS_ROCKET: {}
case CLASS_PILOT: {}
case CLASS_MEDIC: {}
default: ShowPlayerDialog(...);
}
return 1;
}