19.12.2009, 15:20
If you end up with a bunch of instances of this in your script:
if(gTeam[playerid] == TEAM_ARMY && gTeam[playerid] == TEAM_FBI && gTeam[playerid] == TEAM_SWAT)
You can combine them into one definition:
Because if(IsACop(playerid)) is alot more manageable and you can easily go back and edit the definition without retracing your steps 20 times throughout the script.
if(gTeam[playerid] == TEAM_ARMY && gTeam[playerid] == TEAM_FBI && gTeam[playerid] == TEAM_SWAT)
You can combine them into one definition:
Код:
IsACop(playerid)
{
if(gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_FBI || gTeam[playerid] == TEAM_SWAT) //check if the player is law enforcement
{
return 1;
}
return 0;
}

