Pinfo Class

Started by FarisDon, Oct 02, 2015, 06:23 PM

Previous topic - Next topic

FarisDon

Well i made a function with timer including with pinfo class! So when i joined the server, and begin to test it, so it was working fine, and, so i just quit, and, i forgot to see something in server, so i went again plus when i went the timer was opened with the same ID as mine ._. and it was showing me!!!! OMG!, so is their any other thing i missed while scripting ? basically in player part, do i need to remove the pinfo[player.ID] :( ?and if yes, so how?
P.S: Sorry, for my bad english...

MatheuS

pinfo[player.ID] = null; ???
if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.

FarisDon

Quote from: MatheuS on Oct 02, 2015, 06:44 PMpinfo[player.ID] = null; ???
okay, but that's why it was showing the timer function to the same Id,  of other person, so i've to remove that in player part right?
P.s i'm from mob sorry for my more worst english.

Xmair

I don't get you from your english but I think you want this.
function onPlayerJoin(player)
{
mytimer <- NewTimer("abc",50000,1)
}
function onPlayerPart(player)
{
mytimer.Delete();
}
Untested.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

FarisDon

#4
Nope, but i mean that! Is it needed to remove player from player part function in of pinfo class?

Xmair

pinfo[player.ID]=null;
//This isn't a must.
//But you must save the stats.
//Like you attached an array to the database.
//You must do QuerySQL(yourdbname,"UPDATE yourtable SET wotever='" pinfo[player.ID].arraywotever "'");
Untested.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

KAKAN

Put this on onPlayerPart xD
KickPlayer(player);Now remove part messages from server.conf
And make a function for it.
oh no

Xmair

This isn't a place to spam jokes, @KAKAN .

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

KAKAN

1st of all This isn't even a joke
My way was:-
Put that on onPlayerPart, set partmessages to false in server.conf(or wherever you use)
Now create your own function and name the kick to disconnected.
Simple as that.
BUT remember it would affect your kick cmd
oh no

EK.IceFlake

What will happen if you kick the player when he is leaving? That might prevent reconnecting for death evade. Might.

Thijn

I don't get what kicking a player when he leaves has to do with a timer that keeps running?