PDA

View Full Version : ServerHeartbeat Error


0B3Y
19/05/2015, 04:33 PM
Hello guys, today i updating my Roleplay gamemode and it's showing this error

C:\Program Files (x86)\Script\AML DONT ERASE\gamemodes\AML.pwn(128110) : error 029: invalid expression, assumed zero
C:\Program Files (x86)\Script\AML DONT ERASE\gamemodes\AML.pwn(128110) : error 017: undefined symbol "ServerHeartbeat_yT@"
C:\Program Files (x86)\Script\AML DONT ERASE\gamemodes\AML.pwn(128110) : warning 215: expression has no effect
C:\Program Files (x86)\Script\AML DONT ERASE\gamemodes\AML.pwn(128110) : error 017: undefined symbol "ServerHeartbeat@yT_"
C:\Program Files (x86)\Script\AML DONT ERASE\gamemodes\AML.pwn(128110) : fatal error 107: too many error messages on one line

The code's on those line are
ptask ServerHeartbeat[1000](playerid)
{
new string[128];
new level = PlayerInfo[playerid][pLevel];

/////////////////////////// Toll Booth Check ///////////////////////////////
if(PlayerInfo[playerid][pAtTollBooth] == 0 && IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0)
{
for(new i = 0; i < MAX_TOLL_BOOTHS; i++)
{
if(PlayerInfo[playerid][pAtTollBooth] == 0)
{
new Float:TBX, Float:TBY, Float:TBZ, hasezpass;
GetDynamicObjectPos(TollBooths[i], TBX, TBY, TBZ);
if(IsPlayerInRangeOfPoint(playerid, 10.0, TBX, TBY, TBZ))
{
if(TollShutdown == 0)
{
new carid = GetPlayerVehicleID(playerid);
for(new v=0; v<MAX_PLAYERVEHICLES; v++)
{
if(PlayerVehicleInfo[playerid][v][pvId] == carid && PlayerVehicleInfo[playerid][v][pvEZPass] == 1)
{
hasezpass = 1;
}
}
if(hasezpass == 1)
{
new ClosestTollObject = GetClosestTollObject(playerid);
new Float:X, Float:Y, Float:Z, Float:RX, Float:RY, Float:RZ;
GetDynamicObjectPos(ClosestTollObject, X, Y, Z);
GetDynamicObjectRot(ClosestTollObject, RX, RY, RZ);
new str[64];
MoveDynamicObject(ClosestTollObject, X, Y, Z, 1, RX, 0.0, RZ);
SendClientMessageEx(playerid, COLOR_YELLOW, "Your EZPass Transponder has automatically let you through the toll booth.");
if(IsABike(carid) && !IsACopCar(carid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // Is it a Bike and not a cop bike
{
// Charge Calculations
new taxcharge = floatround(((5 * TaxValue)/100), floatround_ceil);
new totalcharge = taxcharge + 5;
PlayerInfo[playerid][pAccount] -= totalcharge;
format(str, sizeof(str), "Your account has been automatically deducted $%d", totalcharge);
SendClientMessageEx(playerid, COLOR_YELLOW, str);
}
else if(IsAHeavyVehicle(carid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // Is it a Truck or Van
{
if(IsTrailerAttachedToVehicle(carid))
{
// Charge Calculations
new taxcharge = floatround(((25 * TaxValue)/100), floatround_ceil);
new totalcharge = taxcharge + 25;
PlayerInfo[playerid][pAccount] -= totalcharge;
format(str, sizeof(str), "Your account has been automatically deducted $%d", totalcharge);
SendClientMessageEx(playerid, COLOR_YELLOW, str);
}
else
{
// Charge Calculations
new taxcharge = floatround(((15 * TaxValue)/100), floatround_ceil);
new totalcharge = taxcharge + 15;
PlayerInfo[playerid][pAccount] -= totalcharge;
format(str, sizeof(str), "Your account has been automatically deducted $%d", totalcharge);
SendClientMessageEx(playerid, COLOR_YELLOW, str);
}
}
else // It's something else (Normal Car)
{
if(IsTrailerAttachedToVehicle(carid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
// Charge Calculations
new taxcharge = floatround(((15 * TaxValue)/100), floatround_ceil);
new totalcharge = taxcharge + 15;
PlayerInfo[playerid][pAccount] -= totalcharge;
format(str, sizeof(str), "Your account has been automatically deducted $%d", totalcharge);
SendClientMessageEx(playerid, COLOR_YELLOW, str);
}
else
{
// Charge Calculations
new taxcharge = floatround(((10 * TaxValue)/100), floatround_ceil);
new totalcharge = taxcharge + 10;
PlayerInfo[playerid][pAccount] -= totalcharge;
format(str, sizeof(str), "Your account has been automatically deducted $%d", totalcharge);
SendClientMessageEx(playerid, COLOR_YELLOW, str);
}
}

SetTimerEx("ResetTollBoothObject", 5000, 0, "ii", playerid, ClosestTollObject);

PlayerInfo[playerid][pAtTollBooth] = 1;
SetTimerEx("ResetTollBoothMenu", 5000, 0, "i", playerid);
}
if(hasezpass != 1)
{
new str[1024];
PlayerInfo[playerid][pAtTollBooth] = 1;

if(IsABike(carid) && !IsACopCar(carid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // Is it a Regular Bike and not a COP Bike
{
// Charge Calculations
new taxcharge = floatround(((5 * TaxValue)/100), floatround_ceil);
new totalcharge = taxcharge + 5;

format(string, sizeof(string), "{00FF00}Los Angeles - Las Vegas Toll Booth Charge\n\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Vehicle Type: Motorbike / Off-Road Bike\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Tax Charge: $%d\n", taxcharge);
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Vehicle Charge: $5\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Total Charge: $%d\n", totalcharge);
strcat(str, string);
ShowPlayerDialog(playerid, DIALOG_TOLLBOOTH, DIALOG_STYLE_MSGBOX, "{FFFFFF}LA-LV Tollbooth", str, "Accept", "Reject");
PlayerInfo[playerid][pTollBoothCharge] = totalcharge;
}
else if(IsAHeavyVehicle(carid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // Is it a Truck or Van
{
if(IsTrailerAttachedToVehicle(carid))
{
// Charge Calculations
new taxcharge = floatround(((25 * TaxValue)/100), floatround_ceil);
new totalcharge = taxcharge + 25;

format(string, sizeof(string), "{00FF00}Los Angeles - Las Vegas Toll Booth Charge\n\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Vehicle Type: Heavy Vehicle and Trailer\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Tax Charge: $%d\n", taxcharge);
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Vehicle Charge: $25\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Total Charge: $%d\n", totalcharge);
strcat(str, string);
ShowPlayerDialog(playerid, DIALOG_TOLLBOOTH, DIALOG_STYLE_MSGBOX, "{FFFFFF}LA-LV Tollbooth", str, "Accept", "Reject");
PlayerInfo[playerid][pTollBoothCharge] = totalcharge;
}
else
{
// Charge Calculations
new taxcharge = floatround(((15 * TaxValue)/100), floatround_ceil);
new totalcharge = taxcharge + 15;

format(string, sizeof(string), "{00FF00}Los Angeles - Las Vegas Toll Booth Charge\n\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Vehicle Type: Heavy Vehicle without Trailer\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Tax Charge: $%d\n", taxcharge);
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Vehicle Charge: $15\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Total Charge: $%d\n", totalcharge);
strcat(str, string);
ShowPlayerDialog(playerid, DIALOG_TOLLBOOTH, DIALOG_STYLE_MSGBOX, "{FFFFFF}LA-LV Tollbooth", str, "Accept", "Reject");
PlayerInfo[playerid][pTollBoothCharge] = totalcharge;
}
}
else // It's something else (Normal Car) or CopCar
{

if(IsTrailerAttachedToVehicle(carid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
// Charge Calculations
new taxcharge = floatround(((15 * TaxValue)/100), floatround_ceil);
new totalcharge = taxcharge + 15;

format(string, sizeof(string), "{00FF00}Los Angeles - Las Vegas Toll Booth Charge\n\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Vehicle Type: Standard Vehicle and Trailer\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Tax Charge: $%d\n", taxcharge);
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Vehicle Charge: $15\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Total Charge: $%d\n", totalcharge);
strcat(str, string);
ShowPlayerDialog(playerid, DIALOG_TOLLBOOTH, DIALOG_STYLE_MSGBOX, "{FFFFFF}LA-LV Tollbooth", str, "Accept", "Reject");
PlayerInfo[playerid][pTollBoothCharge] = totalcharge;
}//check for pd vehicles
else if(IsACopCar(carid) || IsAnLVMPDCar(carid) || IsAnMPSCar(carid) || IsAFBICar(carid) || IsAnAmbulance(carid) || IsAnCHPCar(carid) || IsAnSASDCar(carid) || IsAnDOCCar(carid)
|| IsAPersonalCopCar(carid) || GetPlayerColor(playerid) == COLOR_VIP)
{
new ClosestTollObject = GetClosestTollObject(playerid);
new Float:X, Float:Y, Float:Z, Float:RX, Float:RY, Float:RZ;
GetDynamicObjectPos(ClosestTollObject, X, Y, Z);
GetDynamicObjectRot(ClosestTollObject, RX, RY, RZ);
MoveDynamicObject(ClosestTollObject, X, Y, Z, 1, RX, 0.0, RZ);

SendClientMessageEx(playerid, COLOR_YELLOW, "Your EZPass Fleet Transponder has automatically let you through the toll booth.");
SetTimerEx("ResetTollBoothObject", 5000, 0, "ii", playerid, ClosestTollObject);
PlayerInfo[playerid][pAtTollBooth] = 1;
SetTimerEx("ResetTollBoothMenu", 5000, 0, "i", playerid);
}
else
{
// Charge Calculations
new taxcharge = floatround(((10 * TaxValue)/100), floatround_ceil);
new totalcharge = taxcharge + 10;

format(string, sizeof(string), "{00FF00}Los Angeles - Las Vegas Toll Booth Charge\n\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Vehicle Type: Standard Vehicle\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Tax Charge: $%d\n", taxcharge);
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Vehicle Charge: $10\n");
strcat(str, string);
format(string, sizeof(string), "{FFFFFF}Total Charge: $%d\n", totalcharge);
strcat(str, string);
ShowPlayerDialog(playerid, DIALOG_TOLLBOOTH, DIALOG_STYLE_MSGBOX, "{FFFFFF}LA-LV Tollbooth", str, "Accept", "Reject");
PlayerInfo[playerid][pTollBoothCharge] = totalcharge;
}
}
}
}
else if(TollShutdown == 1 && (IsAGovernmentFaction(playerid)))
{
new ClosestTollObject = GetClosestTollObject(playerid);
new Float:X, Float:Y, Float:Z, Float:RX, Float:RY, Float:RZ;
GetDynamicObjectPos(ClosestTollObject, X, Y, Z);
GetDynamicObjectRot(ClosestTollObject, RX, RY, RZ);
MoveDynamicObject(ClosestTollObject, X, Y, Z, 1, RX, 0.0, RZ);

SendClientMessageEx(playerid, COLOR_YELLOW, "You have been let through the shutdown toll booth.");
SetTimerEx("ResetTollBoothObject", 5000, 0, "ii", playerid, ClosestTollObject);
PlayerInfo[playerid][pAtTollBooth] = 1;
SetTimerEx("ResetTollBoothMenu", 5000, 0, "i", playerid);
PlayerInfo[playerid][pAtTollBooth] = 1;
}
else if(TollShutdown == 1 && !IsAGovernmentFaction(playerid))
{
PlayerInfo[playerid][pAtTollBooth] = 1;
SendClientMessageEx(playerid, COLOR_GRAD2, " The Toll Booth has been shutdown by the Police, you are not allowed through at this time.");
SetTimerEx("ResetTollBoothMenu", 5000, 0, "i", playerid);
}
}
}
}
}

AND SO ON...!!!

Can you guys helping me to fix this error? Thanks.

Pottus
19/05/2015, 04:40 PM
What a fucking disaster this script must be, did you even include y_timers on this downloaded mode?

0B3Y
19/05/2015, 04:43 PM
What a fucking disaster this script must be, did you even include y_timers on this downloaded mode?

Yes... So, i need to remove the y_timers include?

sammp
19/05/2015, 04:47 PM
What a fucking disaster this script must be, did you even include y_timers on this downloaded mode?

I laughed at this and i have no idea why

Pottus
19/05/2015, 04:50 PM
I laughed at this and i have no idea why

It sums up the truth of how dog shit the issue is in terms of coding style and the fact it is just a downloaded script with some wannabe yuppie trying to use the script while also asserting a possible solution to the issue.

0B3Y
19/05/2015, 04:52 PM
Solved it, i was missing some brackets above those line.

sammp
19/05/2015, 05:05 PM
It sums up the truth of how dog shit the issue is in terms of coding style and the fact it is just a downloaded script with some wannabe yuppie trying to use the script while also asserting a possible solution to the issue.

True stuff. I'm getting tired of people doing this as well. Like, scripting help in my opinion is to just get a quick tip about how to do something, not rewriting an entire function that they probably didn't even write.

Pottus
19/05/2015, 05:15 PM
Well he was looking for a quick tip it would seem in this case but still I have the urge to shun against using downloaded scripts.