how to make your own player.YourOwnFunction = blah?

Started by Kewun, Sep 06, 2016, 05:55 PM

Previous topic - Next topic

Kewun

i want to create a fines limit

player.Fines = 5

but how do i create the .Fines thing?

array? please show me a example pls ;c

.

You cannot achieve this on the official plugin because the official plugin may create more than one instance of the internal Player class. Therefore, your member property will always start from the initial value. Which could lead to inconsistent behavior.

Please see this topic for more info.
.

Kewun

because i use ini and WriteIniInteger("stats.ini","playerfines", player.Name, +1 ) doesnt work

KAKAN

for adding a function
Use this: CPlayer::YourOwnFunction(){}
CPlayer is the player class.
For adding variables( can be used to add functions too ), use: CPlayer.rawnewmember("VarName",value);
I might be incorrect. I've not used them since many days :p
oh no

Kewun

Quote from: KAKAN on Sep 06, 2016, 05:58 PMfor adding a function
Use this: CPlayer::YourOwnFunction(){}
CPlayer is the player class.
For adding variables( can be used to add functions too ), use: CPlayer.rawnewmember("VarName",value);
I might be incorrect. I've not used them since many days :p
yeah, but after usign FindPlayer(0).Fines = 5 it doesnt set i t remains 0

.

Quote from: Kewun on Sep 06, 2016, 05:58 PMbecause i use ini and WriteIniInteger("stats.ini","playerfines", +1 ) doesnt work

Wait... what daf...
.

.

Quote from: KAKAN on Sep 06, 2016, 05:58 PMFor adding variables( can be used to add functions too ), use: CPlayer.rawnewmember("VarName",value);

Please read my initial post regarding member variables.
.


.

.

Kewun

so i will have use your squirrel plugin instead to make it work if i understand right? ok ill try then

.

Quote from: Kewun on Sep 06, 2016, 06:11 PMso i will have use your squirrel plugin instead to make it work if i understand right? ok ill try then

My advice? Don't! That plugin is not for your average vc:mp scripter. You need to be an experienced programmer to make use of it. Take that as a warning or as an advice. Your choice.
.


KAKAN

Quote from: . on Sep 06, 2016, 06:02 PM
Quote from: KAKAN on Sep 06, 2016, 05:58 PMFor adding variables( can be used to add functions too ), use: CPlayer.rawnewmember("VarName",value);

Please read my initial post regarding member variables.
It was working when I tried it last time.
http://pastebin.com/VznhwQrR
Take a look there, someone said that it was working fine.
oh no