| Blockland Forums > Modification Help |
| Calling vars when bricks are planted |
| (1/2) > >> |
| Android:
I am having trouble about how to go about integrating variables for the client when a brick a placed i want to know what the function will be so for example When they place a specific brick. In this case when they place a lumbermill brick %Client.LMCount++; So next time i can call a function that acts as a resource up for the entire server %Client.Wood += %Client.LMCount * %Client.LMBonus I also want to know how do i set varables for a player when they spawn since i cant get access to the server files. |
| CityRPG:
I could tell you, but no thanks. Do this: 1. Go in game with no add-ons enabled. 2. Open console, submit trace(1); 3. Close console. 4. Plant a brick. 5. Open console. 6. trace(0); 7. Examine the spam that was output. 8. Find the function yourself. It's somewhere in there. |
| Nexus:
I'll be a little more help than Iban and tell you that you will need a package in order to detect when functions are called to do something else. package mypackage { function myfunction(%vars) { parent::myfunction(%vars); //Now that you know the function has been called, what will happen? } }; activatepackage(mypackage); |
| Swollow:
all bricks --- Code: ---function fxDTSBrickData::onPlant(%this) --- End code --- certain bricks --- Code: ---function BRICKNAMEHERE:onPlant(%this) --- End code --- |
| Android:
--- Code: --- function fxDtsBrick::onPlant(%data,%brick) { if(%brick.getDatablock().ChosenResource $= "Wood") { %brick.setColor("50"); MessageAll('',"An Lumbermill has been constructed!"); } if(%brick.getDatablock().ChosenResource $= "Iron") { %brick.setColor("48"); MessageAll('',"An Iron Mine has been constructed!"); } } --- End code --- This is where I got up to I'm just trying to increment a client variable from there now. Would i need to find the client by using something like FindClientByID? |
| Navigation |
| Message Index |
| Next page |