else if (strcmp("/en", cmdtext, true) == 0)
{
new caridi = GetPlayerVehicleID(playerid);
if(zavodis[playerid] == 0)
{
if(GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(Fuell[caridi] <= 0) return SendClientMessage(playerid,COLOR_WHITE, "::: Нет бензина! :::" );
GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid) ,VEHICLE_PARAMS_ON,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
zavodis[playerid] = 1;
}
}
}
else if(zavodis[playerid] == 1)
{
if(GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
GetVehicleParamsEx(GetPlayerVehicleID(playerid),engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid),VEHICLE_PARAMS_OFF,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
zavodis[playerid] = 0;
}
}
}
return 1;
if(newstate == PLAYER_STATE_DRIVER)
{
if(Fuell[caridi] <= 0)
{
GetVehicleParamsEx(caridi ,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(caridi ,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid, COLOR_REDD, "::: В автомобиле нет бензина ::: ");
SendClientMessage(playerid, COLOR_GREEN, "{62AD50}Используйте телефон {FFFFFF}(( /call )) {62AD50}вызвать механика / таксиста");
PlayerInfo[playerid][pFuelcar] = 0;
}
if(GetVehicleModel(caridi) != 481 || GetVehicleModel(caridi) != 509 || GetVehicleModel(caridi) != 510)
{
if(zavodis[playerid] == 0)
{
SendClientMessage(playerid,COLOR_GREEN,"{26931c}Чтобы завести двигатель нажмите на клавишу {ffffff}'2'{26931c} или введите {ffffff}'/en'");
}
}
}
new EngineRunning[MAX_VEHICLES]; // в начало кода (состояние двигателя)
// далее заменяешь свой второй код на это (предварительно сделал бекап :))
if(newstate == PLAYER_STATE_DRIVER)
{
if(Fuell[caridi] <= 0)
{
GetVehicleParamsEx(caridi ,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(caridi ,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
SendClientMessage(playerid, COLOR_REDD, "::: В автомобиле нет бензина ::: ");
SendClientMessage(playerid, COLOR_GREEN, "{62AD50}Используйте телефон {FFFFFF}(( /call )) {62AD50}вызвать механика / таксиста");
PlayerInfo[playerid][pFuelcar] = 0;
if(EngineRunning[caridi] == true) // Если двигатель работает, то глушим его
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(caridi, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(caridi, false, lights, alarm, doors, bonnet, boot, objective);
EngineRunning[caridi] = false;
}
}
else
{
if(EngineRunning[caridi] == false) // Если двигатель загрушен, то заводим его
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(caridi, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(caridi, true, lights, alarm, doors, bonnet, boot, objective);
EngineRunning[caridi] = true;
}
}
if(GetVehicleModel(caridi) != 481 || GetVehicleModel(caridi) != 509 || GetVehicleModel(caridi) != 510)
{
if(zavodis[playerid] == 0)
{
SendClientMessage(playerid,COLOR_GREEN,"{26931c}Чтобы завести двигатель нажмите на клавишу {ffffff}'2'{26931c} или введите {ffffff}'/en'");
}
}
}
Fuell[caridi] < 1
Для начала поправить надо Fuell[caridi] <= 0 на
pawn Code:
|
Process started >>>
new.pwn(20118) : warning 213: tag mismatch
new.pwn(20120) : warning 219: local variable "engine" shadows a variable at a preceding level
new.pwn(20120) : warning 219: local variable "lights" shadows a variable at a preceding level
new.pwn(20120) : warning 219: local variable "alarm" shadows a variable at a preceding level
new.pwn(20120) : warning 219: local variable "doors" shadows a variable at a preceding level
new.pwn(20120) : warning 219: local variable "bonnet" shadows a variable at a preceding level
new.pwn(20120) : warning 219: local variable "boot" shadows a variable at a preceding level
new.pwn(20120) : warning 219: local variable "objective" shadows a variable at a preceding level
new.pwn(20128) : warning 213: tag mismatch
new.pwn(20130) : warning 219: local variable "engine" shadows a variable at a preceding level
new.pwn(20130) : warning 219: local variable "lights" shadows a variable at a preceding level
new.pwn(20130) : warning 219: local variable "alarm" shadows a variable at a preceding level
new.pwn(20130) : warning 219: local variable "doors" shadows a variable at a preceding level
new.pwn(20130) : warning 219: local variable "bonnet" shadows a variable at a preceding level
new.pwn(20130) : warning 219: local variable "boot" shadows a variable at a preceding level
new.pwn(20130) : warning 219: local variable "objective" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Header size: 9316 bytes
Code size: 2085552 bytes
Data size: 7134848 bytes
Stack/heap size: 24000 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 9253716 bytes
16 Warnings.
удали строки new engine, lights, alarm, doors, bonnet, boot, objective; внутри IF
|
А все false и true замени на 0 и 1 соответственно, параметры машины не булевы значения!
|