Author Topic: Admin only vehicle  (Read 740 times)

Im trying to make an Admin  only vehicle. Im hoping that someone can help me with the script. So far this tells the vehicle to shoot when triggered. I need the trigger to be Admins only but I dont know how to do it. So you can still drive the vehicle but not use the funtion.

Code: [Select]
package Bulldozerguns
{

    function armor::ontrigger(%this,%obj,%slot,%state)
    {
        %obj.trigger[%slot]=%state;
        parent::ontrigger(%this,%obj,%slot,%state);
        %vehicle=%obj.getobjectmount();
        if(%slot==0&&%state==1)
        {
            if(isobject(%vehicle))
            {
                if(%vehicle.getdatablock()==nametoid(BulldozerVehicle))
                {
                    cancel(%vehicle.event);
                    Bulldozerfire(%obj.client,%vehicle);
                }
            }
        }
    }
};
activatePackage(Bulldozerguns);


Code: [Select]
        if( %slot == 0 && %state == 1 )
        {
            if( isObject(%vehicle) && (%obj.client.isAdmin || %obj.client.isSuperAdmin) )
            ...

Thanks. Now the only problem is that I cant host to test this out.