The online racing simulator
How can i reduce the speedtrap limt
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]case[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] 15:[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TrapDistance15 = (([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Math[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Sqrt([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Math[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Pow(MCI.Info[i].X - (-200 * 196608), 2) + [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Math[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].Pow(MCI.Info[i].Y - (-1 * 196608), 2)) / 65536);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] (TrapDistance15 <= 30)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Convert[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ToInt32((MCI.Info[i].Speed * (100f / 32768f)) * 3.6f) > 150 && Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].InTrap == 0)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ExcessSpeed = ([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Convert[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].ToInt32((MCI.Info[i].Speed * (100f / 32768f)) * 3.6f) - 150);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] SpeedFine = ExcessSpeed * 4;[/SIZE]
[SIZE=2]InSim.Send_MST_Message([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"/msg ^6| ^7SPEEDING: "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Username);[/SIZE]
[SIZE=2]InSim.Send_MST_Message([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"/msg ^6| ^1"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Username + [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]" was fined "[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] + SpeedFine);[/SIZE]
[SIZE=2]Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash -= SpeedFine;[/SIZE]
[SIZE=2]Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].InTrap = 1;[/SIZE]

Could someone tip me on how to reduce the speed, that the speedtrap triggers at,

I would like it to fine for doing a low speed


Thanks
Mick
Quote :case 15:
int trapdistance15 = ((int)math.sqrt(math.pow(mci.info[i].x - (-200 * 196608), 2) + math.pow(mci.info[i].y - (-1 * 196608), 2)) / 65536);
if (trapdistance15 <= 30)
{
if (convert.toint32((mci.info[i].speed * (100f / 32768f)) * 3.6f) > -->150 <--&& connections[getconnidx(players[getplyidx(mci.info[i].plid)].uniqueid)].intrap == 0)
{
int excessspeed = (convert.toint32((mci.info[i].speed * (100f / 32768f)) * 3.6f) - 150);
int speedfine = excessspeed * 4;
insim.send_mst_message("/msg ^6| ^7speeding: " + connections[getconnidx(players[getplyidx(mci.info[i].plid)].uniqueid)].username);
insim.send_mst_message("/msg ^6| ^1" + connections[getconnidx(players[getplyidx(mci.info[i].plid)].uniqueid)].username + " was fined " + speedfine);
connections[getconnidx(players[getplyidx(mci.info[i].plid)].uniqueid)].cash -= speedfine;
connections[getconnidx(players[getplyidx(mci.info[i].plid)].uniqueid)].intrap = 1;

The red one is the speed

Regarts Heiko1
Ok thank m8

Still wont trigger when they drive past, i must have the xy set wrong

Mick
Try to convert the speed not to int32, try to convert it to int16

FGED GREDG RDFGDR GSFDG