PHP код:
new engine = random(2)+1;
if(f_vHealth < 750)
{
if(engine == 1)
{
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid, "http://static1.grsites.com/archive/sounds/vehicle/vehicle011.mp3", x, y, z, 20.0, 1);
SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
SetTimerEx("SetVehicleEngine", 3000, 0, "dd", vehicleid, playerid);
format(string, sizeof(string), "** %s inserts the key in the ignition.", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string, sizeof(string), "** The engine of the vehicle starts. (( %s ))", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
if(engine > 1 && < 3)
{
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid, "http://static1.grsites.com/archive/sounds/vehicle/vehicle011.mp3", x, y, z, 20.0, 1);
SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
SetTimerEx("SetVehicleEngineFail", 3000, 0, "dd", vehicleid, playerid);
format(string, sizeof(string), "** %s inserts the key in the ignition.", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
format(string, sizeof(string), "** The engine of the vehicle fails to start. (( %s ))", GetPlayerNameEx(playerid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
}
It simply tells you that the variable 'engine' already exists somewhere before your second definition
That could be in the function itself on the same level or in any preceding level or it could be a global variable