Sziasztok.
Olyan gondom van, hogy ha le van állítva a motor és be akarom indítani nem történik a /motor paranccsal semmi.
Mivel van más amivel eltudom indítani elindítottam, és utána beírtam, olyankor beindítja a motort ami már alapból bevan indítva de leállítani nem akarja.. miért??
if(strcmp(cmd, \"/motor\", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
if(engineOn[GetPlayerVehicleID(playerid)])
{
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
return 1;
}
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pPcarkey] == idcar) { }
else { return 1; }
}
if(gEngine[playerid] == 0)
{
engineOn[GetPlayerVehicleID(playerid)] = false;
gEngine[playerid] = 1;
TogglePlayerControllable(playerid, true);
SetTimerEx(\"StartingTheVehicle\",3500,0,\"i\",playerid);
SendClientMessage(playerid, 0x00FF00FF, \"Sikeresen beindítottad a motort.\");
format(string, sizeof(string), \"* %s beindítja a motort.\", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), ON, lights, alarm, doors, bonnet, boot, objective);
}
else if(gEngine[playerid] == 1)
{
engineOn[GetPlayerVehicleID(playerid)] = true;
gEngine[playerid] = 0;
SendClientMessage(playerid, 0x00FF00FF, \"Sikeresen leállítottad a motort.\");
format(string, sizeof(string), \"* %s leállítja a motort.\", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), OFF, lights, alarm, doors, bonnet, boot, objective);
}
return 1;
}
}
}
return 1;
}