- 307
- 218
C++:
stock SetEngenieAndLigths(const vehicleid, const eng, const lights, const lock){
new Pcar[7];
GetVehicleParamsEx(vehicleid, Pcar[0], Pcar[1], Pcar[2], Pcar[3], Pcar[4], Pcar[5], Pcar[6]);
SetVehicleParamsEx(vehicleid, eng, lights, Pcar[2], lock, Pcar[4], Pcar[5], Pcar[6]);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_NO || newkeys & KEY_FIRE || newkeys & KEY_CROUCH)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new ss = ifPlayerCenBeenInVehicle(playerid, GetPlayerVehicleID(playerid));
if (ss == 1){
if (isWithEngenie(GetPlayerVehicleID(playerid))){
new v = GetPlayerVehicleID(playerid);
if (newkeys & KEY_NO){
if(!vehicle_info[v][vFuel]) return 0;
vehicle_info[v][vEngine] = !bool:vehicle_info[v][vEngine];
}
if (newkeys & KEY_FIRE) vehicle_info[v][vLights] = !bool:vehicle_info[v][vLights];
if (newkeys & KEY_CROUCH){
for(new i = 0; i < MAX_GATES; i++)
{
if (Gates[i][timeToClose] == 0){
if(IsPlayerInRangeOfPoint(playerid, 15.0, Gates[i][GangleX], Gates[i][GangleY], Gates[i][GangleZ])) {
OpenGate(i);
Gates[i][timeToClose] = 15;
}
}
}
}
SetEngenieAndLigths(v, vehicle_info[v][vEngine], vehicle_info[v][vLights], vehicle_info[v][isLocked]);
UpdateAll(playerid, v);// обновление на худе скорости
}
}else if (ss == 0) RemovePlayerFromVeh(playerid);
}
}
return 1;
}
Не светятся фары когда они должны быть включены. Выхожу с машины они включаются.
Последнее редактирование: