Please can someone help me
#1

public checkup()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 1.0, 256.9511,1802.0492,7.5494))
{
SetPlayerPos(i,2543.2554,-1306.0792,1025.0703 );
SetPlayerInterior(i, 2);
else if(IsPlayerInRangeOfPoint(i, 1.0, 1685.9564,964.1009,10.7590))
{
SetPlayerPos(i,2543.2554,-1306.0792,1025.0703 );
SetPlayerInterior(i, 2);
}
}
return 1;
}
14 errors....
Reply
#2

You have forgot a closing bracket.
Reply
#3

Quote:
Originally Posted by Finn
You have forgot a closing bracket.
public checkup()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 1.0, 256.9511,1802.0492,7.5494))
{
SetPlayerPos(i,2543.2554,-1306.0792,1025.0703 );
SetPlayerInterior(i, 2);
else if(IsPlayerInRangeOfPoint(i, 1.0, 1685.9564,964.1009,10.7590))
{
SetPlayerPos(i,2543.2554,-1306.0792,1025.0703 );
SetPlayerInterior(i, 2);
}
}
return 1;
}
}
thanks i only have 2 errors now
Reply
#4

I see you don't know much of these brackets so i could explain a little bit.

Код:
public checkup()
{
  for(new i=0; i<MAX_PLAYERS; i++)
  {
   if(IsPlayerInRangeOfPoint(i, 1.0, 256.9511,1802.0492,7.5494))
   {
     SetPlayerPos(i,2543.2554,-1306.0792,1025.0703 );
     SetPlayerInterior(i, 2);
 else if(IsPlayerInRangeOfPoint(i, 1.0, 1685.9564,964.1009,10.7590))
   {
     SetPlayerPos(i,2543.2554,-1306.0792,1025.0703 );
     SetPlayerInterior(i, 2);
 }
 }
  return 1;
}
}
That is your code above has four { brackets and four } brackets, indent your code for better view.

Код:
public checkup()
{ //1
  for(new i=0; i<MAX_PLAYERS; i++)
  { //2
  |  if(IsPlayerInRangeOfPoint(i, 1.0, 256.9511,1802.0492,7.5494))
  |  { //3
  |  |  SetPlayerPos(i,2543.2554,-1306.0792,1025.0703 );
  |  |  SetPlayerInterior(i, 2);
  |  } // ! This here bracket was missing, you opened a third bracket and didn't close it.
  |  else if(IsPlayerInRangeOfPoint(i, 1.0, 1685.9564,964.1009,10.7590))
  |  { // Four
  |  | SetPlayerPos(i,2543.2554,-1306.0792,1025.0703 );
  |  | SetPlayerInterior(i, 2);
  |  } // End of the bracket Four
  } // END OF BRACKET TWO.
  return 1;
  // We didn't need a bracket here because he doesn't close anything
} // End of the bracket first which opened this public checkup
I addded | these marks for you to understand better which bracket closes what bracket, i hope you understand.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)