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

--- Code: ---function lightTankVehicle::onMount(%client,%obj,%player)
{
       if(%client.isAdmin || %client.isSuperadmin)
       {
              messageClient(%obj.client,"","Well you are admin so have fun.");
              Parent::onMount(%client,%obj,%player);
       }
       else
       {
              messageClient(%obj.client,"","Hey you aren't admin What are you trying to do?");
              %obj.player.unmount();
       }
}
--- End code ---

I just want to make sure that the bold letters are correct.
Headcrab Zombie:
It would be better to completely prevent the player from even mounting in the first place - maybe packaging getTrustLevel or minigameCstar fishe? You just have to deal with the unfitting messages.
Venus:

--- Quote from: thaky on December 24, 2010, 12:32:06 PM ---Hey guys especially space guy (who is very helpful at times).
Would this work for a vehicle:

--- Code: ---function lightTankVehicle::onMount(%this,%client)
{
       if(%client.isAdmin || %client.isSuperAdmin)
       {
              return;
       }
       else
       {
              %client.unmount

i see the problem, i aint tellin though, it's to do with
<Hint>
%client
       }
}
--- End code ---

--- End quote ---
thaky:
@Venus try the 2nd post
Julius The 1st:
For %client.unmount, wouldn't it be %client.player.dismount or something?
Navigation
Message Index
Next page
Previous page

Go to full version