26.07.2012, 17:07
Then get a new engine, ha. ha. ha.
No honestly, this should fix it.
EDIT:
I would suggest storing the gEngine onto the vehicleid, instead of playerid.
No honestly, this should fix it.
pawn Код:
if(strcmp(cmd, "/engine", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) != PLAYER_STATE_PASSENGER)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(gEngine[playerid] != 1)
{
SCM(playerid, COLOR_PINK, "Car engine started.");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(pveh, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(pveh, 1, lights, alarm, doors, bonnet, boot, objective);
gEngine[playerid] = 1;
engineOn[pveh] = 1;
format(string, sizeof(string), "%s starts the car's engine.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else if(gEngine[playerid] == 1)
{
SCM(playerid, COLOR_PINK, "Car engine stopped.");
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(pveh, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(pveh, 0, lights, alarm, doors, bonnet, boot, objective);
gEngine[playerid] = 0;
engineOn[pveh] = 0;
format(string, sizeof(string), "%s stops the car's engine.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
}
else
{
SCM(playerid, COLOR_CREAM, "You cannot start the engine as passenger.");
return 1;
}
}
else
{
SCM(playerid, COLOR_CREAM, "You are not in a vehicle.");
return 1;
}
}
}
I would suggest storing the gEngine onto the vehicleid, instead of playerid.