07.08.2012, 18:43
pawn Код:
if(PRESSED(KEY_CROUCH))
{
if(IsPublicService(GetPlayerVehicleID(playerid)) && GetPlayerVehicleSeat(playerid) == 0)
{
switch(GetPVarInt(playerid, "CopFlash"))
{
case 0:
{
KillTimer(BlinkTime[playerid]);
BlinkTime[playerid] = SetTimerEx("vBlinker", PFLASH_RATE, 1, "i", playerid);
SetPVarInt(playerid, "CopFlash", 1);
}
case 1:
{
KillTimer(BlinkTime[playerid]);
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
lights = encode_lights(1, 1, 1, 1);
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
SetPVarInt(playerid, "CopFlash", 0);
}
}
}
}
if(PRESSED(KEY_LOOK_LEFT))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
if(GetPVarInt(playerid, "vBLeft") == 0)
{
KillTimer(BlinkTime[playerid]);
BlinkTime[playerid] = SetTimerEx("vBlinker", BLINK_RATE, 1, "i", playerid);
SetPVarInt(playerid, "vBLeft", 1);
SetPVarInt(playerid, "vBRight", 0);
}
else
{
KillTimer(BlinkTime[playerid]);
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
switch(GetPVarInt(playerid, "vMainOn"))
{
case 0:
{
lights = encode_lights(1, 1, 1, 1);
}
case 1:
{
lights = encode_lights(0, 0, 0, 0);
}
}
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
SetPVarInt(playerid, "vBLeft", 0);
}
}
}
if(PRESSED(KEY_LOOK_RIGHT))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
if(GetPVarInt(playerid, "vBRight") == 0)
{
KillTimer(BlinkTime[playerid]);
BlinkTime[playerid] = SetTimerEx("vBlinker", BLINK_RATE, 1, "i", playerid);
SetPVarInt(playerid, "vBRight", 1);
SetPVarInt(playerid, "vBLeft", 0);
}
else
{
KillTimer(BlinkTime[playerid]);
new panels, doors, lights, tires;
new carid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(carid, panels, doors, lights, tires);
switch(GetPVarInt(playerid, "vMainOn"))
{
case 0:
{
lights = encode_lights(1, 1, 1, 1);
}
case 1:
{
lights = encode_lights(0, 0, 0, 0);
}
}
UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
SetPVarInt(playerid, "vBRight", 0);
}
}
return 1;
}