Blockland Forums > Modification Help
Blocking Item Spawning
otto-san:
It's possible, I'm sure.
I'm not sure where to direct you for an example, though.
Giovan:
I thought my code was an example. It doesn't work, though. Could you help me fix it?
Hint: I stole part of this from RP Content - Items cost money.
otto-san:
hm, let me make some adjustments then.
--- Code: ---package RP_Noitems {
function fxDtsBrick::spawnItem(%brick, %pos, %datablock, %client)
{
if(%client.isAdmin || %client.isSuperAdmin)
parent::spawnItem(%brick, %pos, %datablock, %client);
else
messageClient(%client, '', "\c6You cannot just spawn an item.");
}
};
activatePackage(RP_Noitems);
--- End code ---
Giovan:
I just remembered something. When you spawn an item, and pick it up, it goes away forever. Maybe Iban is already hijacking the item script?
Iban:
You are a complete and total loving moron.
There are no other crazy hacks or exceptions in CityRPG v3's code that disable item spawning because I am not a god damn idiot and do not run add-ons that are exploitable.
Unregistering events that people need not be using is the best solution to this problem for your scenario. Admins do not need to be excluded because admins can spawn items at their own leisure.