Hmm, it worked for the first time, but not for the second time o_o.
This is a part of the code
pawn Код:
new Float:Speed, Float:vehealth, string[128], string2[128], oldhealth[256];
GetVehicleSpeed(vehicleid, Speed);
GetVehicleHealth(vehicleid, vehealth);
format(string, sizeof(string), "%d", vehicleid);
oldhealth = dini_Get("VehicularDamage.txt", string);
format(string2, sizeof(string2), "Health ondamagestatus: %d", vehealth);
printf(string2);
format(string2, sizeof(string2), "Vehicular damage: %d", strval(oldhealth));
printf(string2);
if(AntiCrash[playerid]==0 && Speed > 20 && Speed < 40 && vehealth != strval(oldhealth)){
SetPlayerDrunkLevel(playerid, 5000);
SetTimerEx("StopCrashEffect", 3000,0,"i", playerid); // 3 secs
AntiCrash[playerid]=1;
format(string2, sizeof(string2), "%d", vehealth);
dini_Set("VehicularDamage.txt",string,string2);
return 1;
}
public StopCrashEffect(playerid){
SetPlayerDrunkLevel(playerid, 0);
AntiCrash[playerid]=0;
return 1;
}
It seems to print well...
When I activate the lights, the health stays the same... Except the drunk effect still affects me.
Lights on:
[09:20:17] Health ondamagestatus: 1148558252
[09:20:17] Vehicular damage: 1148558252
[09:20:31] Health ondamagestatus: 1148558252
[09:20:31] Vehicular damage: 1148558252
[09:20:31] Health ondamagestatus: 1148558252
[09:20:31] Vehicular damage: 1148558252
After a crash:
[09:20:31] Health ondamagestatus: 1148336607
[09:20:31] Vehicular damage: 1148558252
[09:20:35] Health ondamagestatus: 1148227502
[09:20:35] Vehicular damage: 1148558252