Adding Teams
#10

You could really optimize your code a little here, first of all, why are they all if statements? They could be else if statements, if one is true, the others can't be true in this case, so treat it like so! Also, considering the ID's of your teams are actually just the classid + 1, why not forget about the if statements altogether and just do something like this:

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    gTeam[playerid] = classid + 1;
}
Currently, that piece of code is achieving the exact same thing as your other piece of code. Since the ID of the teams are just the classid + 1!
Reply


Messages In This Thread
Adding Teams - by AVG_Free - 19.03.2011, 12:18
Re: Adding Teams - by [L3th4l] - 19.03.2011, 12:23
Re: Adding Teams - by PinkFloydLover - 19.03.2011, 12:23
Re: Adding Teams - by AVG_Free - 19.03.2011, 12:25
Re : Adding Teams - by Soumi - 19.03.2011, 12:28
Re: Adding Teams - by AVG_Free - 19.03.2011, 12:33
Re : Adding Teams - by Soumi - 19.03.2011, 12:44
Re: Adding Teams - by AVG_Free - 19.03.2011, 13:00
Re : Re: Adding Teams - by Soumi - 19.03.2011, 13:39
Re: Adding Teams - by JaTochNietDan - 19.03.2011, 13:42

Forum Jump:


Users browsing this thread: 1 Guest(s)