What's wrong?
#1

Код:
public OnPlayerDisconnect(playerid, reason)
{
	if(takim[playerid] == 1)
	{
	if(currClass[playerid] == 0)
	{
 	teamPlayers[0]--;
  }
  	else if(currClass[playerid] == 1)
  {
    teamPlayers[0]--;
  }
  else if(currClass[playerid] == 2)
  {
    teamPlayers[0]--;
  }
  else if(currClass[playerid] == 3)
  {
    teamPlayers[1]--;
  }
  else if(currClass[playerid] == 4)
  {
    teamPlayers[1]--;
  }
  else if(currClass[playerid] == 5)
  {
  teamPlayers[1]--;
  }
  }
  else if(takim[playerid] == 1)
  {
  //Do nothing
  }
  return 0;
}
I wanna if takim = 1 and currClass = 0,1,2 teamPlayers[0]-- and if takim = 1 and currClass,3,4,5 teamPlayers[0]--

But it doesn't work. Please help me

(OnPlayerSpawn has takim[playerid] ==1)
Reply
#2

See this
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
  if(takim[playerid]==1){
    if(currClass[playerid]==0 || currClass[playerid]==1 || currClass[playerid]==2) teamPlayers[0]--;
    if(currClass[playerid]==3 || currClass[playerid]==4 || currClass[playerid]==5) teamPlayers[1]--;
  }
  return 1;
}
I hope it will help you.
-Abhinav
Reply
#3

didn't help
Reply
#4

Use a 'switch':

pawn Код:
switch( some_variable )
{
  case 0 : //do this
  case 1 : //do this
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)