11.08.2011, 08:41
I couldn't understand hardly anything you were saying. Anyway, the following code has a few (possible) errors:
How does that code even compile? You never create a vehicleid variable, yet you use it. Another potential flaw is that you mean to, assumed by the comments, set the player's PVar value. However, you set it based on the vehicleid, which may cause a problem if the vehicle ID of the driver does not match the player's ID.
I cannot assist you any further as I just simply cannot understand what you're saying.
pawn Код:
public Speed(playerid)
{
if(model != 481 && model != 510 && model != 509)//if not bikes
{
if(vehicleDB[vehicleid][gas] > 2)// if more than 2 gas
{
SetPVarFloat(vehicleid,"PravAfter",vehicleDB[vehicleid][prav]/10000);//Other pvar who i set after prav(vehicle distance).
if(GetPVarFloat(vehicleid,"PravBefore") + GetPVarFloat(playerid,"PravAfter") >= 0.1)
{
vehicleDB[vehicleid][gas] -=0.1;
return 1;
}
SendClientMessage(playerid,COLOR_GREEN,"Before prav has been set");
SetPVarFloat(vehicleid,"PravBefore",vehicleDB[vehicleid][prav]/10000); // Save the float into a player variable
}
}
return 1;
}
I cannot assist you any further as I just simply cannot understand what you're saying.