Blockland Forums > Modification Help
Blocking Item Spawning
(1/6) > >>
Giovan:
Can someone explain why this doesn't work?


--- Code: ---package RP_Noitems {
  
  function fxDtsBrick::spawnItem(%brick, %pos, %datablock, %client)
{
  if(!isObject(%datablock)) {
     parent::spawnItem(%brick, %pos, %datablock, %client);
     return;
    }
     messageClient(%client, '', "\c6You cannot just spawn an item.");
     return;
}
  
};

activatePackage(RP_Noitems);
--- End code ---

This is at the very end I put this at the end of the server.cs of Iban's CityRPG.
Iban:
I did not write whatever the forget that is supposed to be. People need to stop adding stuff to CityRPG and leaking it all over the place, I get mis-credited with god awful code.

Source: GameMode_CityRPG/server.cs

--- Code: ---// Banned Events
unRegisterOutputEvent("fxDTSBrick", "RadiusImpulse");
unRegisterOutputEvent("fxDTSBrick", "SetItem");
unRegisterOutputEvent("fxDTSBrick", "SetItemDirection");
unRegisterOutputEvent("fxDTSBrick", "SetItemPosition");
unRegisterOutputEvent("fxDTSBrick", "SetVehicle");
unRegisterOutputEvent("fxDTSBrick", "SpawnExplosion");
unRegisterOutputEvent("fxDTSBrick", "SpawnItem");
unRegisterOutputEvent("fxDTSBrick", "SpawnProjectile");

unRegisterOutputEvent("Player", "AddHealth");
unRegisterOutputEvent("Player", "AddVelocity");
unRegisterOutputEvent("Player", "BurnPlayer");
unRegisterOutputEvent("Player", "ChangeDatablock");
unRegisterOutputEvent("Player", "ClearBurn");
unRegisterOutputEvent("Player", "ClearTools");
unRegisterOutputEvent("Player", "Dismount");
unRegisterOutputEvent("Player", "InstantRespawn");
unRegisterOutputEvent("Player", "Kill");
unRegisterOutputEvent("Player", "SetHealth");
unRegisterOutputEvent("Player", "SetPlayerScale");
unRegisterOutputEvent("Player", "SetVelocity");
unRegisterOutputEvent("Player", "SpawnExplosion");
unRegisterOutputEvent("Player", "SpawnProjectile");

unRegisterOutputEvent("GameConnection", "IncScore");
unRegisterOutputEvent("GameConnection", "ChatMessage");

unRegisterOutputEvent("MiniGame", "BottomPrintAll");
unRegisterOutputEvent("MiniGame", "CenterPrintAll");
unRegisterOutputEvent("MiniGame", "ChatMsgAll");
unRegisterOutputEvent("MiniGame", "Reset");
unRegisterOutputEvent("MiniGame", "RespawnAll");

--- End code ---
otto-san:

--- Quote from: Iban on April 09, 2011, 09:12:00 PM ---I did not write whatever the forget that is supposed to be. People need to stop adding stuff to CityRPG and leaking it all over the place, I get mis-credited with god awful code.

--- End quote ---
i know right


make your own if you want to script a cityRPG so badly.

Anyways, is unRegisterOutputEvent a real function?

I never knew about it.  :cookieMonster:
Kalphiter:

--- Quote from: otto-san on April 09, 2011, 09:15:58 PM ---i know right


make your own if you want to script a cityRPG so badly.

Anyways, is unRegisterOutputEvent a real function?

I never knew about it.  :cookieMonster:

--- End quote ---

--- Code: ---   virtual Script unRegisterOutputEvent() {}
   virtual Script registerOutputEvent() {}

--- End code ---
Yep.
Iban:
No, I just made it up off the top of my head and it worked.
Navigation
Message Index
Next page

Go to full version