Blockland Forums > Modification Help
Admin Only Vehicle
<< < (6/7) > >>
Headcrab Zombie:
No.

I believe onMount is called after the player is already mounted, it doesn't check before mounting. Thus, all you're doing with that is telling them that they're not supposed to be using the vehicle and not actually doing anything to get them off of it.

I still think packaging gettrustlevel or minigamecstar fishe would be the best way as it would prevent them from mounting in the first place. You use a centerprint with a different message (might need a small schedule) to replace the "Not in minigame" or "not enough trust"
thaky:
I tryed that and it still didn't work...
do i right teh script or get it?
howtoshotbillwetellyou:

--- Quote from: thaky on December 31, 2010, 02:47:30 PM ---I tryed that and it still didn't work...

--- End quote ---

i'm sure you didn't "try" it correctly, but keep trying we'll help you

edit: write it, we'll help
thaky:

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

there it is
Headcrab Zombie:

--- Code: ---package AdminVehicle
{
function getTrustLevel(%player,%obj)
{
%client = %player.client;
if(!%client.isAdmin && !%client.isSuperAdmin && %obj.getDatablock().getName() $= "JeepVehicle")
{
%client.schedule(25,centerPrint,"This vehicle is admin only!",3);
return 0;
}
else
Parent::getTrustLevel(%player,%obj);
}
};
ActivatePackage(AdminVehicle);
--- End code ---

Tested and it works, change JeepVehicle to the datablock name of your vehicle
Navigation
Message Index
Next page
Previous page

Go to full version