player.Alpha again

Started by KAKAN, Oct 11, 2015, 06:04 PM

Previous topic - Next topic

KAKAN

So, what does the function player.Alpha does?
I need to use player.SetAlpha(0,0); instead of player.Alpha = 0;
If I use player.Alpha = 0; It prints out the error as:-
Member variable not found.I used Message(player.Alpha); but still the same(^^) error comes.

I want to know what does that player.Alpha do.
oh no

MacTavish

If player.Alpha is exists then its just a readonly function

onPlayerSpawn(player)
{
print(player.Alpha);
}

We can change alpha through player.SetAlpha as already discussed here

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

KAKAN

QuoteI used Message(player.Alpha); but still the same(^^) error comes.
Any Idea?
oh no

MacTavish

Quote from: KAKAN on Oct 12, 2015, 06:32 AM
QuoteI used Message(player.Alpha); but still the same(^^) error comes.
Any Idea?

You are returning integer in Message since it needs string/instance. Use

Message("alpha: "+player.Alpha);

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

EK.IceFlake

Make sure player isn't null
(player == null) ? Message("Unknown buddy") : Message(player.Alpha+"");

Thijn

Why all the concatenation with strings. What's wrong with a good old .tostring()?

EK.IceFlake

It exists? Because as far as I remember in the unofficial forum I asked why I got that error and it didn't exist.

KAKAN

Quote from: NE.CrystalBlue on Oct 13, 2015, 12:31 PMIt exists? Because as far as I remember in the unofficial forum I asked why I got that error and it didn't exist.
yea, it does. I use it in my script. Just forgot about it. :/
oh no