PDA

View Full Version : Insim Code Help (Auto Message)


chrizza132
16th November 2010, 11:37
hey guys

im currently coding my insim and im stuck on getting it to auto message well it doesnt work properly

it will say all 3 messages but it stops at the thrid one here's the code i have


void Automsg_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
try
{
switch (TempMessage)
{
case 1:
InSim.Send_MST_Message("/msg ^1REMEMBER: ^7Drive on the ^3RIGHT ^7side of the road!");
break;


case 2:
InSim.Send_MST_Message("/msg ^7For more updates, events, and more,");
InSim.Send_MST_Message("/msg ^7Access us at ^3http://dscruise.co.cc/");
break;

case 3:
InSim.Send_MST_Message("/msg ^7Report a player, Abuse or Ramming");
InSim.Send_MST_Message("/msg ^7Post a report on ^3http://dscruise.co.cc");


break;


}
TempMessage += 1;
}
catch
{

}
}


i have set all the timers and everything just doesnt want to reapeat

could anyone help me?

skywatcher122
16th November 2010, 13:03
i think thats my code on GIR Cruise InSim

here is the parameter to fix it

don't use switch i just use if (TempMessage == 1)

chrizza132
16th November 2010, 14:12
i think thats my code on GIR Cruise InSim

here is the parameter to fix it

don't use switch i just use if (TempMessage == 1)

that is your code ;)

im using it in my insim im building it from scratch.


btw that still didnt work it gets to the last msg and then stops alltogehter doesnt restart at message 1

skywatcher122
16th November 2010, 14:13
here is the reason why it doesnt reset to 1

add on your case 3:
TempMessage = 1;

and thats it ;)

chrizza132
16th November 2010, 14:26
here is the reason why it doesnt reset to 1

add on your case 3:
TempMessage = 1;

and thats it ;)

got it to work :D had to put TempMessage = -2; and now it reapeats :D thanks skywatcher for your help :)

MariusMM
16th November 2010, 14:32
void Automsg_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
try
{
switch (TempMessage)
{
case 1:
InSim.Send_MST_Message("/msg ^1REMEMBER: ^7Drive on the ^3RIGHT ^7side of the road!");
TempMessage += 1;
break;


case 2:
InSim.Send_MST_Message("/msg ^7For more updates, events, and more,");
InSim.Send_MST_Message("/msg ^7Access us at ^3http://dscruise.co.cc/");
TempMessage += 1;
break;

case 3:
InSim.Send_MST_Message("/msg ^7Report a player, Abuse or Ramming");
InSim.Send_MST_Message("/msg ^7Post a report on ^3http://dscruise.co.cc");
TempMessage = 1;
break;


}
}
catch
{

}
}

Should do the trick... There are prettier ways though.