SAMP Toll Gate Problem
#1

It gives me this error:

C:\Users\HashiramaDenzy\Desktop\SA-MP 0.3.7-R2 Windows Server\filterscripts\Others.pwn(45) : error 017: undefined symbol "TollPaid"
C:\Users\HashiramaDenzy\Desktop\SA-MP 0.3.7-R2 Windows Server\filterscripts\Others.pwn(45) : warning 215: expression has no effect
C:\Users\HashiramaDenzy\Desktop\SA-MP 0.3.7-R2 Windows Server\filterscripts\Others.pwn(45) : error 001: expected token: ";", but found "]"
C:\Users\HashiramaDenzy\Desktop\SA-MP 0.3.7-R2 Windows Server\filterscripts\Others.pwn(45) : error 029: invalid expression, assumed zero
C:\Users\HashiramaDenzy\Desktop\SA-MP 0.3.7-R2 Windows Server\filterscripts\Others.pwn(45) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

==================================================
How to fix this? the codes is on below

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#include <a_samp>
#include <streamer>
#include <zcmd>
#if defined FILTERSCRIPT
new TollPaid[MAX_PLAYERS];

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("Moving Objects by Spongegar");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else
//ROCKY MOUNTAIN
new nb;
new sb;
//FORT CALHOUN
new eb;
new wb;
new cg;
new mg;
main()
{
	print("\n----------------------------------");
	print("Moving Objects by Spongegar");
	print("----------------------------------\n");
}

