Is there some kind of trick to place variables inside CPlayer class?

Started by EK.IceFlake, Apr 13, 2015, 05:40 AM

Previous topic - Next topic

EK.IceFlake

Hi guys!
I wanna know if it is possible to add variables inside player class without using global variables. What I mean is something like this:
function CPlayer::InitLittleDudes()
{
    public AdminLevel;
}
then able to use
player.AdminLevelThe code above was just an example since afaik public doesnt exist in squirrel. Again, I do not want to use something like
function CPlayer::InitLittleDudes()
{
    AdminLevel <- null;
}
Thanks!

DizzasTeR

Class members can be used anywhere no? So why are you doing

AdminLevel <- null;
just use

AdminLevel = null;
and then later on assign it whatever you want.

[ Atleast that's what I understood what you are trying to do. ]

EK.IceFlake

Quote from: Doom_Killer on Apr 13, 2015, 05:46 AMClass members can be used anywhere no? So why are you doing

AdminLevel <- null;
just use

AdminLevel = null;
and then later on assign it whatever you want.

[ Atleast that's what I understood what you are trying to do. ]
Ok ill try that... but remember, im adding that from inside a function in the class since I dont have full access to that class.


EK.IceFlake

Quote from: Gudio on Apr 13, 2015, 06:49 AMClick me.
Use next time...
I knew that way and even used it, but I dont like having to use a "()" after something like MyInfo

Thijn


.

Quote from: NE.CrystalBlue on Apr 13, 2015, 05:40 AMI wanna know if it is possible to add variables inside player class without using global variables. What I mean is something like this:

I've been working on something like that my self. Perhaps the devs could port the code from my repository to add this feature:

It's a very important feature and to be honest I can see tons of uses for something like this.
.