Author Topic: Syntax error?  (Read 819 times)

Error
Code: [Select]
Add-Ons/GameMode_CityRPG/common.cs Line: 21 - Syntax error.
>>> Some error context, with ## on sides of error halt:
// 7. Misc. stuff Functions

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



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

// Section 1 : Game CityRPG Functions

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



function ##C##ityRPG_AddDemerits(%blid, %demerits)

{

^%demerits = mFloor(%demerits);

^%currentDemerits = CityRPGData.getData(%blid).valueDemerits;

^%maxStars = CityRPG_GetMaxStars();

^

^CityRPGData.getData(%blid).valueDemerits += %demerits;

^

^if(CityRPGData.getData(%blid).valueDemerits >= $CityRPG::pref::demerits::demoteLevel && JobSO.job[CityRPGData.getData(%blid).valueJobID].law == true)
>>> Error report complete.
Code
Code: [Select]
function CityRPG_AddDemerits(%blid, %demerits)

Did you close the function with a "}"?

Did you close the function with a "}"?
Code: [Select]
function CityRPG_AddDemerits(%blid, %demerits)
{
%demerits = mFloor(%demerits);
%currentDemerits = CityRPGData.getData(%blid).valueDemerits;
%maxStars = CityRPG_GetMaxStars();

CityRPGData.getData(%blid).valueDemerits += %demerits;

if(CityRPGData.getData(%blid).valueDemerits >= $CityRPG::pref::demerits::demoteLevel && JobSO.job[CityRPGData.getData(%blid).valueJobID].law == true)
{
CityRPGData.getData(%blid).valueJobID = 1;
CityRPGData.getData(%blid).valueJailData = 1 SPC 0;

%client = findClientByBL_ID(%blid);

if(isObject(%client))
{
messageClient(%client, '', "\c6You have been demoted to" SPC CityRPG_DetectVowel(JobSO.job[1].name) SPC "\c3" @ JobSO.job[1].name @ "\c6.");

%client.setInfo();

if(isObject(%client.player))
{
serverCmdunUseTool(%client);

%client.player.giveDefaultEquipment();
}
}
}

if(%client = findClientByBL_ID(%blid))
{
%client.setInfo();

if(%client.getWantedLevel())
{
%ticks = %client.getWantedLevel();

if(%ticks > %maxStars)
{
if(%maxStars == 3 || %maxStars == 6)
messageAll('', '\c6Criminal \c3%1\c6 has obtained a level \c3%2\c6 wanted level. Police vehicles have upgraded.', %client.name, %ticks);
}
}
}
}

Have a look at whatever comes before it. If that doesn't help, post the whole script.

Have a look at whatever comes before it. If that doesn't help, post the whole script.
I was not even messing with these lines. I just tried ro rune the mod and i just keep getting this.