#endif
//ROCKY MOUNTAIN Gates
forward close();
public close ()//close for North Bound Gate
{
new playerid;
MoveObject(nb, 1839.9758300,-3562.6206100,24.8720000,3); //after 3 seconds of opened gate it will now closed and will return to it's original position. Closed Position.
TollPaid[playerid] = 0;
return 1;
}//Southbound Closing Blocker
forward close2();
public close2 ()
{
MoveObject(sb, 1852.3601100,-3552.4511700,24.8720000,3);
return 1;
//FORT CALHOUN TOLL GATES
}
forward close3();
public close3 ()
{
MoveObject(eb, 3618.0732, 3150.8486, 26.3476,3);
}
forward close4();
public close4 ()
{
 MoveObject(wb, 3606.4448, 3159.7026, 26.3491, 3);
}
forward close5();
public close5 ()
{
 MoveObject(cg, 3379.5000, 3716.4387, 15.8885, 3);
}
forward close6();
public close6 ()
{
 MoveObject(mg, 3000.0281, 3166.0081, 17.7003, 3);
}
public OnGameModeInit()
{
//ROCKY MOUNTAIN TOLL GATES
nb = CreateObject(3578,1839.9758300,-3562.6206100,24.8720000,0.0000000,0.0000000,90.0000000); // North Bound Closed Blocker/Original Position
sb = CreateObject(3578,1852.3601100,-3552.4511700,24.8720000,0.0000000,0.0000000,90.0000000); // South Bound Closed Blocker /Original Position
//FORT CALHOUN TOLL GATES
eb = CreateObject(3578, 3618.0732, 3150.8486, 26.3476,0.0000000,0.0000000,90.0000000); // East Bound Closed Blocker/Original Position
wb = CreateObject(3578, 3606.4448, 3159.7026, 26.3491, 0.0000000,0.0000000,90.0000000); //West Bound Closed Clobker/Original Position
cg = CreateObject (976, 3379.5000, 3716.4387, 15.8885, 0.0000000,0.0000000,180.0000000); //City Hall Closed Gate/Original Position
mg = CreateObject (985, 3000.0281, 3166.0081, 17.7003, 0.0000000,0.0000000,180.0000000); //Mansion Closed Gate/Original Position
return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
 TollPaid[playerid]=0;
 SetPlayerTime(playerid, 0, 0);
 SetWeather(1);
 GivePlayerMoney(playerid, 16000);
 SetPlayerHealth(playerid, 50000);
 Create3DTextLabel("West Emerald Expressway to Rocky Mountain", 0xFFFFFF, 1331.5966, -2286.1479, 14.8848, 100.0, 0, 0);
 Create3DTextLabel("Stonefield Town", 0xFFFFFF, 1562.4888, -3574.3423, 13.4243, 100.0, 0, 0);
 Create3DTextLabel("Stonefield View", 0xFFFFFF, 1930.9447, -3674.2808, 139.6094, 100.0, 0, 0);
 Create3DTextLabel("Rocky Mountain's Junk Site", 0xFFFFFF, 3040.9128, -4346.4385, 274.6297, 100.0, 0, 0);
 Create3DTextLabel("Rocky Mountain's Farm Village", 0xFFFFFF, 2738.7590, -3780.2832, 379.6364, 100.0, 0, 0);
 Create3DTextLabel("Rocky Mountain's Truck Depot", 0xFFFFFF, 3176.8823, -3659.9016, 464.5526, 100.0, 0, 0);
 Create3DTextLabel("Rocky Mountain's Airport", 0xFFFFFF, 3652.7754, -4394.2158, 587.2219, 100.0, 0, 0);
 Create3DTextLabel("Rocky Mountain's Power Plant", 0xFFFFFF, 3374.9431, -3993.7437 ,552.4988, 100.0, 0, 0);
 Create3DTextLabel("Falcon Haven Town", 0xFFFFFF, 2960.6812, -4901.0659, 562.6208, 100.0, 0, 0);
 Create3DTextLabel("Expressway to Eagle Island", 0xFFFFFF, 3867.6941, -5866.0063, 773.7996, 100.0, 0, 0);
 Create3DTextLabel("Rocky Mountain's Warehouse", 0xFFFFFF, 4013.0901, -6055.3540, 753.6495, 100.0, 0, 0);
 Create3DTextLabel("Rocky Mountain's Military Base", 0xFFFFFF, 2332.7107, -4021.9839, 206.1573, 100.0, 0, 0);
 Create3DTextLabel("Springcrest Town", 0xFFFFFF, 2246.9746, -4843.9668, 118.7989, 100.0, 0, 0);
 Create3DTextLabel("Springcrest Fuel Factory", 0xFFFFFF, 2160.2498, -4418.3823, 118.8131, 100.0, 0, 0);
 Create3DTextLabel("Springcrest Town", 0xFFFFFF, 2737.4978, -5595.0020, 118.7390, 100.0, 0, 0);
 Create3DTextLabel("Road to Jonestown", 0xFFFFFF, 4474.8960, -6962.2734, 39.9894, 100.0, 0, 0);
 Create3DTextLabel("Rocky Mountain's Dump Site", 0xFFFFFF, 2953.4185, -2695.4202, 4.1022, 100.0, 0, 0);
 Create3DTextLabel("Rocky Mountain's Dock", 0xFFFFFF, 1378.6476, -5599.5273, 18.0278, 100.0, 0, 0);
 Create3DTextLabel ("Coming Soon! Grand Canyon :D ", 0xFFFFFF, 6891.2197, -5305.1851, 98.9425, 100.0, 0, 0);
 Create3DTextLabel ("Jonestown. Get out of Here before they come to you! Visit: https://en.wikipedia.org/wiki/Jonestown", 0xFFFFFF, 5630.8755, -8487.4531, 40.8300, 100.0, 0, 0);
 return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SendClientMessage(playerid, 0x00FF00FF, "Respawned!");
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
  return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    new playerid;
    SendClientMessage(playerid, 0x00FF00FF, "You paid 8$ for Toll Fee! Be careful on driving and enjoy your trip!");
    GivePlayerMoney(playerid, -8);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
    //ROCKY MOUNTAIN TOLL GATES
    if(IsPlayerInRangeOfPoint(playerid, 6, 1839.9758300,-3562.6206100,24.8720000) && TollPaid[playerid] == 0) //Range/area same with the Gate
    {
    MoveObject(nb, 1839.9956, -3562.6233, 23.4365, 3); // if the player is in range/area this line will move the gate's Z position in other words the gates will lower in order to open. This is now the OPEN Position of gate
    TollPaid[playerid] = 1;
	SetTimer("close", 3000, 0);//Timer before closing (3,000 milliseconds = 3 seconds) and will call the close function
	}
    if(IsPlayerInRangeOfPoint(playerid, 6, 1852.3601,-3552.4512,24.8720000))//Range/area same with the Gate
    {
    MoveObject(sb, 1852.3601, -3552.4512, 23.3609, 3);// if the player is in range/area this line will move the gate's Z position in other words the gates will lower in order to open. This is now the OPEN Position of gate
    SetTimer("close2", 3000, 0);//Timer before closing and will call the close2 function
	}
	//FORT CALHOUN TOLL GATES
	if(IsPlayerInRangeOfPoint(playerid, 6, 3618.0732, 3150.8486, 26.3476)) //Range/area same with the Gate
    {
    MoveObject(eb, 3618.0732, 3150.8486, 25.0366, 3); // if the player is in range/area this line will move the gate's Z position in other words the gates will lower in order to open. This is now the OPEN Position of gate
    SetTimer("close3", 3000, 0);//Timer before closing and will call the close function
	}
	if(IsPlayerInRangeOfPoint(playerid, 6,  3606.4448, 3159.7026, 26.3491)) //Range/area same with the Gate
    {
    MoveObject(wb, 3606.4448, 3159.7026, 25.0208, 3); // if the player is in range/area this line will move the gate's Z position in other words the gates will lower in order to open. This is now the OPEN Position of gate
    SetTimer("close4", 3000, 0);//Timer before closing and will call the close function
	}
	if(IsPlayerInRangeOfPoint(playerid, 6, 3379.5000, 3716.4387, 15.8885)) //Range/area same with the Gate
    {
    MoveObject(cg, 3371.5000, 3716.4387, 15.8885, 3); // if the player is in range/area this line will move the gate's Z position in other words the gates will lower in order to open. This is now the OPEN Position of gate
    SetTimer("close5", 3000, 0);//Timer before closing and will call the close function
	}
	if(IsPlayerInRangeOfPoint(playerid, 6,  3000.0281, 3166.0081, 17.7003)) //Range/area same with the Gate
    {
    MoveObject(mg, 2992.5681, 3166.0081, 17.7003, 3); // if the player is in range/area this line will move the gate's Z position in other words the gates will lower in order to open. This is now the OPEN Position of gate
    SetTimer("close6", 3000, 0);//Timer before closing and will call the close function
	}
    return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
Reply
#2

Okay, me and everyone are aliens from another universe while you're a fellow human being. How the hell would we know which is Line 45?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)