Question on behalf of Prototype

The time is right for a suicide!
User avatar
chin.democ.
chinny!
chinny!
Posts: 2823
Joined: 10 Aug 2006, 17:19
Location: London

Question on behalf of Prototype

Post 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
Kaiden
Virtue/4E
Virtue/4E
Posts: 466
Joined: 22 Mar 2006, 22:00

Re: Question on behalf of Prototype

Post by Kaiden »

I hate admin only guns :<
{E.D.H}{FPS}HDD21 wrote:I like ponies
<-(DD)->Darko wrote:HDD21 was brutally stronger than any of you
User avatar
[FGS]Kalman
Throne/6G
Throne/6G
Posts: 931
Joined: 20 Aug 2010, 15:52
Location: 9th circle of hell
Contact:

Re: Question on behalf of Prototype

Post by [FGS]Kalman »

Do Prototype wants a switch, which turns on only for admins?
Image
deadmau5 is Canada's apology for Justin Bieber!!
Image
User avatar
ProtoType
Angel/0A
Angel/0A
Posts: 15
Joined: 20 Jan 2012, 19:52

Re: Question on behalf of Prototype

Post 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'
User avatar
[FGS]Kalman
Throne/6G
Throne/6G
Posts: 931
Joined: 20 Aug 2010, 15:52
Location: 9th circle of hell
Contact:

Re: Question on behalf of Prototype

Post by [FGS]Kalman »

And do you want to kill, if he's not an admin?
Image
deadmau5 is Canada's apology for Justin Bieber!!
Image
User avatar
ProtoType
Angel/0A
Angel/0A
Posts: 15
Joined: 20 Jan 2012, 19:52

Re: Question on behalf of Prototype

Post by ProtoType »

just that it wil give the message
User avatar
~][FGS][Nobody~
Illuminated
Illuminated
Posts: 5348
Joined: 26 Oct 2005, 16:59
Location: Schland!

Re: Question on behalf of Prototype

Post 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.
Nobody is perfect...
-----------------------
ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
Magus wrote:Maybe one day I will understand your arcane rituals of voting :)
chin.democ. wrote:You can use light bulbs that emit light, and when shot, do not.
synthetic wrote:and while every person is interesting in their own unique ways, there is some degree of uniqueness that a doctor can help with.
~ô¿ô~][FGS][Nobody~ said: THERE IS NO SPOON!
~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
User avatar
Mastakilla
!Lysergsäurediethylamid!
!Lysergsäurediethylamid!
Posts: 1812
Joined: 27 Jan 2009, 21:01
Location: 'Ton Hotel

Re: Question on behalf of Prototype

Post 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.
Image
User avatar
Magus
THIS IS SPARTAAA!!!
THIS IS SPARTAAA!!!
Posts: 341
Joined: 27 Aug 2005, 15:41
Location: Manchester, England
Contact:

Re: Question on behalf of Prototype

Post 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 =(
-- Magus "There are 10 kinds of people in the world - those who understand binary, and those who don't"
Image
User avatar
Mastakilla
!Lysergsäurediethylamid!
!Lysergsäurediethylamid!
Posts: 1812
Joined: 27 Jan 2009, 21:01
Location: 'Ton Hotel

Re: Question on behalf of Prototype

Post 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
Image
User avatar
~][FGS][Nobody~
Illuminated
Illuminated
Posts: 5348
Joined: 26 Oct 2005, 16:59
Location: Schland!

Re: Question on behalf of Prototype

Post 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.
Nobody is perfect...
-----------------------
ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
Magus wrote:Maybe one day I will understand your arcane rituals of voting :)
chin.democ. wrote:You can use light bulbs that emit light, and when shot, do not.
synthetic wrote:and while every person is interesting in their own unique ways, there is some degree of uniqueness that a doctor can help with.
~ô¿ô~][FGS][Nobody~ said: THERE IS NO SPOON!
~¤¥ÐJ¥¤~ said: THERE IS NO CAKE!
User avatar
Mastakilla
!Lysergsäurediethylamid!
!Lysergsäurediethylamid!
Posts: 1812
Joined: 27 Jan 2009, 21:01
Location: 'Ton Hotel

Re: Question on behalf of Prototype

Post 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!
Image
User avatar
ShadowRunner
It's over 5000!
It's over 5000!
Posts: 6882
Joined: 28 Feb 2006, 21:07
Contact:

Re: Question on behalf of Prototype

Post 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.
User avatar
ProtoType
Angel/0A
Angel/0A
Posts: 15
Joined: 20 Jan 2012, 19:52

Re: Question on behalf of Prototype

Post 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
User avatar
[FGS]Kalman
Throne/6G
Throne/6G
Posts: 931
Joined: 20 Aug 2010, 15:52
Location: 9th circle of hell
Contact:

Re: Question on behalf of Prototype

Post by [FGS]Kalman »

Can you send me your skin mod?
Image
deadmau5 is Canada's apology for Justin Bieber!!
Image
Post Reply