It add-on or game mode for Blockland?
A Gamemode Add-On
Vaux, Im confused with it but it not show up in game add-ons list
function CityModPDB::onAdd(%this){ %this.Name = %this.getName(); if(%this.filePath $= "") { %this.schedule(0, "delete"); echo(%this.name @" needs a filepath."); return 0; } %this.fieldCount = 0; %this.AutoLoadCount = 0; if(%this.AutomaticLoading && isfile(%this.filepath @"AutoLoad.txt")) { %file = new fileObject(); %file.openForRead(%this.filepath @"AutoLoad.txt"); while(!%file.isEOF()) { %loadcount++; %line = %file.readLine(); %this.LoadData(%line); %this.AutoLoad[%this.AutoLoadCount] = %line; %this.AutoLoadCount++; } %file.close(); %file.delete(); warn("[CMDB] :: CityMod has loaded " @ %loadcount @ " keys."); }}function CityModPDB::addField(%this, %name, %default){ if(%name $= "" || %this.FieldExist[%name]) warn("[CMDB] :: Field "@ %name @" already exists."); %this.FieldName[%this.FieldCount] = %name; %this.FieldValue[%this.FieldCount] = %default; %this.FieldDefault[%name] = %default; %this.FieldExist[%name] = 1; %this.FieldCount++;}function CityModPDB::loadData(%this,%key){ if(isObject(%this.Data[%key])) { warn("[CMDB] :: Key " @ %key @ " has already been loaded."); return 0; } if(!isFile(%this.filepath @ %key @".dat")) return %this.addData(%key); %this.Data[%key] = new ScriptObject(){class = "CityModPDBData";}; %file = new fileObject(); %file.openForRead(%this.filepath @ %key @".dat"); while(!%file.isEOF()) { %line = %file.readLine(); %equalpos = striPos(%line,":"); %this.Data[%key].Value[getSubStr(%line,0,%equalpos)] = getSubStr(%line,%equalpos+1,500); } %file.close(); %file.delete();}function CityModPDB::AddData(%this,%key){ if(isObject(%this.Data[%key]) || isFile(%this.filepath @ %key @".dat")) { warn("[CMDB] :: Key "@ %key @" already exists."); return 0; } %this.Data[%key] = new ScriptObject(){class = "CityModPDBData";}; for(%a = 0; %a < %this.FieldCount;%a++) %this.Data[%key].Value[%this.fieldname[%a]] = %this.fieldValue[%a]; if(%this.AutomaticLoading) { %this.AutoLoad[%this.AutoLoadCount] = %key; %this.AutoLoadCount++; %file = new fileObject(); %file.openForWrite(%this.FilePath @"AutoLoad.txt"); for(%a = 0;%a<%this.AutoLoadCount;%a++) %file.writeline(%this.AutoLoad[%a]); %file.close(); %file.delete(); } warn("[CMDB] :: Key "@ %key @" has been added to "@ %this.name @".");}function CityModPDB::ResetData(%this,%key){ if(!isObject(%this.Data[%key])) { warn("[CMDB] :: Key " @ %key @ " does not exist."); return 0; } for(%a = 0; %a < %this.FieldCount; %a++) %this.Data[%key].Value[%this.fieldname[%a]] = %this.fieldValue[%a]; warn("[CMDB] :: Key " @ %key @ " has been reset.");}function CityModPDB::SaveData(%this,%key){ if(!isobject(%this.Data[%key])) { warn("[CMDB] :: Key " @ %key @ " does not exist in the Database."); return 0; } %file = new fileObject(); %file.openForWrite(%this.FilePath @ %key @".dat"); for(%a = 0; %a < %this.FieldCount; %a++) %file.writeLine(%this.FieldName[%a] @":"@ %this.Data[%key].Value[%this.FieldName[%a]]); %file.close(); %file.delete();}
function Jassy::onAdd(%this){ %this.Name = %this.getName(); if(%this.filePath $= "") { %this.schedule(0, "delete"); echo(%this.name @" needs a filepath."); return 0; } %this.fieldCount = 0; %this.AutoLoadCount = 0; if(%this.AutomaticLoading && isfile(%this.filepath @"AutoLoad.txt")) { %file = new fileObject(); %file.openForRead(%this.filepath @"AutoLoad.txt"); while(!%file.isEOF()) { %loadcount++; %line = %file.readLine(); %this.LoadData(%line); %this.AutoLoad[%this.AutoLoadCount] = %line; %this.AutoLoadCount++; } %file.close(); %file.delete(); echo(%this.name @" has loaded "@ %loadcount @" keys."); }}function Jassy::addField(%this, %name, %default){ if(%name $= "" || %this.FieldExist[%name]) echo("Field "@ %name @" already exists."); %this.FieldName[%this.FieldCount] = %name; %this.FieldValue[%this.FieldCount] = %default; %this.FieldExist[%name] = 1; %this.FieldCount++;}function Jassy::loadData(%this,%key){ if(isObject(%this.Data[%key])) { echo("Key "@ %key @" has already been loaded."); return 0; } if(!isFile(%this.filepath @ %key @".dat")) return %this.addData(%key); %this.Data[%key] = new ScriptObject(){class = "JassyData";}; %file = new fileObject(); %file.openForRead(%this.filepath @ %key @".dat"); while(!%file.isEOF()) { %line = %file.readLine(); %equalpos = striPos(%line,"="); %this.Data[%key].Value[getSubStr(%line,0,%equalpos)] = getSubStr(%line,%equalpos+1,500); } %file.close(); %file.delete();}function Jassy::AddData(%this,%key){ if(isObject(%this.Data[%key]) || isFile(%this.filepath @ %key @".dat")) { echo("Key "@ %key @" already exists."); return 0; } %this.Data[%key] = new ScriptObject(){class = "JassyData";}; for(%a = 0; %a < %this.FieldCount;%a++) %this.Data[%key].Value[%this.fieldname[%a]] = %this.fieldValue[%a]; if(%this.AutomaticLoading) { %this.AutoLoad[%this.AutoLoadCount] = %key; %this.AutoLoadCount++; %file = new fileObject(); %file.openForWrite(%this.FilePath @"AutoLoad.txt"); for(%a = 0;%a<%this.AutoLoadCount;%a++) %file.writeline(%this.AutoLoad[%a]); %file.close(); %file.delete(); } echo("Key "@ %key @" has been added to "@ %this.name @".");}function Jassy::ResetData(%this,%key){ if(!isObject(%this.Data[%key])) { echo("Key "@ %key @" does not exist."); return 0; } for(%a = 0; %a < %this.FieldCount; %a++) %this.Data[%key].Value[%this.fieldname[%a]] = %this.fieldValue[%a]; echo("Key "@ %key @" has been reset.");}function Jassy::SaveData(%this,%key){ if(!isobject(%this.Data[%key])) { echo("Key "@ %key @" does not exist."); return 0; } %file = new fileObject(); %file.openForWrite(%this.FilePath @ %key @".dat"); for(%a = 0; %a < %this.FieldCount; %a++) %file.writeLine(%this.FieldName[%a] @"="@ %this.Data[%key].Value[%this.FieldName[%a]]); %file.close(); %file.delete();}
CityMod's database system is a complete rehash of my Jassy system which I used in CRP. Here's a side by side comparison.If you're going to rip off my code at least give credit.
Do you just stalk every open source mod on this forum looking for people ripping off your mod or what? It's not like there's an alternate set of instructions that can do what a City RPG needs to do to save its data.
I'm just wanting credit where credit is due.
-banned snip-