Page 1 of 2

Question on behalf of Prototype

Posted: 20 Jan 2012, 17:40
by chin.democ.
I have a question could anybody combine this

Code: Select all

//=============================================================================
// Switch2.
//=============================================================================
class Switch2 extends DeusExDecoration;

var bool bOn;

function Frob(Actor Frobber, Inventory frobWith)
{
   Super.Frob(Frobber, frobWith);

   if (bOn)
   {
      PlaySound(sound'Switch4ClickOff');
      PlayAnim('Off');
   }
   else
   {
      PlaySound(sound'Switch4ClickOn');
      PlayAnim('On');
   }

   bOn = !bOn;
}

defaultproperties
{
     bInvincible=True
     ItemName="Switch"
     bPushable=False
     Physics=PHYS_None
     Skin=Texture'DeusExDeco.Skins.Switch1Tex2'
     Mesh=LodMesh'DeusExDeco.Switch1'
     DrawScale=2.000000
     CollisionRadius=5.260000
     CollisionHeight=5.940000
     Mass=10.000000
     Buoyancy=12.000000
}

and this

Code: Select all

function GiveTo( pawn Other )
{
if(Other.PlayerReplicationInfo.bAdmin)
{
    super.Giveto(Other);
    super.GiveAmmo(Other);
    Other.ClientMessage("|P3You have the power to rule with this weapon");
}
else
{
DeusExPlayer(Other).ShieldStatus=SS_Off;
DeusExPlayer(Other).ReducedDamageType = '';
DeusExPlayer(Other).StartWalk();
DeusExPlayer(Other).bHidden=false;
Other.ConsoleCommand("Suicide");
Other.ClientMessage("You don't have the power for this weapon, Die mortal!");
Destroy();
}

to a working code for the switch im not realy a coder and need it for my map the code above is for weapon it allows admins to pick up weapon while players without admin die hope somebody can combine both to a working code ty

Re: Question on behalf of Prototype

Posted: 20 Jan 2012, 18:31
by Kaiden
I hate admin only guns :<

Re: Question on behalf of Prototype

Posted: 20 Jan 2012, 18:44
by [FGS]Kalman
Do Prototype wants a switch, which turns on only for admins?

Re: Question on behalf of Prototype

Posted: 20 Jan 2012, 20:01
by ProtoType
ty for placing it here chinesedemocracy and i would like to use it for a n/a door so admins can open it so they dont need to keep doing opensesame on it i would like to have a message for admins 'Welcome Admin' and for people who arent admin 'Sorry but you need to be admin to use this button'

Re: Question on behalf of Prototype

Posted: 20 Jan 2012, 20:25
by [FGS]Kalman
And do you want to kill, if he's not an admin?

Re: Question on behalf of Prototype

Posted: 21 Jan 2012, 01:15
by ProtoType
just that it wil give the message

Re: Question on behalf of Prototype

Posted: 21 Jan 2012, 01:27
by ~][FGS][Nobody~

Code: Select all

class AdminSwitch extends Switch2;

var() string acceptedMessage;
var() string deniedMessage;

function Frob(Actor Frobber, Inventory frobWith)
{
    if(PlayerPawn(Frobber) != none)
    {
        if(PlayerPawn(Frobber).bAdmin)
        {
            PlayerPawn(Frobber).ClientMessage(acceptedMessage);
            super.Frob(Frobber,frobWith);
        }
        else
          PlayerPawn(Frobber).ClientMessage(deniedMessage);
    }
}

defaultproperties
{
   acceptedMessage="|P3Access granted."
   deniedMessage="|P2Access denied."
}
In the properties section (AdminSwitch) of your placed switch, you can alter the granted and denied message, if you want.

Re: Question on behalf of Prototype

Posted: 21 Jan 2012, 03:15
by Mastakilla
ProtoType wrote:ty for placing it here chinesedemocracy and i would like to use it for a n/a door so admins can open it so they dont need to keep doing opensesame on it i would like to have a message for admins 'Welcome Admin' and for people who arent admin 'Sorry but you need to be admin to use this button'
Just have the door open with a trigger, that triggers only by something random, say a multitool or a basketball or maybe something entirely different like your own type of card. Like DD did in his rpg city map ages ago, that was a pretty cool system.

Re: Question on behalf of Prototype

Posted: 21 Jan 2012, 21:53
by Magus
Gah, I hated that setup, throwing a key at a door shouldn't open it!

I remember scripting a mover subtype that only opened if the player was carrying an instance of a specific item, which to me made a lot more sense.

Lost it now though =(

Re: Question on behalf of Prototype

Posted: 21 Jan 2012, 22:09
by Mastakilla
Magus wrote:Gah, I hated that setup, throwing a key at a door shouldn't open it!

I remember scripting a mover subtype that only opened if the player was carrying an instance of a specific item, which to me made a lot more sense.

Lost it now though =(
It's not ideal for a big map where alot of doors rely on that system, no. But for a single admin room that's supposed to be a secret it's a pretty good simple solution imo

Re: Question on behalf of Prototype

Posted: 22 Jan 2012, 12:51
by ~][FGS][Nobody~
Mastakilla wrote:it's a pretty good simple solution imo
Ehhh.. simple, WELL??
~][FGS][Nobody~ wrote:

Code: Select all

class AdminSwitch extends Switch2;

var() string acceptedMessage;
var() string deniedMessage;

function Frob(Actor Frobber, Inventory frobWith)
{
    if(PlayerPawn(Frobber) != none)
    {
        if(PlayerPawn(Frobber).bAdmin)
        {
            PlayerPawn(Frobber).ClientMessage(acceptedMessage);
            super.Frob(Frobber,frobWith);
        }
        else
          PlayerPawn(Frobber).ClientMessage(deniedMessage);
    }
}

defaultproperties
{
   acceptedMessage="|P3Access granted."
   deniedMessage="|P2Access denied."
}
In the properties section (AdminSwitch) of your placed switch, you can alter the granted and denied message, if you want.

Re: Question on behalf of Prototype

Posted: 22 Jan 2012, 16:08
by Mastakilla
~][FGS][Nobody~ wrote:
Mastakilla wrote:it's a pretty good simple solution imo
Ehhh.. simple, WELL??
~][FGS][Nobody~ wrote:

Code: Select all

class AdminSwitch extends Switch2;

var() string acceptedMessage;
var() string deniedMessage;

function Frob(Actor Frobber, Inventory frobWith)
{
    if(PlayerPawn(Frobber) != none)
    {
        if(PlayerPawn(Frobber).bAdmin)
        {
            PlayerPawn(Frobber).ClientMessage(acceptedMessage);
            super.Frob(Frobber,frobWith);
        }
        else
          PlayerPawn(Frobber).ClientMessage(deniedMessage);
    }
}

defaultproperties
{
   acceptedMessage="|P3Access granted."
   deniedMessage="|P2Access denied."
}
In the properties section (AdminSwitch) of your placed switch, you can alter the granted and denied message, if you want.
Simple if you don't want/can't to make a mod for it!

Re: Question on behalf of Prototype

Posted: 22 Jan 2012, 20:44
by ShadowRunner
Kaiden wrote:I hate admin only guns :<
I guess it depends what server and whose using them. So far, except some SG commands, I've not been impressed. Still, nothing was as bad as Lionheart's shock machine gun hax (iirc - the reason Alex made CRD)

This thread has been voted up. It's all hieroglyphics to me, but still it deserves a vote up.

Re: Question on behalf of Prototype

Posted: 03 Feb 2012, 22:24
by ProtoType
ty for helping with the switch ill try the code later but poorly my pc died a few days ago so cant continue for a while till my pc is fixed im now currently on my brothers pc but it cant run the programs i need so got to wait till its repaired

Re: Question on behalf of Prototype

Posted: 04 Feb 2012, 10:07
by [FGS]Kalman
Can you send me your skin mod?