Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: FarisDon on Oct 02, 2015, 06:23 PM

Title: Pinfo Class
Post by: FarisDon on Oct 02, 2015, 06:23 PM
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...
Title: Re: Pinfo Class
Post by: MatheuS on Oct 02, 2015, 06:44 PM
pinfo[player.ID] = null; ???
Title: Re: Pinfo Class
Post by: FarisDon on Oct 02, 2015, 06:53 PM
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.
Title: Re: Pinfo Class
Post by: Xmair on Oct 03, 2015, 03:37 AM
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.
Title: Re: Pinfo Class
Post by: FarisDon on Oct 03, 2015, 06:01 AM
Nope, but i mean that! Is it needed to remove player from player part function in of pinfo class?
Title: Re: Pinfo Class
Post by: Xmair on Oct 03, 2015, 06:43 AM
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.
Title: Re: Pinfo Class
Post by: KAKAN on Oct 03, 2015, 07:23 AM
Put this on onPlayerPart xD
KickPlayer(player);Now remove part messages from server.conf
And make a function for it.
Title: Re: Pinfo Class
Post by: Xmair on Oct 03, 2015, 08:30 AM
This isn't a place to spam jokes, @KAKAN .
Title: Re: Pinfo Class
Post by: KAKAN on Oct 03, 2015, 09:15 AM
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
Title: Re: Pinfo Class
Post by: EK.IceFlake on Oct 03, 2015, 10:14 AM
What will happen if you kick the player when he is leaving? That might prevent reconnecting for death evade. Might.
Title: Re: Pinfo Class
Post by: Thijn on Oct 03, 2015, 11:41 AM
I don't get what kicking a player when he leaves has to do with a timer that keeps running?