14.01.2012, 19:04
It simply does not work. I don't know why..
Timer:
pawn Код:
CMD:eon(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOUR_GREY, "You are not in a vehicle.");
EngineStartStatus[playerid] = 3;
engineon = SetTimer("EngineOn", 3000, 0);
new vehicleid = GetPlayerVehicleID(playerid);
if(EngineStartStatus[playerid] == 1)
{
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}
pawn Код:
forward EngineOn();
public EngineOn()
{
foreach(Player, i)
{
if(EngineStartStatus[i] == 3)
{
GameTextForPlayer(i, "~g~Engine Starting...", 1000, 5);
EngineStartStatus[i] --;
}
if(EngineStartStatus[i] == 2)
{
GameTextForPlayer(i, "~g~Engine Starting..", 1000, 5);
}
if(EngineStartStatus[i] == 1)
{
EngineStartStatus[i] = 1;
KillTimer(engineon);
GameTextForPlayer(i, "~g~Engine Started.", 1000, 5);
}
}
return 1;
}