The online racing simulator
Timer - Timing
(9 posts, started )
#1 - sun
Timer - Timing
hello, programmers.

I think i have found out, that sending a message every so often. i found this inside my code:

System.Timers.Timer PayUser = new System.Timers.Timer(1000);

But it has pay user in it...

Can any one help with a timer ? counting down ? i'am working at my best programming skill

Regards

Owen.
Hello sun
that is the code for the cash. Now i give u a Message Timer (a message wich comes at every [second,minute,hour] read what i wrote at the las line.
System.Timers.Timer MesaggeTimer = new System.Timers.Timer(1);

Fil that in The insim conect (at there where is that with PayUser)

MesaggeTimer.Enabled = true;
MesaggeTimer.Elapsed += new System.Timers.ElapsedEventHandler(MesaggeTimer_Elapsed);

And now the thing for you message (what it does shows)



foreach (clsPlayer Ply in Players)
{
if (Ply.Payout > 3)
{
Ply.Payout = 0;
Insim.Send_MST_Mesagge("YouText");
Insim.Send_MST_Mesagge("YouText");
}
}

at the if(Ply.Payout >3) [the three are the seconds]


Hope that help you

Greetings Marco
You do realise the code above, If there is more then 3 players, Can be potentially dangrous?
#4 - sun
Quote from Heiko1 :Hello sun
that is the code for the cash. Now i give u a Message Timer (a message wich comes at every [second,minute,hour] read what i wrote at the las line.
System.Timers.Timer MesaggeTimer = new System.Timers.Timer(1);

Fil that in The insim conect (at there where is that with PayUser)

MesaggeTimer.Enabled = true;
MesaggeTimer.Elapsed += new System.Timers.ElapsedEventHandler(MesaggeTimer_Elapsed);

And now the thing for you message (what it does shows)



foreach (clsPlayer Ply in Players)
{
if (Ply.Payout > 3)
{
Ply.Payout = 0;
Insim.Send_MST_Mesagge("YouText");
Insim.Send_MST_Mesagge("YouText");
}
}

at the if(Ply.Payout >3) [the three are the seconds]


Hope that help you

Greetings Marco

Thank you Very Much!
No problem

I learned now out of my faults what i've done here.

SORRY GUYS!


PS: Sun read u pm plz
Quote from mcgas001 :You do realise the code above, If there is more then 3 players, Can be potentially dangrous?

they probably dont cause there servers never have more than 3 players in
#7 - sun
actually i've spotted an error.

foreach (clsPlayer Ply in Players)

in the code there already is a 'Ply'
Quote from sun :actually i've spotted an error.

foreach (clsPlayer Ply in Players)

in the code there already is a 'Ply'

Ply in that instance is the name of the variable used to access the connections list. It's supposed to be in the code already
@ Robbo1
At our server are more than 3ppl.

@ Dougie-Lampkin
Thx, i forgot that:Eyecrazy:

Timer - Timing
(9 posts, started )
FGED GREDG RDFGDR GSFDG