Need help with a script

Author Topic: Need help with a script  (Read 1760 times)

function SodacanImage::onFire(%this,%obj,%slot)
{
        (%obj.client);
        %obj.setDatablock(FastPlayer);

}


What else do I have do I have to put ? I am sure I am missing some thing but what ? ( This is for my rp server, I am just adding every day items)

I am very new to coding :P
« Last Edit: June 21, 2008, 12:30:37 AM by chaseyqurt »

you don't need the (%obj.client);
and I *THINK* you need to reset the appearance after changing the datablock.

How would I go about doing this ? ( Again I am very new to coding)

Edit: It works in game but it can't locate the Player DataBlock  here all the functions.


function SodaCanImage::onDone(%this,%obj,%slot)
{
   %obj.unMountImage(%slot);
}

function SodacanImage::onFire(%this,%obj,%slot)
{
        %obj.setDatablock(FastPlayer);
}

datablock PlayerData(PlayerFastPlayer : PlayerStandardArmor)
{
        maxForwardSpeed = 15;
        maxBackwardSpeed = 15;
        maxSideSpeed = 15;
 
        maxForwardCrouchSpeed = 13;
        maxBackwardCrouchSpeed = 13;
        maxSideCrouchSpeed = 13;
        canJet = 0;
        uiName = "FastPlayer";
};
« Last Edit: June 21, 2008, 12:49:05 AM by chaseyqurt »

Your datablock is named playerfastplayer, but you are trying to find the datablock: FastPlayer. Change them to make them match like below:
Code: [Select]
function SodaCanImage::onDone(%this,%obj,%slot)
{
   %obj.unMountImage(%slot);
}

function SodacanImage::onFire(%this,%obj,%slot)
{
        %obj.setDatablock(FastPlayer);
}

datablock PlayerData(FastPlayer : PlayerStandardArmor)
{
        maxForwardSpeed = 15;
        maxBackwardSpeed = 15;
        maxSideSpeed = 15;

        maxForwardCrouchSpeed = 13;
        maxBackwardCrouchSpeed = 13;
        maxSideCrouchSpeed = 13;
        canJet = 0;
        uiName = "FastPlayer";
};

Thanks Bling.

Edit: stuff it turns you into a DoomBot (Player with some thing done to the nodes) I need help to make it set the player model back.
« Last Edit: June 21, 2008, 01:03:34 AM by chaseyqurt »

Here ya go for Chasey and anyone whos been having trouble with doombot.
Code: [Select]
function SodacanImage::onFire(%this,%obj,%slot)
{
        FastDatablock(%obj.client);
}

function FastDatablock(%this)
{
%this.headcolor2 = %this.headColor;
%this.hatColor2 = %this.hatColor;
%this.accentColor2 = %this.accentColor;
%this.chestColor2 = %this.chestColor;
%this.hipColor2 = %this.hipColor;
%this.larmColor2 = %this.larmColor;
%this.lhandColor2 = %this.lhandColor;
%this.llegColor2 = %this.llegColor;
%this.rarmColor2 = %this.rarmColor;
%this.rhandColor2 = %this.rhandColor;
%this.rlegColor2 = %this.rlegColor;
%this.decalName2 = %this.decalName;
%this.player.setDecalName(%this.decalName);
%this.player.setDataBlock("FastPlayer");
%this.headcolor = %this.headColor2;
%this.hatColor = %this.hatColor2;
%this.accentColor = %this.accentColor2;
%this.chestColor = %this.chestColor2;
%this.hipColor = %this.hipColor2;
%this.larmColor = %this.larmColor2;
%this.lhandColor = %this.lhandColor2;
%this.llegColor = %this.llegColor2;
%this.rarmColor = %this.rarmColor2;
%this.rhandColor = %this.rhandColor2;
%this.rlegColor = %this.rlegColor2;
%this.decalName = %this.decalName2;
%this.applyBodyColors();
%this.applyBodyParts();
}

datablock PlayerData(FastPlayer : PlayerStandardArmor)
{
        maxForwardSpeed = 15;
        maxBackwardSpeed = 15;
        maxSideSpeed = 15;

        maxForwardCrouchSpeed = 13;
        maxBackwardCrouchSpeed = 13;
        maxSideCrouchSpeed = 13;
        canJet = 0;
        uiName = "FastPlayer";
};

1. You need to get the colors on the player.
2. Set the datablock.
3. Reset the colors to the ones you got.
4. ???
5. Profit.

I know not how to do that :P I also can't get it to leave your invintory after being used.


Oh yeah I remeber that :P

Well is that it? I'm bored and need someone to help :P

Nope, I still have no idea how to do your 5 steps to profiting. (If you) Come to mah server and you can help me with other stuff.

Code: [Select]
function SodacanImage::onFire(%this,%obj,%slot)
{
        if(isObject(%obj.client))
        {
                %obj.setDatablock(FastPlayer);
                applyCharacterPrefs(%obj.client)
        }
}

Wow, didn't know that function existed. What's your secret Ephialtes: how do you find these functions?

Thanks for rendering all my stuff useless :D

Wow, didn't know that function existed. What's your secret Ephialtes: how do you find these functions?

I was born with the knowledge to do what I do.