hey,
I'm still wondering how to give a bonus when a certain kiloMeter has been driven. I'm willing to give you my code below.
The only problem with this is that, it keeps on giving you money constantly, every second. I really dont know whats wrong.
Can anyone help me?
I'm still wondering how to give a bonus when a certain kiloMeter has been driven. I'm willing to give you my code below.
[SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]
if (100 < Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalDistance / 1000)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash += 19155;
}
if (200 < Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalDistance / 1000)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash += 29000;
}
if (300 < Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalDistance / 1000)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash += 30000;
}
if (400 < Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalDistance / 1000)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash += 40000;
}
if (500 < Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalDistance / 1000)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash += 50000;
}
if (600 < Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalDistance / 1000)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash += 60000;
}
if (700 < Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalDistance / 1000)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash += 70000;
}
if (800 < Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalDistance / 1000)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash += 80000;
}
if (900 < Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalDistance / 1000)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash += 90000;
}
if (1000 < Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].TotalDistance / 1000)
{
Connections[GetConnIdx(Players[GetPlyIdx(MCI.Info[i].PLID)].UniqueID)].Cash += 100000;
}
[/COLOR][/SIZE][/COLOR][/SIZE]
The only problem with this is that, it keeps on giving you money constantly, every second. I really dont know whats wrong.
Can anyone help me?