05.07.2011, 07:25
Hey all,I want to ask.How I can to do, to take from player vehicle gas from that how mach he run with vehicle?for ex:
Player run with vehicle about 1 km,and take from he 1 gas.I want to do this with timer 1 sec who check if player run with vehicle :1km - 1 gas , 2km - 1gas more, 3km - 1gas more,but i just do if player run with vehicle 1 km from he takes 1 gas and i set timer for 1 sec and for every 1 sec from my take gas,but i want to do that what i write higher.here is my check
public Speed(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(model != 481 && model != 510 && model != 509)
{
if(vehicleDB[vehicleid][gas] > 2)
{
if(vehicleDB[vehicleid][prav]/10000 == 1)
{
vehicleDB[vehicleid][gas] --;
}
}
}
}
}
}
with this:
if(vehicleDB[vehicleid][prav]/10000
i check all player run with vehicle distance
Player run with vehicle about 1 km,and take from he 1 gas.I want to do this with timer 1 sec who check if player run with vehicle :1km - 1 gas , 2km - 1gas more, 3km - 1gas more,but i just do if player run with vehicle 1 km from he takes 1 gas and i set timer for 1 sec and for every 1 sec from my take gas,but i want to do that what i write higher.here is my check
public Speed(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(model != 481 && model != 510 && model != 509)
{
if(vehicleDB[vehicleid][gas] > 2)
{
if(vehicleDB[vehicleid][prav]/10000 == 1)
{
vehicleDB[vehicleid][gas] --;
}
}
}
}
}
}
with this:
if(vehicleDB[vehicleid][prav]/10000
i check all player run with vehicle distance