[SOLVED] Script issue..
#1

Hi.. It's me again..

So I've been mapping/scripting something for my friend's server, a car dealership in LV along with a FS for the gates and elevators. I've followed two different tutorials and tried out both, the second one seemed to work the best with one gate. So I carried on and scripted my ass off, but when compiling, it showed up quite a lot of errors.. Here's the whole FS:

Код:
//**********************Carplaza Storage Elevator*******************************
//*******************************By iFrost**************************************

#include <a_samp>
new elevator;
new elevator1;
new elevator2;
new elevator3;
new entrance;
new storage;
new dock;

//==============================================================================

public OnFilterScriptInit()

	elevator = CreateObject(18452, 1218.8438720703, 742.59869384766, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 1/4 part of the elevator
	elevator1 = CreateObject(18452, 1218.9141845703, 745.57165527344, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 2/4 parts of the elevator
	elevator2 = CreateObject(18452, 1225.1022949219, 742.47747802734, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 3/4 parts of the elevator
	elevator3 = CreateObject(18452, 1225.0166015625, 745.52502441406, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 4/4 parts of the elevator
	entrance = CreateObject(980, 1337.037109375, 752.17578125, 12.589487075806, 0.000000, 0.000000, 270.51635742188); // Entrance gate
	dock = CreateObject(980, 1263.1923828125, 647.3798828125, 3.414487361908, 0.000000, 0.000000, 160.88928222656); // Dock gate
	storage = CreateObject(980, 1229.111328125, 744.5458984375, 12.61450958252, 0.000000, 0.000000, 269.87915039063); // Storage gate
	
//==============================================================================

public OnPlayerCommandText(playerid, cmdtext[])

{
	if (!strcmp("/dfloor0", cmdtext)) //Goes to the bottom floor.
	{
	  MoveObject(elevator, 1218.8438720703, 742.59869384766, 6.4440445899963, 3.5); // 1/4 part of the elevator on the 1st floor
	  MoveObject(elevator1, 1218.9141845703, 745.57165527344, 6.4440445899963, 3.5); // 2/4 parts of the elevator on the 1st floor
	  MoveObject(elevator2, 1225.1022949219, 742.47747802734, 6.4440445899963, 3.5); // 3/4 parts of the elevator on the 1st floor
	  MoveObject(elevator3, 1225.0166015625, 745.52502441406, 6.4440445899963, 3.5); // 4/4 parts of the elevator on the 1st floor
	 	}
	 	return 1;
	}

	if (!strcmp("/dfloor1", cmdtext)) //Goes to the first floor.
	{
	  MoveObject(elevator, 1218.84375, 742.5986328125, 12.569038391113, 3.5); // 1/4 part of the elevator on the 1st floor
	  MoveObject(elevator1, 1218.8393554688, 745.57604980469, 12.569046020508, 3.5); // 2/4 parts of the elevator on the 1st floor
      MoveObject(elevator2, 1225.1015625, 742.4765625, 12.569053649902, 3.5); // 3/4 parts of the elevator on the 1st floor
	  MoveObject(elevator3, 1225.0166015625, 745.5244140625, 12.569040298462, 3.5); // 4/4 parts of the elevator on the 1st floor
		}
		return 1;
	}
	
	if (!strcmp("/dfloor2", cmdtext)) //Goes to the second floor.
	{
		MoveObject(elevator, 2353.693359375, -650.77709960938, 127.85127258301, 1);
		}
		return 1;
	}
	
	if (!strcmp("/dentranceopen", cmdtext)) //Opens the main gate to the plaza.
  }
	  MoveObject(entrance, 1337.1750488281, 740.90014648438, 12.589487075806, 3.5);
	  }
	  return 1;
	  
  }
  
  if (!strcmp("/dstorageopen", cmdtext)) //Opens the gate to the storage.
  }
		MoveObject(storage, 1229.1000976563, 733.0458984375, 12.61450958252, 3.5);
		}
		return 1;
		
	}
		
	if (!strcmp("/ddockopen", cmdtext)) //Opens the gate to the dock.
	}
	  MoveObject(dock, 1252.3698730469, 651.12945556641, 3.414487361908, 3.5);
	  }
	  return 1;
	  
	}
	
	if (!strcmp("/dentranceclose", cmdtext)) //Closes the main gate to the plaza.
	}
	  MoveObject(entrance, 1337.037109375, 752.17578125, 12.589487075806, 3.5);
	  }
	  return 1;

	}
	
	if (strcmp("/dstorageclose", cmdtext)) //Closes the gate to the storage.
	}
	  MoveObject(storage, 1229.111328125, 744.5458984375, 12.61450958252, 3.5);
	  }
	  return 1;

	}
	
	if (strcmp("/ddockclose", cmdtext)) //Closes the gate to the dock.
	}
	  MoveObject(dock, 1263.1923828125, 647.3798828125, 3.414487361908, 3.5);
	  }
	  return 1;
	  
	}
The errors:

