The online racing simulator
I need help with !fine
(15 posts, started )
I need help with !fine
hello,


i have my own insim. everything is allright but i have one problem.
!fine makes me problems^^
i hope someone help me
here the code i used:

case "!fine":
if (Connections[GetConnIdx(MSO.UCID)].IsOfficerORCadet == 1)
{
try
{
foreach (clsConnection Conn in Connections)
{
if (Conn.Username == Msg.Remove(0, StrMsg[0].Length + StrMsg[1].Length + 2))
{
Conn.Cash -= int.Parse(StrMsg[1]);
InSim.Send_BTN_CreateButton("^2€" + Connections[GetConnIdx(MSO.UCID)].Cash, Flags.ButtonStyles.ISB_C1, 5, 15, 0, 65, 5, MSO.UCID, 2, false);
InSim.Send_MST_Message("/msg " + Conn.PlayerName + " ^7fined ^2€" + int.Parse(StrMsg[1]));
}
else
{
InSim.Send_MTC_MessageToConnection("^6Command not Authorized or is wrong!", MSO.UCID, 0);
}
}
}
catch
{
}
}
For what is needed this command? Like !fine 10 ?
i have a cruise insim...and a officer can chase a player when he drive to fast or so...and when he busted the player i ll that the officer can type !fine "player" "amount"
The !fine command must be used like this:

!fine 1 stickylfs

The code will work only if the officer is ON-DUTY.

how can i get on duty?^^
Maybe if you type !officer and if you are in Police group
ok we are on duty...but when i type !fine "amount" "user" than appers Command not Authorized or is wrong!


what can i do?


sorry for bad english
ok everything is allright
but i have another problem
we want a radar in game

see this:

// Set a speed trap. It dissolves when you move though
case "!settrap":

if (StrMsg.Length == 2)
{
if (Connections[GetConnIdx(MSO.UCID)].IsOfficerORCadet == 1)
{
try
{
if (Convert.ToInt32(StrMsg[1]) > 0)
{
Connections[GetConnIdx(MSO.UCID)].TrapSpeed = Convert.ToInt32(StrMsg[1]);
TrapUCID = MSO.UCID;
TrapSet = 1;
}
else
{
InSim.Send_MTC_MessageToConnection("^1Trap Error. Speed cannot be 0", MSO.UCID, 0);
}
}
catch
{
InSim.Send_MTC_MessageToConnection("^1Trap Error", MSO.UCID, 0);
}
}
}
if (StrMsg.Length == 1 && TrapSet == 0)
{
if (Connections[GetConnIdx(MSO.UCID)].TrapSpeed > 0)
{
Connections[GetConnIdx(MSO.UCID)].TrapSpeed = 0;
Connections[GetConnIdx(MSO.UCID)].TrapX = 0;
Connections[GetConnIdx(MSO.UCID)].TrapY = 0;
InSim.Send_MTC_MessageToConnection("^6>^1 Trap Removed", MSO.UCID, 0);
}
else
{
InSim.Send_MTC_MessageToConnection("^6>^7 Trap not yet set", MSO.UCID, 0);
}
}
if (StrMsg.Length > 2)
{
InSim.Send_MTC_MessageToConnection("^6>^7 Invalid command. Please see ^2!help^7 for a command list", MSO.UCID, 0);
}
break;



but when we type !settrap then appers this:
Trap not yet set



can u help me?
You must type !radar [Speed] , like !radar 100

It sets the speed to 100, if don't respect shows message
must be !settrap [SPEED] in kph
ok...how can i change that automaticly fined that player wich is speeding?
Find "SPEEDING:" on your project, then add

Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[Speeder].PLID)].UniqueID)].Cash -= [B]FINE[/B];

under :

InSim.Send_MST_Message("/msg ^6>^7 TRAP: " + Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].PlayerName);

I didn't test so I don't know if it works
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[Speeder].PLID)].UniqueID)].Cash -= FINE;



this is ok but FINE is without funktion...when i write 1000 or so then is ok
I typed FINE for to you set the amount of money !
ok...but one problem is there...when a player drive to fast in the speedtrap he must pay 3 or 4 times

I need help with !fine
(15 posts, started )
FGED GREDG RDFGDR GSFDG