07.12.2009, 23:54
to get even numbers you need to use a operator called modulus (%) what mod does is get the remainder of a divison operation.
for example 5/2 will return 1, becuase 5 divided by 2 has a remainder of 1. but 4/4 has a remainder of 0 (this is how you check for even or odd)
for example 5/2 will return 1, becuase 5 divided by 2 has a remainder of 1. but 4/4 has a remainder of 0 (this is how you check for even or odd)
pawn Код:
public OnPlayerConnect(playerid)
{
if(playerid%2 == 0) {
//execute whatever you want to do if the playerid is even
}
else {
//execute whatever you want to do if the playerid is odd
}
return 1;
}