Код:
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(18) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(37) : warning 217: loose indentation
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(40) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(47) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(50) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(54) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(57) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(61) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(63) : error 054: unmatched closing brace ("}")
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(65) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(69) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(71) : error 054: unmatched closing brace ("}")
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(73) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(77) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(79) : error 054: unmatched closing brace ("}")
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(81) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(85) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(87) : error 054: unmatched closing brace ("}")
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(89) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(93) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(95) : error 054: unmatched closing brace ("}")
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(97) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(101) : error 010: invalid function or declaration
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(103) : error 054: unmatched closing brace ("}")
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(105) : warning 203: symbol is never used: "dock"
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(105) : warning 203: symbol is never used: "entrance"
C:\DOCUME~1\adnad\MIJNDO~1\DOWNLO~1\SAMPSE~1\FILTER~1\ELEVAT~1.PWN(105) : warning 203: symbol is never used: "storage"
Please help.. It all seemed to go well, but I guess I've done quite something wrong..
Reply
#2

There are no open/close brackets on the OnFilterScriptInit.
Reply
#3

Hehe, nothing to worry about. Just an extra bracket some where. :P
Код:
//**********************Carplaza Storage Elevator*******************************
//*******************************By iFrost**************************************

#include <a_samp>
new elevator;
new elevator1;
new elevator2;
new elevator3;
new entrance;
new storage;
new dock;

//==============================================================================

public OnFilterScriptInit()
{
	elevator = CreateObject(18452, 1218.8438720703, 742.59869384766, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 1/4 part of the elevator
	elevator1 = CreateObject(18452, 1218.9141845703, 745.57165527344, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 2/4 parts of the elevator
	elevator2 = CreateObject(18452, 1225.1022949219, 742.47747802734, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 3/4 parts of the elevator
	elevator3 = CreateObject(18452, 1225.0166015625, 745.52502441406, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 4/4 parts of the elevator
	entrance = CreateObject(980, 1337.037109375, 752.17578125, 12.589487075806, 0.000000, 0.000000, 270.51635742188); // Entrance gate
	dock = CreateObject(980, 1263.1923828125, 647.3798828125, 3.414487361908, 0.000000, 0.000000, 160.88928222656); // Dock gate
	storage = CreateObject(980, 1229.111328125, 744.5458984375, 12.61450958252, 0.000000, 0.000000, 269.87915039063); // Storage gate
	
//==============================================================================
}
public OnPlayerCommandText(playerid, cmdtext[])

{
	if (!strcmp("/dfloor0", cmdtext)) //Goes to the bottom floor.
	{
	  MoveObject(elevator, 1218.8438720703, 742.59869384766, 6.4440445899963, 3.5); // 1/4 part of the elevator on the 1st floor
	  MoveObject(elevator1, 1218.9141845703, 745.57165527344, 6.4440445899963, 3.5); // 2/4 parts of the elevator on the 1st floor
		MoveObject(elevator2, 1225.1022949219, 742.47747802734, 6.4440445899963, 3.5); // 3/4 parts of the elevator on the 1st floor
		MoveObject(elevator3, 1225.0166015625, 745.52502441406, 6.4440445899963, 3.5); // 4/4 parts of the elevator on the 1st floor
		}
		return 1;
	}

	if (!strcmp("/dfloor1", cmdtext)) //Goes to the first floor.
	{
	  MoveObject(elevator, 1218.84375, 742.5986328125, 12.569038391113, 3.5); // 1/4 part of the elevator on the 1st floor
	  MoveObject(elevator1, 1218.8393554688, 745.57604980469, 12.569046020508, 3.5); // 2/4 parts of the elevator on the 1st floor
		MoveObject(elevator2, 1225.1015625, 742.4765625, 12.569053649902, 3.5); // 3/4 parts of the elevator on the 1st floor
		MoveObject(elevator3, 1225.0166015625, 745.5244140625, 12.569040298462, 3.5); // 4/4 parts of the elevator on the 1st floor
		}
		return 1;
	}
	
	if (!strcmp("/dfloor2", cmdtext)) //Goes to the second floor.
	{
		MoveObject(elevator, 2353.693359375, -650.77709960938, 127.85127258301, 1);
		}
		return 1;
	}
	
	if (!strcmp("/dentranceopen", cmdtext)) //Opens the main gate to the plaza.
  {
	  MoveObject(entrance, 1337.1750488281, 740.90014648438, 12.589487075806, 3.5);
	  }
	  return 1;
	  
  }
  
  if (!strcmp("/dstorageopen", cmdtext)) //Opens the gate to the storage.
  {
		MoveObject(storage, 1229.1000976563, 733.0458984375, 12.61450958252, 3.5);
		}
		return 1;
		
	}
		
	if (!strcmp("/ddockopen", cmdtext)) //Opens the gate to the dock.
	{
	  MoveObject(dock, 1252.3698730469, 651.12945556641, 3.414487361908, 3.5);
	  }
	  return 1;
	  
	}
	
	if (!strcmp("/dentranceclose", cmdtext)) //Closes the main gate to the plaza.
      {
	  MoveObject(entrance, 1337.037109375, 752.17578125, 12.589487075806, 3.5);
	  }
	  return 1;

	}
	
	if (strcmp("/dstorageclose", cmdtext)) //Closes the gate to the storage.
	{
	  MoveObject(storage, 1229.111328125, 744.5458984375, 12.61450958252, 3.5);
	  }
	  return 1;

	}
	
	if (strcmp("/ddockclose", cmdtext)) //Closes the gate to the dock.
	{
	  MoveObject(dock, 1263.1923828125, 647.3798828125, 3.414487361908, 3.5);
	  }
	  return 1;
	  }
