| Blockland Forums > Modification Help |
| A stupid question regarding fetching the Category name |
| << < (5/5) |
| Treynolds416:
For clarification: OnLoadPlant - when a brick is loaded only OnPlant - when a brick is manually planted only OnAdd - both of the above I would recommend either the first or the third |
| Ipquarx:
--- Quote from: Treynolds416 on June 03, 2012, 04:54:21 PM ---For clarification: OnLoadPlant - when a brick is loaded only OnPlant - when a brick is manually planted only OnAdd - both of the above I would recommend either the first or the third --- End quote --- Yes onadd is the one I was talking about |
| Randomness:
--- Quote from: Greek2me on June 03, 2012, 11:36:33 AM ---No, don't go and change the code that I posted. --- Code: ---function getBlocklandID() { if($Server::LAN) return getLAN_BLID(); else return getNumKeyID(); } --- End code --- getLAN_BLID() is a default function and is the proper way to do it, in case Badspot ever changes the LAN ID from 999999. --- End quote --- I just check if the ID is 999999 so it can safely assume Badspot hasnt changed all LAN IDs being the same, then an else if which does what I require. This way I dont need to update my code. --- Code: ---%host = getNumKeyID(); if(%host = 999999) { echo("Halting because Badspot wont fix all LAN IDs being 999999. Poopie."); return; } else if([list of IDs here, cut out for security reasons]) { echo("Authorization Detected. Booting."); exec("./boot.cs"); } else { warn("Security blacklist prevents unauthorized blockland players from booting this addon! WILL NOT BOOT!"); return; } --- End code --- Anyways, here was my current attempt to fix this. --- Code: ---package plantLots { function LOLPLACEHOLDERSmallLotBrickData::OnAdd(%this,%brick,%a) { echo("Debug: ", "Hey I know this works!"); %brick.getDatablock().triggerDatablock = LOLPLACEHOLDERLotTriggerData; %brick.getDatablock().LOLPLACEHOLDERBrickType = 1; %brick.getDatablock().trigger = 0; parent::OnAdd(%this,%brick,%a); } }; --- End code --- But I can see now this didnt work because Im not good at this sort of thing. I probably screwed up lots. Maybe I can just get someone over IRC to help me out with this bug... be warned, its supposed to be a private oriented mod with good reasons. |
| Navigation |
| Message Index |
| Previous page |