Blockland Forums > Modification Help
Admin Only Vehicle
<< < (5/7) > >>
thaky:

--- Quote from: SkullCandy on December 29, 2010, 07:34:02 PM ---
--- Code: ---function lightTankVehicle::onMount(%client,%obj,%player) {
       if(!isObject(%client = %mnt))
              return;
       if(%client.isAdmin || %client.isSuperAdmin)
              Parent::onMount(%client,%obj,%player);
       else
              commandToClient(%client,'centerPrint',"This vehicle is admin-only.",2);
}

--- End code ---

--- End quote ---

instead of parent:: can i use return::
howtoshotbillwetellyou:

--- Quote from: thaky on December 31, 2010, 01:37:23 PM ---instead of parent:: can i use return::

--- End quote ---

Why would you do that, parent works just fine.
thaky:

--- Code: ---package Light_Tank
{
function lightTankVehicle::onMount(%this,%obj,%player)
{
if(%obj.client.isAdmin || %obj.client.isSuperAdmin)
{
Parent::onMount(%this,%obj,%player);
}
else
{
commandToClient(%obj.client,'centerPrint',"\c6This vehicle is admin-only.",2);
}
}
};
ActivatePackage(Light_Tank);
--- End code ---

would this work?
howtoshotbillwetellyou:
i think, %obj.client needs to be changed to %player.client
thaky:
ok..
Navigation
Message Index
Next page
Previous page

Go to full version