Blockland Forums > Modification Help

Admin Only Vehicle

Pages: << < (3/7) > >>

Bauklotz:


--- Code: ---function lightTankVehicle::onMount(%this,%obj,%mnt) {
       if(!isObject(%cl = %mnt.client))
              return;
       if(%cl.isAdmin || %c.isSuperAdmin)
              Parent::onMount(%this,%obj,%mnt);
       else
              commandToClient(%mnt.client,'centerPrint',"This vehicle is admin-only.",2);
}

--- End code ---

In a package, of course.

SkullCandy:


--- Quote from: Bauklotz on December 29, 2010, 03:13:56 PM ---
--- Code: ---function lightTankVehicle::onMount(%this,%obj,%mnt) {
       if(!isObject(%cl = %mnt.client))
              return;
       if(%cl.isAdmin || %c.isSuperAdmin)
              Parent::onMount(%this,%obj,%mnt);
       else
              commandToClient(%mnt.client,'centerPrint',"This vehicle is admin-only.",2);
}

--- End code ---

In a package, of course.

--- End quote ---
I thought it was
--- 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 ---


thaky:

thanks skull

SkullCandy:


--- Quote from: thaky on December 29, 2010, 10:08:30 PM ---thanks skull

--- End quote ---
thank bauklotz, I might be wrong. Try mine


Bauklotz:


--- 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 ---

Look at the logic there. Can't you see that %client is going to be the vehicle DATABLOCK?
"lightTankVehicle".

Pages: << < (3/7) > >>

Go to full version