There you go After every "if" you had a closing bracket instead of an opening bracket :P
Reply
#4

pawn Код:
#include <a_samp>


//**********************Carplaza Storage Elevator*******************************
//*******************************By iFrost**************************************

#include <a_samp>
new elevator;
new elevator1;
new elevator2;
new elevator3;
new entrance;
new storage;
new dock;

//==============================================================================

public OnFilterScriptInit()
{
    elevator = CreateObject(18452, 1218.8438720703, 742.59869384766, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 1/4 part of the elevator
    elevator1 = CreateObject(18452, 1218.9141845703, 745.57165527344, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 2/4 parts of the elevator
    elevator2 = CreateObject(18452, 1225.1022949219, 742.47747802734, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 3/4 parts of the elevator
    elevator3 = CreateObject(18452, 1225.0166015625, 745.52502441406, 6.4440445899963, 0.000000, 0.000000, 0.000000); // 4/4 parts of the elevator
    entrance = CreateObject(980, 1337.037109375, 752.17578125, 12.589487075806, 0.000000, 0.000000, 270.51635742188); // Entrance gate
    dock = CreateObject(980, 1263.1923828125, 647.3798828125, 3.414487361908, 0.000000, 0.000000, 160.88928222656); // Dock gate
    storage = CreateObject(980, 1229.111328125, 744.5458984375, 12.61450958252, 0.000000, 0.000000, 269.87915039063); // Storage gate
    return 1;
}
//==============================================================================

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/dfloor0", cmdtext)) //Goes to the bottom floor.
    {
      MoveObject(elevator, 1218.8438720703, 742.59869384766, 6.4440445899963, 3.5); // 1/4 part of the elevator on the 1st floor
      MoveObject(elevator1, 1218.9141845703, 745.57165527344, 6.4440445899963, 3.5); // 2/4 parts of the elevator on the 1st floor
        MoveObject(elevator2, 1225.1022949219, 742.47747802734, 6.4440445899963, 3.5); // 3/4 parts of the elevator on the 1st floor
        MoveObject(elevator3, 1225.0166015625, 745.52502441406, 6.4440445899963, 3.5); // 4/4 parts of the elevator on the 1st floor
        return 1;   }

    if (!strcmp("/dfloor1", cmdtext)) //Goes to the first floor.
    {
      MoveObject(elevator, 1218.84375, 742.5986328125, 12.569038391113, 3.5); // 1/4 part of the elevator on the 1st floor
      MoveObject(elevator1, 1218.8393554688, 745.57604980469, 12.569046020508, 3.5); // 2/4 parts of the elevator on the 1st floor
        MoveObject(elevator2, 1225.1015625, 742.4765625, 12.569053649902, 3.5); // 3/4 parts of the elevator on the 1st floor
        MoveObject(elevator3, 1225.0166015625, 745.5244140625, 12.569040298462, 3.5); // 4/4 parts of the elevator on the 1st floor
        return 1;
    }

    if (!strcmp("/dfloor2", cmdtext)) //Goes to the second floor.
    {
        MoveObject(elevator, 2353.693359375, -650.77709960938, 127.85127258301, 1);
        return 1;
    }

    if (!strcmp("/dentranceopen", cmdtext)) //Opens the main gate to the plaza.
  {
      MoveObject(entrance, 1337.1750488281, 740.90014648438, 12.589487075806, 3.5);
      return 1;
  }

  if (!strcmp("/dstorageopen", cmdtext)) //Opens the gate to the storage.
  {
        MoveObject(storage, 1229.1000976563, 733.0458984375, 12.61450958252, 3.5);
        return 1;
    }

    if (!strcmp("/ddockopen", cmdtext)) //Opens the gate to the dock.
    {
      MoveObject(dock, 1252.3698730469, 651.12945556641, 3.414487361908, 3.5);
      return 1;
    }

    if (!strcmp("/dentranceclose", cmdtext)) //Closes the main gate to the plaza.
    {
      MoveObject(entrance, 1337.037109375, 752.17578125, 12.589487075806, 3.5);
      return 1;
    }

    if (strcmp("/dstorageclose", cmdtext)) //Closes the gate to the storage.
    {
      MoveObject(storage, 1229.111328125, 744.5458984375, 12.61450958252, 3.5);
      return 1;
    }

    if (strcmp("/ddockclose", cmdtext)) //Closes the gate to the dock.
    {
      MoveObject(dock, 1263.1923828125, 647.3798828125, 3.414487361908, 3.5);
      return 1;
    }
  return 0;
}
Reply
#5

Thanks for the fast reply guys, it works now!!

Again, thanks a lot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)